philippe44 / LMS-ShairTunes2W

Airtunes with LMS (fork of https://github.com/disaster123/shairport2_plugin)
63 stars 3 forks source link

"AirPlay" devices are not visible in iTunes #21

Closed 8666 closed 5 years ago

8666 commented 5 years ago

Is this normal or I miss some files? Seems like on windows nothing is executed

[19-02-07 23:11:37.4438] Plugins::ShairTunes2W::Plugin::playerSubscriptionChange (354) request=client new client=AirAndroid
[19-02-07 23:11:37.4796] Plugins::ShairTunes2W::Plugin::publishPlayer (470) avahi-publish-player not in path
[19-02-07 23:11:37.5115] Plugins::ShairTunes2W::Plugin::publishPlayer (479) **dns-sd not in path**
[19-02-07 23:11:37.5458] Plugins::ShairTunes2W::Plugin::publishPlayer (488) **mDNSPublish not in path**
[19-02-07 23:11:37.5461] Plugins::ShairTunes2W::Plugin::publishPlayer (490) using built-in helper: D:\Share\Tools\SQUEEZ~1\server\Plugins\SHAIRT~1\Bin\SHAIRP~1.EXE
[19-02-07 23:11:37.5684] Plugins::ShairTunes2W::Plugin::addPlayer (378) create client Slim::Player::SqueezePlay=ARRAY(0xb1c47cc) with proc Proc::Background=HASH(0xb1cfd04)

I use the uPnP bridge too so I can stream to Squeezelite players from upnp sources/controllers and that works fine.

I upgraded the Squeezelite to 1.9 (before was 1.5) but that did not help. Also in plugin settings page, I can change the settings, but they are not saved, I had to manually set the "Show all devices" to 1.

However, using the other project AirConnect I can play from iTunes on Mac to Squeezelite on Win.

The path is iTunes -> AirConnect > Upnp2LMS bridge > LMS > Squeezelite ... and I do not get any metadata...at least the sound is OK.

philippe44 commented 5 years ago

The build-in mDNS server is started, as no other is found so that's fine. There was a minor issue when clicking "Allow all Squeezelite-based Players" but that's nothing. Parameters are stored as soon as you click "Apply" For the rest, that's the hell of a data path. I don't understand what you're trying to do. The UPnPBridge is not to stream from UPnP sources/controllers, but to UPnP players (from LMS) If you want to AirPlay to the machine running squeezelite, you might want to use a native AirPlay client like shairport and not use squeezelite. AirConnect does not allow you to send metadata, unless you re-encode in mp3. That would be better if you explain what you want to achieve

8666 commented 5 years ago

I have few PCs/PIs with Squeezelite and I play music to them from a central headless server with LMS (using the web interface).

My mistake, but I have "Upnp/DLNA Media Interface V1 from Andy Grundman" too, probably that is presenting the Squeezelites as uPnP renderers too.

Now I have one Mac and want to send music from iTunes to Squeezelites too. I do not want extra software on the end-points. Seems like ShairTunes2W for LMS will do the job (publish the Squuezelites as Airplay devices)..but I do not see them. Are there any troubleshooting steps? I do not see ant extra ports opened like with AirConnect.

With your AirConnect, all works fine, just it is not part of the LMS...might be even better that way.

The path is unusual as I used a different location to install it (or maybe just moved it later and edited the registry entry for the service path, no issues with that).

philippe44 commented 5 years ago

I understand now. Shairtunes should definitively enable squeezelite devices if you’ve checked them in the plugin settings, and they should be seen by iTunes

8666 commented 5 years ago

OK, but is is not working. It is on Windows 7 without a firewall (Off). Looking at the code....lines with "not in path" mean that nothing is executed. Is there a way to start the helper manually? What is the syntax for the parameters. I do not see the helper in the Task Manager

philippe44 commented 5 years ago

Look at the last line of you log [19-02-07 23:11:37.5461] Plugins::ShairTunes2W::Plugin::publishPlayer (490) using built-in helper: D:\Share\Tools\SQUEEZ~1\server\Plugins\SHAIRT~1\Bin\SHAIRP~1.EXE [19-02-07 23:11:37.5684] Plugins::ShairTunes2W::Plugin::addPlayer (378) create client Slim::Player::SqueezePlay=ARRAY(0xb1c47cc) with proc Proc::Background=HASH(0xb1cfd04) This means that the mDNS helper that is being used is the built-one that I've made. I'm trying to use well-known mDNS solutions first, but fall back if none is found. So a mDNS server is executed for sure. Could it be that you have another application that grabs the 5353 port and refuses to share it? Could it that you have multiple NIC on this machine and LMS is not on a different one? I've had a few issues where LMS was started and bound to the wrong NIC You can also use my mDNS query https://github.com/philippe44/mDNS-SD to know what it sees on that Windows machine. The query is phrase must be _raop._tcp.local (see commadn line for other options)

8666 commented 5 years ago

It is a single NIC VM. LMS is properly bound. Running the mdsn tool with -d -t 100 gives enough data to see what is going on... the LMS plugin is not sending anything, nor 5353 is used by it.

When I start Airconnect (but the LMS plugin is disabled) I see it as UDP listener and mdns i giving data for the squeezelite player, iTunes find it.

What I found in the LMS log is this...probably not a deal breaker

[19-02-10 22:10:28.0257] Slim::Control::Request::notify (2060) Error: Failed notify: Wide character in subroutine entry at D:/Share/Tools/SQUEEZ~1/server/Plugins/ShairTunes2W/Plugin.pm line 449. Will I get any more features if I use ShairTunes2W instead of AirConnect as standalone tool? AirConnect does the job.

8666 commented 5 years ago

I must add that the Squeezelite player name is in Cyrillic with . and space char in the name. No problem for AirConnect.

philippe44 commented 5 years ago

Well ... you should have started with that b/c this is the issue. The id used to broadcast the airplay clone is based on a hash of the name and this obviously fails when using UTF8 chars.

AirConnect is transforming UPnP/CC devices into AirPlay targets while ShairTunes is transforming LMS devices into AirPlay targets, so that's pretty different.

Shairtunes2W will give you possibility to send from AirPlay and synchronize with other LMS players. What you do will be visible from any LMS controller.

AirConnect obviously does not give you that, it knows nothing about LMS. AirConnect does not give you synchronization between players, except if you have made Chromecast or Sonos groups.

8666 commented 5 years ago

So it is just a limitation of the plugin (utf8 support)? As AirConnect present the player properly with Cyrillic letters.

philippe44 commented 5 years ago

I've added the correction in Shairtunes2 to support utf8 encoded player's name. Works with Chinese characters, so hopefully it works for you as well. Please use dev repostiory for version 0.105.2

philippe44 commented 5 years ago

Would you mind closing the issue?

8666 commented 5 years ago

Give me a few days to test it. mDNS-SD gives good result / No wide chars errors in logs.

8666 commented 5 years ago

OK, I see it in iTunes with Cyrillic name as speaker but fails to play. There is wide char error again but on a different line

[19-02-18 22:03:44.8074] Slim::Networking::IO::Select::__ANON__ (131) Error: Select task failed calling Plugins::ShairTunes2W::Plugin::handleSocketRead: Wide character in subroutine entry at C:\ProgramData\Squeezebox\Cache\InstalledPlugins/Plugins/ShairTunes2W/Plugin.pm line 779.

philippe44 commented 5 years ago

Hopefully 105.3 solves that

8666 commented 5 years ago

Nice, even album art and song info is displayed in LMS now.