Author Topic: UPnP 2025 - Continuation of the original UPnP/DLNA plugin  (Read 34832 times)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
LMS has issues....

Part of the flac problem is it lists that it supports audio/x-flac but doesn't like the file to have a .x-flac extension. In the ticket I created for Opus and Wav I did specify they should change it to .flac so hopefully they sort that issue out at the same time.

It advertises that it supports NextURI and I can set it successfully but it doesn't transition to the next song automatically. In fact it never transitions to the next song even if I disable NextURI. I can get it to play one song but then it just stops. It looks like it's not responding to playstate requests so the plugin can't tell where it's up to and when to send the next track. The LMS log is filled with requests but I'm not getting a response.

PCM just flat out does not work.

I've got a separate UPnP program I use to query devices on the network and that's having issues talking to it as well. I'll have to play around with it a bit more to see what's going on.

edit: Found the problem, Lyrion always returns a play state of "TRANSITIONING" no matter what it's play state actually is. I've created a ticket for this as well.

edit: I've also found the reason PCM don't work. Squeezeplay doesn't actually support PCM (L16). So it advertises that it supports PCM but doesn't. It doesn't advertise that is supports WAV even though it does.... I've added that to the ticket.
Last Edit: March 21, 2025, 06:08:36 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
So LMS...

The bad
LMS don't do a 32 bit version anymore. From the github page it sounds like something broke with the build process and they are not going to fix it.
Any changes made to fix any issues will require the user to update to the 64 bit version to take advantage of those changes.

The good
We discussed it a few months ago, the 64 bit version installs Perl to run it. I don't know if having Perl installed is a good thing but it means LMS server is stored on the computer as it's source code. So I can make direct changes to the source and see straight away if it will work.

Which I have done for Wav and Opus support. Opus works and profiles that are set to transcode to 16/24 PCM now get sent as Wav which works correctly.

I've created a pull request on their github page for these changes and to fix x-flac/flac. I can't figure out what's going on with the playstate issue though so hopefully someone else can sort that one out.

I'll update the thread once those issues have been sorted. As stated above, you will need to upgrade to the latest 64 bit version. There is nothing I can do to get the older versions to work.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
Brilliant! Thanks for the additional effort on this, much appreciated.
Updating to a 9.xx version won't be that terrible.
I think there is a way to make it use the traditional interface instead of the Material skin.
And I am guessing/hoping any Windows issues will also be ironed out by then.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Brilliant! Thanks for the additional effort on this, much appreciated.

I don't know how it will go, it seems the LMS UPnP plugin code was never really finished and it's been in that state for a long time.... see what happens.

Can you confirm what happens when you queue up multiple tracks and hit play with your device.

With the SqueezePlay software player I can't get it to transition to another track. Does it work for you? Eg) what happens when the first track finishes playing, does it switch to the next track automatically?

If it doesn't work can you also do the same test with NextURI disabled. You may need to restart musicbee for that setting to apply properly.

While the LMS plugin accepts NextURI commands I don't think it actually does anything with that information from what I can tell. I could be wrong....

I have a theory the reason it gets stuck in a "TRANSITIONING" state is the LMS plugin is supposed to subscribe to player events but that isn't working for the SqueezePlayer. I'm hoping it works for your Squeezebox.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10265
Updating to a 9.xx version won't be that terrible.
I think there is a way to make it use the traditional interface instead of the Material skin.
While I haven't updated to LMS 9.x yet, I'm pretty sure it's using what they call the "Material Skin." Which I am using. It takes some time to learn where things are and I will often go back to the original (default) skin. Somewhere in this thread you (hiccup) stated that you found the new skin hard to navigate and I showed you how to continue to use the default skin. To save you the time of searching for it...
- Open the default skin. It should look like this:

- Click on "Settings" in the lower-right.
- You're now at the default skin settings.

- Be sure to click "Apply" in the lower-right to save any changes you made

-For those watching at home, the "new" material skin looks like this...

- It just took me a few minutes to find out how to reach the settings page <sigh>
- Click on the icon at the upper-left (hamburger menu with green plus sign)
- That opens a drop-down with settings for the interface, the player, and the server

- This is the server settings landing screen. There's a drop-down at the upper-right to reach what in the default skin are the other tabs

- This shows what had been the tabs in the default skin


Let me know how the upgrade to LMS 9.x goes.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

MoboMini

  • Newbie
  • *
  • Posts: 4
