Comments (6)
Does ping resolve the name?
from snapcast.
Does ping resolve the name?
Yes
ping snapserver.audio.mediacenter.home
PING my-machine-hw1.lan (192.168.3.1): 56 data bytes
64 bytes from 192.168.3.1: icmp_seq=0 ttl=64 time=2.232 ms
from snapcast.
Please try the latest version of the develop branch, it will log all resolved IP addresses.
from snapcast.
I installed this snapcast_armhf-debian-bookworm-1184cf1db39e6106a3442ae92e92f5b872ac1b62's snapclient binary
Logs with CNAME record:
/usr/bin/snapclient --host=snapserver.audio.mediacenter.home --port=1704 --hostID='davida-audiospeaker-hw0' --instance=1 --priority=-6 --logsink=stdout --logfilter='*:debug'
2024-03-28 04-23-56.876 [Debug] (Snapclient) Trying to get PCM device for player: alsa, parameter: , card: default
2024-03-28 04-23-56.960 [Info] (Snapclient) Version 0.28.0.1, revision 1184cf1d
2024-03-28 04-23-56.960 [Info] (Connection) Resolving host IP for: snapserver.audio.mediacenter.home
2024-03-28 04-23-56.968 [Debug] (Connection) Resolved IP: fd5e:29da:e475::1
2024-03-28 04-23-56.968 [Debug] (Connection) Resolved IP: 192.168.3.1
2024-03-28 04-23-56.968 [Info] (Connection) Connecting to [fd5e:29da:e475::1]:1704
2024-03-28 04-23-56.972 [Error] (Connection) Failed to connect to host 'snapserver.audio.mediacenter.home', error: Connection refused
2024-03-28 04-23-56.972 [Error] (Controller) Error: Connection refused
2024-03-28 04-23-56.972 [Debug] (Connection) Disconnecting
2024-03-28 04-23-56.972 [Error] (Connection) Error in socket shutdown: Transport endpoint is not connected
Log without CNAME record:
/usr/bin/snapclient --host=192.168.3.1 --port=1704 --hostID='davida-audiospeaker-hw0' --instance=1 --priority=-6 --logsink=stdout --logfilter='*:debug'
024-03-28 04-25-57.667 [Debug] (Snapclient) Trying to get PCM device for player: alsa, parameter: , card: default
2024-03-28 04-25-57.711 [Info] (Snapclient) Version 0.28.0.1, revision 1184cf1d
2024-03-28 04-25-57.712 [Info] (Connection) Resolving host IP for: 192.168.3.1
2024-03-28 04-25-57.712 [Debug] (Connection) Resolved IP: 192.168.3.1
2024-03-28 04-25-57.712 [Info] (Connection) Connecting to 192.168.3.1:1704
2024-03-28 04-25-57.715 [Notice] (Connection) Connected to 192.168.3.1
2024-03-28 04-25-57.716 [Info] (Connection) My MAC: "02:51:03:41:2e:99", socket: 8
So the snapclient is connecting with a IPv6 address fd5e....
to the snapserver and the snapserver is not listening on IPv6 by default.
I configured IPv6 support for snapserver (v0.28.0 beta1) and the client can now connect successfully.
/usr/bin/snapclient --host=snapserver.audio.mediacenter.home --port=1704 --hostID='davida-audiospeaker-hw0' --instance=1 --priority=-6 --logsink=stdout --logfilter='*:debug'
2024-03-28 04-41-52.536 [Debug] (Snapclient) Trying to get PCM device for player: alsa, parameter: , card: default
2024-03-28 04-41-52.654 [Info] (Snapclient) Version 0.28.0.1, revision 1184cf1d
2024-03-28 04-41-52.654 [Info] (Connection) Resolving host IP for: snapserver.audio.mediacenter.home
2024-03-28 04-41-52.670 [Debug] (Connection) Resolved IP: fd5e:29da:e475::1
2024-03-28 04-41-52.670 [Debug] (Connection) Resolved IP: 192.168.3.1
2024-03-28 04-41-52.670 [Info] (Connection) Connecting to [fd5e:29da:e475::1]:1704
2024-03-28 04-41-52.677 [Notice] (Connection) Connected to fd5e:29da:e475::1
2024-03-28 04-41-52.678 [Info] (Connection) My MAC: "02:51:03:41:2e:99", socket
@badaix What do you suggest to get the snapclient to prefer IPv4 over IPv6 when both IPs are resolved ?
from snapcast.
I don't know what the best practice is to give a hint to a client on what kind of IP address to resolve, but I think it doesn't make sense to not try other resolved addresses, if the first one is not working.
So I've added a loop through all IP addresses, in case a connection attempt failed.
You can find packages here:
https://github.com/badaix/snapcast/actions/runs/8465628529
from snapcast.
I don't know what the best practice is to give a hint to a client on what kind of IP address to resolve, but I think it doesn't make sense to not try other resolved addresses, if the first one is not working. So I've added a loop through all IP addresses, in case a connection attempt failed. You can find packages here: https://github.com/badaix/snapcast/actions/runs/8465628529
Both resolved IPs are tried and eventually one succeeds.
024-04-01 09-14-28.926 [Debug] (Connection) Disconnected
2024-04-01 09-14-29.926 [Info] (Connection) Resolving host IP for: snapserver.audio.mediacenter.home
2024-04-01 09-14-29.929 [Debug] (Connection) Resolved IP: fdd1:f583:cc37::1
2024-04-01 09-14-29.929 [Debug] (Connection) Resolved IP: 192.168.3.1
2024-04-01 09-14-29.929 [Info] (Connection) Connecting to [fdd1:f583:cc37::1]:1704
2024-04-01 09-14-29.930 [Info] (Connection) Connecting to 192.168.3.1:1704
2024-04-01 09-14-29.932 [Error] (Connection) Failed to connect to host 'snapserver.audio.mediacenter.home', error: Connection refused
2024-04-01 09-14-29.932 [Error] (Controller) Error: Connection refused
2024-04-01 09-14-29.932 [Debug] (Connection) Disconnecting
2024-04-01 09-14-29.932 [Error] (Connection) Error in socket shutdown: Transport endpoint is not connected
2024-04-01 09-14-29.932 [Debug] (Connection) Disconnected
2024-04-01 09-14-30.933 [Info] (Connection) Resolving host IP for: snapserver.audio.mediacenter.home
2024-04-01 09-15-06.620 [Error] (Connection) Failed to resolve host 'snapserver.audio.mediacenter.home', error: Host not found (authoritative)
2024-04-01 09-15-06.620 [Error] (Controller) Error: Host not found (authoritative)
2024-04-01 09-15-06.620 [Debug] (Connection) Disconnecting
2024-04-01 09-15-06.621 [Debug] (Connection) Not connected
2024-04-01 09-15-07.621 [Info] (Connection) Resolving host IP for: snapserver.audio.mediacenter.home
2024-04-01 09-15-19.919 [Error] (Connection) Failed to resolve host 'snapserver.audio.mediacenter.home', error: Host not found (authoritative)
2024-04-01 09-15-19.919 [Error] (Controller) Error: Host not found (authoritative)
2024-04-01 09-15-19.919 [Debug] (Connection) Disconnecting
2024-04-01 09-15-19.919 [Debug] (Connection) Not connected
2024-04-01 09-15-20.920 [Info] (Connection) Resolving host IP for: snapserver.audio.mediacenter.home
2024-04-01 09-15-20.929 [Debug] (Connection) Resolved IP: 192.168.3.1
2024-04-01 09-15-20.930 [Info] (Connection) Connecting to 192.168.3.1:1704
2024-04-01 09-15-20.936 [Notice] (Connection) Connected to 192.168.3.1
Bug resolved. Thank you @badaix
from snapcast.
Related Issues (20)
- Arm64 deb release
- Support for ALSA floating point samples?
- Snapclient Failed HOT 11
- Librespot no sound? HOT 3
- snapclient not finding alsa output on raspi 1b HOT 4
- Snapserver crashes whenever I try to connect to librespot HOT 1
- Meta stream switches streams with delay HOT 10
- Provide Aarch64 in releases HOT 5
- Change dependencies HOT 2
- Non-optimal default settings for codec and chunk_ms? HOT 3
- Unable to bind a TCP server stream to IPv6 Any Address
- snapserver 0.27 armhf does not install on Raspi 1B HOT 4
- Snapcast server 0.27 can't be installed on Debian Bookworm HOT 1
- Snapcast emits stream notifications for streams with `codec=null` HOT 4
- Dropouts: onResync, next read < 0 <--> abs(age > 500), Failed to get chunk HOT 1
- Dsnoop and EAGAIN Handling
- iphone or ipad client? HOT 1
- snapserver: `Error creating TCP acceptor: bind: Address in use` when binding to the same port with IPv4 and IPv6 HOT 2
- Add `Name` to Server Settings message HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snapcast.