Git Product home page Git Product logo

Comments (6)

badaix avatar badaix commented on June 2, 2024

Does ping resolve the name?

from snapcast.

davidandreoletti avatar davidandreoletti commented on June 2, 2024

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.

badaix avatar badaix commented on June 2, 2024

Please try the latest version of the develop branch, it will log all resolved IP addresses.

from snapcast.

davidandreoletti avatar davidandreoletti commented on June 2, 2024

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.

badaix avatar badaix commented on June 2, 2024

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.

davidandreoletti avatar davidandreoletti commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.