Thanks. Do I also need a client, like bubbleupnp, or can I now stream direct from MusicBee app to my Wiim streamer?

Make sure you're on at least MusicBee v3.6.9189 as described in this post: https://getmusicbee.com/forum/index.php?topic=42468.msg233305#msg233305

I've tested playback with FLAC to WiiM and it's pretty stable, although a little fragile with seeking/skipping (still to give feedback on that).
You don't need to make any profile changes unless you want to see higher resolution artwork in the WiiM Home app, but try the basics first.

EDIT: If you have any high resolution audio you will need to create a profile for the WiiM:
name: WiiM Pro
applies when the user-agent contains: Lavf/58.45.100 (Yours may be different)
maximum picture size: 600 (only relevant if you have an Ultra)
output sample rate: 44100 to 192000
maxium bit depth: 24

Thanks.

How do I point musicbee to wiim streamer? Sorry , I'm pretty new to this.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
How do I point musicbee to wiim streamer? Sorry , I'm pretty new to this.
It should be visible and selectable through: Preferences > Player > Output:

hiccup

  • Hero Member
  • *****
  • Posts: 9107
Let me know how the upgrade to LMS 9.x goes.
I wont be updating to 9.x unless they release an updated version that has the improvements suggested by BoringName regarding its UPnP functionality.
When that happens, I'm sure you will read about it in this thread ;-)

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10265
I wont be updating to 9.x unless they release an updated version that has the improvements suggested by BoringName regarding its UPnP functionality.
When that happens, I'm sure you will read about it in this thread ;-)
I'll be watching.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

MoboMini

  • Newbie
  • *
  • Posts: 4
How do I point musicbee to wiim streamer? Sorry , I'm pretty new to this.
It should be visible and selectable through: Preferences > Player > Output:

Yes, that worked! Thanks very much for your help.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
Can you confirm what happens when you queue up multiple tracks and hit play with your device.
With the SqueezePlay software player I can't get it to transition to another track. Does it work for you? Eg) what happens when the first track finishes playing, does it switch to the next track automatically?
If it doesn't work can you also do the same test with NextURI disabled. You may need to restart musicbee for that setting to apply properly.
You are right.
All sorts of funny stuff going on when lining up multiple tracks.

Playing to my Squeezebox Classic device:

Test #1

First track plays fine.
Then it progresses to track #2, but there is no sound.

After that, it won't progress to track #3, and MusicBee's progressbar is losing all its marbles:


for those who wonder: 'massage' is spelled correctly here


