owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.11k stars 237 forks source link

are several remote possible? #364

Closed oliviercommelarbre closed 7 years ago

oliviercommelarbre commented 7 years ago

Hi it is a great application, thanks! i could install on a rasberrypi with not problem and the pairing procedure works as explained. The only thing is that it seems that only one device can be paired as remote. I've been trying to pair both an iPad and an iPhone (so that either can alternatively control the music) but the last one paired seems to override the first one that gets invalidated as soon as it tries to get control again. Is it expected or may be i've something wrongly configured or my db is corrupt? If expected, for sure having the functionality of pairing several remotes would be an added value as an enhancement. thanks for your answer!

ejurgensen commented 7 years ago

Yes, I personally use 3 Remotes, among them an iPhone and iPad. I'm not sure what is happening for you. Do you see any error messages in the log? Or perhaps if you described a bit more precisely what you do, it could clue me in to the issue.

oliviercommelarbre commented 7 years ago

thanks so much for such a quick answer. so amazing if it also works with several remotes, i need to understand though why i can't manage to get it to work. in the log all is clear, saying that the bindings are being made, etc. until the first remote tries to control after the second one was paired. at this point the log says the pairing guid is invalid.

here an extract of the log (log level) when this happens:

.... [2017-03-05 12:20:42] [ LOG] remote: Pairing succeeded with Remote 'iPad' (id 4B7164E0-C9FF-4BDA-B8FC-D7BCF26A2EAE), GUID: 33969F3F208D7FDF [2017-03-05 12:22:46] [ LOG] remote: Discovered remote 'iPad' (id 4B7164E0-C9FF-4BDA-B8FC-D7BCF26A2EAE) at 192.168.178.70:64102, paircode 9ED02B0860636208 [2017-03-05 12:22:58] [ LOG] remote: Read Remote pairing data (name 'iPad', pin '9048') from /mnt/remotes/iPad.remote [2017-03-05 12:22:58] [ LOG] remote: Pairing succeeded with Remote 'iPad' (id 4B7164E0-C9FF-4BDA-B8FC-D7BCF26A2EAE), GUID: 007E54242CBF6C5C [2017-03-05 12:23:48] [ LOG] remote: Discovered remote 'iPhoneO' (id 4B7164E0-C9FF-4BDA-B8FC-D7BCF26A2EAE) at 192.168.178.67:49512, paircode 9BCC782A31083317 [2017-03-05 12:24:10] [ LOG] remote: Read Remote pairing data (name 'iPhoneO', pin '9509') from /mnt/remotes/iPhoneOlivier.remote [2017-03-05 12:24:10] [ LOG] remote: Pairing succeeded with Remote 'iPhoneO' (id 4B7164E0-C9FF-4BDA-B8FC-D7BCF26A2EAE), GUID: 78AA3E05560CE92C [2017-03-05 12:24:16] [ LOG] cache: Beginning DAAP cache update [2017-03-05 12:24:45] [ LOG] cache: DAAP cache updated [2017-03-05 12:24:45] [ LOG] daap: Login attempt with invalid pairing-guid [2017-03-05 12:25:56] [ LOG] cache: Beginning DAAP cache update [2017-03-05 12:26:25] [ LOG] cache: DAAP cache updated .....

ejurgensen commented 7 years ago

Ok, now I see why it is not working - the id of your iPad is precisely the same as the id for your iPhone!

It is very peculiar that the two id's are the same. Forked-daapd gets these id's from Avahi, so to figure out if the problem is with forked-daapd or with mdns (Avahi), could you do the following:

  1. Open a terminal and run "avahi-browse -r -k _touch-remote._tcp"
  2. On one device, select "Add an iTunes library". When the pin-code comes, check what avahi-browse says. It should say something like the below. Now just quit the pairing.
  3. Do the same on the second device.
  4. Does Avahi say id "4B7164E0-C9FF-4BDA-B8FC-D7BCF26A2EAE" for both devices?
oliviercommelarbre commented 7 years ago

thanks again for your help. yes effectively i get exactly the same two IDs:

here the two avahi output:

from the iPhone pairing request:

from the iPad request:

i guess this is not normal... i will try to reboot both devices to see whether something changes. The fact is that it would be an incredible coincidence, i i prefer solar to think of a sort of bug of one or the other, let me reboot it all...

ejurgensen commented 7 years ago

Try restarting Avahi too

oliviercommelarbre commented 7 years ago

right, no change at all after reboot. i did also stop/start of the avahi-daemon and no change either, but at the end i'm not sure whether that's what you mean by restarting avahi, as even if the avahi daemon is stopped, the avahi-browse command is still working. am i doing the right thing?

btw, i did reboot the raspberry pi as well... and still equal IDs from avahi. Do you know if there a way to check these IDs on the devices themselves?

ejurgensen commented 7 years ago

Strange. Yes, for forked-daapd the daemon must be running, but I'm not sure if avahi-browse needs it. When restarting the daemon you could try with --reload.

I don't know of other ways to check the id's. One thing you could try is changing the name of one of your devices. Perhaps that will trigger an update somewhere.

oliviercommelarbre commented 7 years ago

when further in the meantime but still without success, it becomes incredible. the last thing i tried out was to unpair both devices from other libraries as well. reboots and reboots, but still the same ids... :-(

here attached the avahi conf file in case there would be something funny hiding there... i'll try to change the names as you suggest

avahi-daemon.conf.txt

oliviercommelarbre commented 7 years ago

Eureka! changing the names did not solve, but it gave me another idea and bingo ...two new IDs after reinstalling Apple's remote app on the iPad and iPhone i guess that's it, i would like to thank you sincerely for such great help you provided, and wish you all the best for your great project, ciao!

ejurgensen commented 7 years ago

Good to hear you got it solved :-)