juhovh / shairplay

Apple airplay and raop protocol server
Other
1.35k stars 228 forks source link

Multiple Shairplay targets won't coexist on network #52

Closed jacobsevart closed 8 years ago

jacobsevart commented 8 years ago

I'm running Shairplay on two different Raspberry Pis in my house - the second one I added just a moment ago. The devices have different hostnames, IP addresses, and names passed to the -a flag ("Living Room Speakers", "Dining Room Speakers").

However, the only target to appear in my iPhone's list is the one where Shairplay was started first. I can verify this by shutting down both daemons and starting them in a different order.

What gives? There must be some hard-coded value somewhere that's meant to be unique.

jacobsevart commented 8 years ago

From avahi-browse -a:

At https://github.com/juhovh/shairplay/blob/master/src/lib/dnssd.c#L250 you are composing the service name from the hardware address and the name. Apparently the hardware address is always the same. But the two rPIs have different MAC addresses for wlan0.

jacobsevart commented 8 years ago

... and now I see in https://github.com/juhovh/shairplay/blob/master/src/shairplay.c#L257 that you are using a default hardware address and only overriding it when passed the --hwaddr flag, which you even say is useful for running multiple instances. Unfortunately this fact is not in the README, hence my little adventure. I'll open a PR to fix the documentation.