logfile:
Code
22668; 10 Play - Input - K:\_MusicBee test library\UPnP test\short album\1-12 - Raspberry.mp3 Output - (http://192.168.2.1:49382/files/E67D39556002AB39p.mpeg)
22684; 11 Profile - LMS (Lyrion/Logitech Media Server), useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
22692; 12 GetFile[1] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\short album\1-12 - Raspberry.mp3 to 192.168.2.120
22692; 13 GetFile - range=bytes 0-1152865/1152866
22693; 14 Profile - LMS (Lyrion/Logitech Media Server), useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
22786; 15 StateTimer - Loading,old=Stopped
23249; 16 GetFile[1] - exit=0, playtime=555
23441; 17 SetNextAVTransportURI - Success - http://192.168.2.1:49382/files/64A255F26911481Ep.mpeg:K:\_MusicBee test library\UPnP test\short album\1-26 - Massage From the Swedish Prime Minister, Part 2.mp3


Test #2 with 'Disable NextURI' checked':

Track #1 plays fine, but after that it won't progress to track #2, and the progressbar again gets fuc*ed up identical to test #1.

logfile:
Code
0; 1 Initialise - 3/22/2025 18:08:59
32; 2 GetNetworkAddresses - 192.168.2.1,dns=True,name=Ethernet 2,speed=1000000000
32; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
32; 4 GetNetworkAddresses - http://192.168.2.1:49382
52; 5 ProcessMessage 192.168.2.111 - device 'uuid:6e52c5d4-d3c1-1894-0080-0005cdf71792:Marantz NR1509',valid=True
998; 6 ProcessMessage 192.168.2.1 - device 'uuid:3B9596A5-0FAC-3FD9-F599-8A25E8F10962:Squeezebox Classic',valid=True
1002; 7 Profile - LMS (Lyrion/Logitech Media Server), useragent=|Logitech Media Server (8.5.2 - 1716215514)
1003; 8 Profile - LMS (Lyrion/Logitech Media Server), useragent=|Logitech Media Server (8.5.2 - 1716215514)
1019; 9 Activate - Squeezebox Classic:http-get:*:audio/mpeg:*,http-get:*:audio/L16;rate=8000;channels=1:*,http-get:*:audio/L16;rate=8000;channels=2:*,http-get:*:audio/L16;rate=11025;channels=1:*,http-get:*:audio/L16;rate=11025;channels=2:*,http-get:*:audio/L16;rate=12000;channels=1:*,http-get:*:audio/L16;rate=12000;channels=2:*,http-get:*:audio/L16;rate=16000;channels=1:*,http-get:*:audio/L16;rate=16000;channels=2:*,http-get:*:audio/L16;rate=22050;channels=1:*,http-get:*:audio/L16;rate=22050;channels=2:*,http-get:*:audio/L16;rate=24000;channels=1:*,http-get:*:audio/L16;rate=24000;channels=2:*,http-get:*:audio/L16;rate=32000;channels=1:*,http-get:*:audio/L16;rate=32000;channels=2:*,http-get:*:audio/L16;rate=44100;channels=1:*,http-get:*:audio/L16;rate=44100;channels=2:*,http-get:*:audio/L16;rate=48000;channels=1:*,http-get:*:audio/L16;rate=48000;channels=2:*,http-get:*:audio/vnd.dlna.adts:*,http-get:*:audio/vnd.dlna.adts:*,http-get:*:audio/mp4:*,http-get:*:audio/mp4:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/x-ms-wma:*,http-get:*:application/ogg:*,http-get:*:audio/x-flac:*
0; 1 Initialise - 3/22/2025 18:09:19
33; 2 GetNetworkAddresses - 192.168.2.1,dns=True,name=Ethernet 2,speed=1000000000
33; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
33; 4 GetNetworkAddresses - http://192.168.2.1:49382
54; 5 ProcessMessage 192.168.2.111 - device 'uuid:6e52c5d4-d3c1-1894-0080-0005cdf71792:Marantz NR1509',valid=True
250; 6 ProcessMessage 192.168.2.1 - device 'uuid:3B9596A5-0FAC-3FD9-F599-8A25E8F10962:Squeezebox Classic',valid=True
253; 7 Profile - LMS (Lyrion/Logitech Media Server), useragent=|Logitech Media Server (8.5.2 - 1716215514)
253; 8 Profile - LMS (Lyrion/Logitech Media Server), useragent=|Logitech Media Server (8.5.2 - 1716215514)
269; 9 Activate - Squeezebox Classic:http-get:*:audio/mpeg:*,http-get:*:audio/L16;rate=8000;channels=1:*,http-get:*:audio/L16;rate=8000;channels=2:*,http-get:*:audio/L16;rate=11025;channels=1:*,http-get:*:audio/L16;rate=11025;channels=2:*,http-get:*:audio/L16;rate=12000;channels=1:*,http-get:*:audio/L16;rate=12000;channels=2:*,http-get:*:audio/L16;rate=16000;channels=1:*,http-get:*:audio/L16;rate=16000;channels=2:*,http-get:*:audio/L16;rate=22050;channels=1:*,http-get:*:audio/L16;rate=22050;channels=2:*,http-get:*:audio/L16;rate=24000;channels=1:*,http-get:*:audio/L16;rate=24000;channels=2:*,http-get:*:audio/L16;rate=32000;channels=1:*,http-get:*:audio/L16;rate=32000;channels=2:*,http-get:*:audio/L16;rate=44100;channels=1:*,http-get:*:audio/L16;rate=44100;channels=2:*,http-get:*:audio/L16;rate=48000;channels=1:*,http-get:*:audio/L16;rate=48000;channels=2:*,http-get:*:audio/vnd.dlna.adts:*,http-get:*:audio/vnd.dlna.adts:*,http-get:*:audio/mp4:*,http-get:*:audio/mp4:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/x-ms-wma:*,http-get:*:application/ogg:*,http-get:*:audio/x-flac:*
8843; 10 Play - Input - K:\_MusicBee test library\UPnP test\short album\1-12 - Raspberry.mp3 Output - (http://192.168.2.1:49382/files/E67D39556002AB39p.mpeg)
8860; 11 Profile - LMS (Lyrion/Logitech Media Server), useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
8868; 12 GetFile[1] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\short album\1-12 - Raspberry.mp3 to 192.168.2.120
8868; 13 GetFile - range=bytes 0-1152865/1152866
8868; 14 Profile - LMS (Lyrion/Logitech Media Server), useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
9432; 15 GetFile[1] - exit=0, playtime=562
Last Edit: March 22, 2025, 09:52:39 PM by hiccup

simbun

  • Jr. Member
  • **
  • Posts: 39
Part of the flac problem is it lists that it supports audio/x-flac but doesn't like the file to have a .x-flac extension. In the ticket I created for Opus and Wav I did specify they should change it to .flac so hopefully they sort that issue out at the same time.
I know we've touched on this before but I think you'd be better off just changing the extension of the served file to .flac; the 'x-' in audio/x-flac simply indicates that it's not an official mime type it has nothing to do with the file extension.

Can you confirm what happens when you queue up multiple tracks and hit play with your device.

With the SqueezePlay software player I can't get it to transition to another track. Does it work for you? Eg) what happens when the first track finishes playing, does it switch to the next track automatically?
I have a little experience with LMS and the legacy DLNA/UPnP Media Interface, and the only way it worked reliably with BubbleUPnP was if I enabled eventing. As you've noted already this plugin was abandoned over a decade ago, so I'd be surprised to see any further development/fixes.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
First track plays fine.
Then it progresses to track #2, but there is no sound.

Does the LMS interface switch to the second track? I'm guessing not.

It's the same issue I get with the SqueezePlayer. I know the cause of the issues but fixing it might be tricky.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I know we've touched on this before but I think you'd be better off just changing the extension of the served file to .flac; the 'x-' in audio/x-flac simply indicates that it's not an official mime type it has nothing to do with the file extension.

It's because the plugin extracts the extension from the mimetype value. There is a lot of code that goes into it comparing advertised mimetypes with supported types. That applies to all codecs so it's not something I want to mess around with at the moment in case it breaks other devices/formats. I also don't want to be adding bits of code to alter things just for one codec. End of the day, the issue is the device not the plugin. The pull request I made for LMS changes it's advertised format to audio/flac which will solve the problem.

I have a little experience with LMS and the legacy DLNA/UPnP Media Interface, and the only way it worked reliably with BubbleUPnP was if I enabled eventing. As you've noted already this plugin was abandoned over a decade ago, so I'd be surprised to see any further development/fixes.

That's interesting and confirms my suspicions on what is causing the issues. I hope you mean eventing in LMS as that's something I can work with. I'll have a dig through the settings. At any rate, if it's a BubbleUPnP setting it will still help me troubleshoot if I can get the two working together properly.

Well it's had one development/fix in the last 10 years, the pull request I made yesterday is technically an update to the DLNA/UPnP Media Interface code.

edit: Bugger, it seems to be a setting for BubbleUPnP.
So I either have to enable event support for this plugin or alter the LMS plugin to update the play state when eventing isn't supported. Actually both is probably required to have everything work as it should.... it's going to be a while before either is done.

edit2: Just confirming that eventing is the issue. With eventing enabled for the squeezePlayer in BubbleUPnP it transitions to the next track successfully. Also confirming that LMS does not support NextURI. The code is there but it doesn't queue it on the playlist.
Last Edit: March 23, 2025, 12:53:16 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
it's going to be a while before either is done.

I lied.... I've configured the LMS plugin so it updates the play state without requiring an event subscription. Track transitions are a little slow, especially the first one but it's working.

I've got NextURI working as well but there is a weird issue I'm having problems sorting out. When I set the NextURI, a toast message pops up on the SqueezePlayer UI stating the NextURI track is being added to the playlist. The information in this toast popup is correct. But when I look at the playlist it's showing 2 identical tracks. The NextURI has been added with the same track title as the first track. If I check the track info on these 2 tracks, they show the correct info for each track so it's just the title in the playlist that is wrong. The weird part is if I restart LMS, when it loads back up the playlist titles are what they should be.

The incorrect title persists through track transitions, so while it's playing the correct song with the correct duration, the cover displayed and title are wrong. If I let it play a few tracks, every time it adds a new NextURI, they are all added with the track title of the first track played. For whatever reason the title isn't getting refreshed when I add a new track to the playlist....

So I just need to figure that out and put in a few checks on the current playlist state and it should be good to go.