Spotify Connect - Troubleshooting

Reply
Highlighted

Spotify Connect - Troubleshooting

vgab
Casual Listener

I am trying to setup Spotify connect. I run the linux client on my desktop and the Android client on my smartphone. The smartphone is connected to the local WLAN. The desktop is connected to the same IP subnet via ethernet. The smartphone does not detect the desktop via Spotify Connect, though.

 

Everything I can find about network setup is the following useless comment:

The following IP ranges should be open on port 4070: 78.31.8.0/21, 193.182.8.0/21.
That number 21 is the prefix length

This is not even half the information necessary. 😞 I need the following information for every communication spotify requires:

  1. Which device uses the communication (the controlling or the controlled device, in that case the phone or the desktop)
  2. Which protocol is used by the communication (TCP, UDP, ...)
  3. Does the communication use broadcasting or multicasting?
  4. For TCP or SCTP: is the connection outbound (iniated by the device in question 1) or inbound (the device in question 1 listens for such connections from elsewhere)
  5. For inbound connections: the source IP address or address range (the IP address of the device iniating the connection) and the destination port (the port where the device in question 1 listens for incoming connections).

For a reference example:

The desktop device has IP address 192.168.93.100

The phone has IP address 192.168.93.104

Both have outbound internet access via gateway 192.168.93.1

 

Spotify communications on my machine:

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 127.0.0.1:4381 0.0.0.0:* LISTEN 22382/spotify
tcp 0 0 127.0.0.1:8099 0.0.0.0:* LISTEN 22382/spotify
tcp 0 0 127.0.0.1:4371 0.0.0.0:* LISTEN 22382/spotify
tcp 0 0 0.0.0.0:57621 0.0.0.0:* LISTEN 22382/spotify
tcp 0 0 192.168.93.101:46839 193.235.232.21:4070 VERBUNDEN 22382/spotify
tcp 0 0 192.168.93.101:57621 192.168.93.104:53357 VERBUNDEN 22382/spotify

 

The last line tells me the phone and the desktop are connected to each other. They do exchange data:

pkts bytes target prot opt in out source destination

115 33507 ACCEPT tcp -- net0 any 192.168.93.0/24 anywhere tcp dpt:57621

 

Nevertheless, the phone claims there are no devices to connect to, and it does not control the desktop. I'm confused. What might be going wrong?

7 Replies
Highlighted

Re: Spotify Connect - Troubleshooting

user-removed
Not applicable

Hi! Try connecting them on the same WiFi. I think it only works with the same WiFi. Hope this helps 🙂

Highlighted

Re: Spotify Connect - Troubleshooting

vgab
Casual Listener

The desktop has no wi-fi. It's on the same IP subnet as the phone (192.168.93.0/24) without any address magic (like NAT) inbetween (bridged ethernet/wireless).  There IS a firewall, but disabling it doesn't make it work so that's not the root cause.

 

So if spotify uses only standard IP packets that should be as good as "the same wi-fi". If it does more involved things, I need to know which, thats why I asked about broadcasting and other protocols. In any case, for proper firewall setup later I need to know which holes to punch specifically.

 

P.S. It seems it is using IP multicasting for mDNS/DNS-SD ("ZeroConf"), network-local HTTP and a third protocol relayed by the spotify servers  [1]  I wonder whether I need avahi installed? Is anyone else using spotify connect on linux?

 

Highlighted

Re: Spotify Connect - Troubleshooting

Spotify
Spotify

I don't know the exact details about how devices are detected to be near, but it is probably "zeroconf" and some other local subnet probing.

 

You should definitely be able to control your ethernet only desktop, especially if you know this much about networking. I am controlling a desktop linux ethernet from my android right now.

 

The only thing I can think of is that you are using the stable version of Spotify on 32-bit linux, which is only version 0.9.4 which does not have connect support. You need either 0.9.17 which is 64-bit only or the testing version, which is currently 1.0.14 for both 32 and 64-bit.

Highlighted

Re: Spotify Connect - Troubleshooting

vgab
Casual Listener

Thank you a lot, jooon, that was a very useful hint. I checked and as it turns out, I'm already using v0.9.17.

As it seems to work for you, can you watch the network what it is doing? Do you have an idea what might be different between your setup and mine? How do you connect ethernet and wi-fi?

Highlighted

Re: Spotify Connect - Troubleshooting

Dreadlord
Community Legend

Hello @vgab,


Hope you are doing well.

Lets start with the IP ranges :

 

 

193.235.232.0/22  - Spotify UK

194.132.168.0/21 - Spotify Sweeden 

IP range (network - broadcast)        Subnet Mask  
193.235.232.0 - 193.235.235.255     255.255.252.0
194.132.168.0 - 194.132.175.255     255.255.248.0

 

But this should not be the case.

I would love to see some tcpdump and netstat, but lets start just with netstat :

 

netstat -antp | grep spotify

edit : It looks like the connection is done over different port every time spotify is restarted, so it is good idea to open all the ports and check if Spotify connect is working normally : )

If this solved your issue - Mark it as a solution!
Twitter | Website |
What's a Spotify Rock Star, and how do I become one?



Highlighted

Re: Spotify Connect - Troubleshooting

vgab
Casual Listener

Hello dreadlord,

 

I already posted a netstat in the first post. in fact, almost exactly the command you asked for 🙂 I only added -v as well.

 

P.S. Oops, it is localized. "VERBUNDEN" means connected in that case.

P.P.S. I would love to do some packet capture, but obviously I'd need to know what to look for first.

3PS. For completeness sake: I also mentioned in the OP that I did switch off the firewall completely for initial testing.

Highlighted

Re: Spotify Connect - Troubleshooting

spotifyum
Casual Listener
@vgab Did you succeed? I am facing similar problems. I have a Denon receiver (AVR-x1200w) to which Android and iOS devices connect. Initially just over my wifi access point then via a switch to the receiver. Did not work. I have open wrt on the access point. Finally removed the wire connection to the receiver. That works too some extend, but not stable. Probably because besides the access point there is also the wifi router (also running open wrt). So once the mobile devices connect to the router they use a different channel than the Denon and then that is when I assume the Denon becomes invisible. So I would also appreciate any hint on which protocol I need to enable on my open wrt devices. I found https://www.csc.kth.se/~gkreitz/spotify/kreitz-spotify_kth11.pdf, which seems to be a presentation (date 09/2011) from a technically savvy Spotify employee: gkreitz@spotify.com. So if were able to resolve the issue and you can provide me with the information I need that would be great. Otherwise I'd contact Gunnar Kreitz next.
SUGGESTED POSTS