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

Moodymann

  • Jr. Member
  • **
  • Posts: 29
Now it works with some failures (for example, the next track in the MB list plays on the upnp device, but does not go to the next one in the MB shell)

Did you upgrade to the latest version of musicbee? There is an issue with some layout configurations that I should be able to fix in the next version.

You should uncheck the "enable remote control of musicbee" option as you won't need that.

What device are you sending it to? If you want the "continuous stream" option to work you probably need to untick the "force little endian" option.

From what you have said I don't think you should use the continuous stream option anyway.

Yes, I have a new version of MB. And I see that the plugin has started working better by small signs. My renderer is a phone based on Android + BubbleUPnP 4.4.8.
But continuous stream with these settings https://imgur.com/yRxgDLF does not work.

I'm still testing, but I noticed that when the "output as a continuous stream" function is disabled, the track being played is displayed in MB and in BubbleUPnp, but the title does not change with the next track. In MB, only the first track from the playlist plays. Then the playback progress freezes.


Code
1272148; 270 GetEncodedFile[31] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1272165; 271 GetEncodedFile[31] - exit=10054, playtime=17
1272349; 272 StateTimer - Loading,old=Stopped
1272465; 273 Profile - Generic Device, useragent=Lavf/61.9.101
1272465; 274 Profile - Generic Device, useragent=Lavf/61.9.101
1272465; 275 GetEncodedFile - Stream zero=/encode/continuousstream-2147483578.l16
1272465; 276 httpresponse - Code 404
1272867; 278 StateTimer - Stopped,old=Loading
1272867; 279 SyncNewPlayState - Stopped,mb=Playing
1274114; 280 Profile - BubbleUPnP, useragent=BubbleUPnP/4.4.8 okhttp/4.12.0
1277121; 281 Play - stream (http://192.168.1.103:49382/encode/continuousstream-2147483566.L16)
1277737; 282 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1277737; 283 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1277737; 284 GetEncodedFile[32] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1277757; 285 GetEncodedFile[32] - exit=10054, playtime=20
1277969; 286 StateTimer - Loading,old=Stopped
1278077; 287 Profile - Generic Device, useragent=Lavf/61.9.101
1278077; 288 Profile - Generic Device, useragent=Lavf/61.9.101
1278078; 289 GetEncodedFile - Stream zero=/encode/continuousstream-2147483566.l16
1278078; 290 httpresponse - Code 404
1278486; 292 StateTimer - Stopped,old=Loading
1278486; 293 SyncNewPlayState - Stopped,mb=Playing
1323653; 294 Profile - BubbleUPnP, useragent=Android/13 UPnP/1.0 BubbleUPnP/4.4.8
1324165; 295 Profile - BubbleUPnP, useragent=Android/13 UPnP/1.0 BubbleUPnP/4.4.8
1324560; 296 Play - stream (http://192.168.1.103:49382/encode/continuousstream-2147483554.L16)
1325209; 297 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1325210; 298 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1325210; 299 GetEncodedFile[33] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1325229; 300 GetEncodedFile[33] - exit=10054, playtime=19
1325406; 301 StateTimer - Loading,old=Stopped
1325530; 302 Profile - Generic Device, useragent=Lavf/61.9.101
1325531; 303 Profile - Generic Device, useragent=Lavf/61.9.101
1325531; 304 GetEncodedFile - Stream zero=/encode/continuousstream-2147483554.l16
1325531; 305 httpresponse - Code 404
1325927; 307 StateTimer - Stopped,old=Loading
1325928; 308 SyncNewPlayState - Stopped,mb=Playing
1406846; 309 Play - stream (http://192.168.1.103:49382/encode/continuousstream-2147483538.L16)
1407487; 310 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1407487; 311 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1407488; 312 GetEncodedFile[34] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1407505; 313 GetEncodedFile[34] - exit=10054, playtime=17
1407714; 314 StateTimer - Loading,old=Stopped
1408104; 315 Profile - Generic Device, useragent=Lavf/61.9.101
1408104; 316 Profile - Generic Device, useragent=Lavf/61.9.101
1408104; 317 GetEncodedFile - Stream zero=/encode/continuousstream-2147483538.l16
1408104; 318 httpresponse - Code 404
1408213; 320 StateTimer - Stopped,old=Loading
1408214; 321 SyncNewPlayState - Stopped,mb=Playing
1411360; 322 Play - stream (http://192.168.1.103:49382/encode/continuousstream-2147483523.L16)
1412008; 323 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1412008; 324 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1412009; 325 GetEncodedFile[35] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1412026; 326 GetEncodedFile[35] - exit=10054, playtime=17
1412230; 327 StateTimer - Loading,old=Stopped
1412688; 328 Profile - Generic Device, useragent=Lavf/61.9.101
1412689; 329 Profile - Generic Device, useragent=Lavf/61.9.101
1412689; 330 GetEncodedFile - Stream zero=/encode/continuousstream-2147483523.l16
1412689; 331 httpresponse - Code 404
1413250; 333 StateTimer - Stopped,old=Loading
1413250; 334 SyncNewPlayState - Stopped,mb=Playing
1577083; 335 Play - stream (http://192.168.1.103:49382/encode/continuousstream-2147483510.L16)
1577733; 336 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1577733; 337 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1577733; 338 GetEncodedFile[36] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1577751; 339 GetEncodedFile[36] - exit=10054, playtime=17
1577957; 340 StateTimer - Loading,old=Stopped
1578393; 341 Profile - Generic Device, useragent=Lavf/61.9.101
1578393; 342 Profile - Generic Device, useragent=Lavf/61.9.101
1578393; 343 GetEncodedFile - Stream zero=/encode/continuousstream-2147483510.l16
1578393; 344 httpresponse - Code 404
1578964; 346 StateTimer - Stopped,old=Loading
1578964; 347 SyncNewPlayState - Stopped,mb=Playing
1583220; 348 Play - stream (http://192.168.1.103:49382/encode/continuousstream-2147483495.L16)
1583858; 349 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1583859; 350 Profile - BubbleUPnP, useragent=BubbleUPnP UPnP/1.1
1583859; 351 GetEncodedFile[37] 192.168.1.103 - GET  to 192.168.1.101; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
1583876; 352 GetEncodedFile[37] - exit=10054, playtime=17
1584063; 353 StateTimer - Loading,old=Stopped
1584501; 354 Profile - Generic Device, useragent=Lavf/61.9.101
1584501; 355 Profile - Generic Device, useragent=Lavf/61.9.101
1584501; 356 GetEncodedFile - Stream zero=/encode/continuousstream-2147483495.l16
1584501; 357 httpresponse - Code 404
1585111; 359 StateTimer - Stopped,old=Loading
1585112; 360 SyncNewPlayState - Stopped,mb=Playing
Last Edit: March 10, 2025, 02:47:23 PM by Moodymann

BoringName

  • Sr. Member
  • ****
  • Posts: 916
But continuous stream with these settings https://imgur.com/yRxgDLF does not work.
You need to untick force native stream if you have continuous stream ticked. But based on what you wanted to do in your original post I'm sure you don't want to use continuous stream.

I'm still testing, but I noticed that when the "output as a continuous stream" function is disabled, the track being played is displayed in MB and in BubbleUPnp, but the title does not change with the next track. In MB, only the first track from the playlist plays. Then the playback progress freezes.

In bubbleUPnP
- go to the now playing tab.
- Tap the square icon on the top right next to the 3 dots menu
- A select renderer tab will pop up at the bottom, click the 3 dots menu button on the renderer you are using (probably the local renderer) and select settings
- Enable Gapless Playback.

Moodymann

  • Jr. Member
  • **
  • Posts: 29
But continuous stream with these settings https://imgur.com/yRxgDLF does not work.
You need to untick force native stream if you have continuous stream ticked. But based on what you wanted to do in your original post I'm sure you don't want to use continuous stream.

I'm still testing, but I noticed that when the "output as a continuous stream" function is disabled, the track being played is displayed in MB and in BubbleUPnp, but the title does not change with the next track. In MB, only the first track from the playlist plays. Then the playback progress freezes.

In bubbleUPnP
- go to the now playing tab.
- Tap the square icon on the top right next to the 3 dots menu
- A select renderer tab will pop up at the bottom, click the 3 dots menu button on the renderer you are using (probably the local renderer) and select settings
- Enable Gapless Playback.

With these settings https://imgur.com/6phXusa tracks do not start. I like how the "Playback Stream Capture" function worked in Foobar...
But nevertheless, thank you for your plugin, it works much better than its predecessor.
I would like to see a manual on the settings and scenarios for the plugin in the future.

BoringName

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

With these settings https://imgur.com/6phXusa tracks do not start. I like how the "Playback Stream Capture" function worked in Foobar...
But nevertheless, thank you for your plugin, it works much better than its predecessor.
I would like to see a manual on the settings and scenarios for the plugin in the future.

It could be the maximum picture size you have set. By default it's 160 but I haven't tested larger sizes so I don't know how large you can go with BubbleUPnP. Or you might need to set the content length to default instead of fixed.

You should probably change the user agent field to BubbleUPnP|stagefright (note the pipe symbol | between the 2 words)

Again, even if it did work, continuous stream will not give you the functionality you initially listed that you wanted.

At some point I do plan to put a user guide on the Musicbee wiki.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New version - mb_Upnp2025_1.8

Changes
- minimum version required 3.6.92013.6.9201
- NextURI should now behave properly when altering the playing tracks list.
- SetNextAVTransport entries in the log now show the original URL so it's more clear which track has been set.
- Improved logging of Metadata errors.
- 5.1 encoded flac streams will no longer be downmixed to stereo unless "stereo only" is checked.
- improved playback syncing. It's not perfect and never will be but it's better than what it was. You may see a small fluctuation in the progress bar around the 1 second mark.

Even though Foobar can play a native 5.1 flac stream, it errors if you send it an encoded 5.1 flac stream. BubbleUPnP has no issue with the same stream. The foobar upnp log is insanely verbose and contains absolutely zero information about errors. I've created a post on Hydrogenaud.io

The solution for improving the playback sync increases network traffic for a small period when play first starts and during a track transition. I haven't gone too overboard so hopefully it doesn't cause any problems, particularly with older devices.

If RRoyce could attempt to play a native flac stream again and link the log that should help me sort that problem out.

Just a reminder, once you have finished any troubleshooting, don't forget to untick the debug log option.

RRoyce

  • Newbie
  • *
  • Posts: 9
Re. Marantz PM7000n. Updated plugin to 1.8 and latest 3.6 patch.

This is the log with no options checked. Hear white noise.

Code
1; 1 Initialise - 12/03/2025 06:13:09
11; 2 GetNetworkAddresses - 192.168.0.11,dns=True,name=Ethernet,speed=1000000000
11; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
11; 4 GetNetworkAddresses - http://192.168.0.11:49382
39; 5 ProcessMessage 192.168.0.13 - device 'uuid:a528d32c-1f50-1e51-0080-000678ad6d92:Marantz PM7000N',valid=True
73093; 6 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
73094; 7 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
73122; 8 Activate - Marantz PM7000N:
86242; 9 Play - Input - G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac Output - (http://192.168.0.11:49382/encode/2B05989D52F42F8F-2147483643.L16)
86481; 10 Profile - Generic Device, useragent=AvegaMediaServer/2.0 Linux/2.6
86481; 11 Profile - Generic Device, useragent=AvegaMediaServer/2.0 Linux/2.6
86522; 12 StateTimer - Loading,old=Stopped
86575; 13 GetEncodedFile[1] 192.168.0.11 - GET G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac to 192.168.0.13; mime=audio/L16;rate=48000;channels=2,rate=48000,channels=2
86792; 14 StateTimer - Playing,old=Loading
86976; 15 SetNextAVTransportURI - Cleared
106255; 16 GetEncodedFile[1] - exit=10054, playtime=19678

This the log with "force native stream" checked. Hear nothing and track does not advance, though no pop-up window anymore.

[code0; 1 Initialise - 12/03/2025 06:17:01
10; 2 GetNetworkAddresses - 192.168.0.11,dns=True,name=Ethernet,speed=1000000000
10; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
10; 4 GetNetworkAddresses - http://192.168.0.11:49382
31; 5 ProcessMessage 192.168.0.13 - device 'uuid:a528d32c-1f50-1e51-0080-000678ad6d92:Marantz PM7000N',valid=True
34; 6 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
35; 7 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
65; 8 Activate - Marantz PM7000N:
11164; 9 DIDL Error - startIndex cannot be larger than length of string.
Parameter name: startIndex
11164; 10 Play - Input - G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac Output - ()][/code]

Don't know if it's helpful, but this is the log with "Little endian" checked, when it does play.

[code0; 1 Initialise - 12/03/2025 06:20:13
10; 2 GetNetworkAddresses - 192.168.0.11,dns=True,name=Ethernet,speed=1000000000
10; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
10; 4 GetNetworkAddresses - http://192.168.0.11:49382
30; 5 ProcessMessage 192.168.0.13 - device 'uuid:a528d32c-1f50-1e51-0080-000678ad6d92:Marantz PM7000N',valid=True
33; 6 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
33; 7 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
60; 8 Activate - Marantz PM7000N:
4955; 9 Play - Input - G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac Output - (http://192.168.0.11:49382/encode/2B05989D52F42F8F-2147483643.L16)
5180; 10 Profile - Generic Device, useragent=AvegaMediaServer/2.0 Linux/2.6
5180; 11 Profile - Generic Device, useragent=AvegaMediaServer/2.0 Linux/2.6
5226; 12 StateTimer - Loading,old=Stopped
5273; 13 GetEncodedFile[1] 192.168.0.11 - GET G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac to 192.168.0.13; mime=audio/L16;rate=48000;channels=2,rate=48000,channels=2
6499; 14 StateTimer - Playing,old=Loading
6742; 15 SetNextAVTransportURI - Cleared
29428; 16 GetEncodedFile[1] - exit=10054, playtime=24154
][/code]

BoringName

  • Sr. Member
  • ****
  • Posts: 916
11164; 9 DIDL Error - startIndex cannot be larger than length of string.
Parameter name: startIndex

I wasn't expecting that to produce the same error as last time. I thought the DIDL failing was causing that error somewhere else in the plugin and the DIDL error would be different....

Anyway it gives me something to look for. Thanks.

edit: Pretty sure I've found the issue. If I'm right it's most likely being triggered by the Marantz not advertising that it supports flac. Or possibly the way it advertises this information is not standard and the plugin can't read it.
Last Edit: March 12, 2025, 09:18:50 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New version - mb_Upnp2025_1.8.1

Changes
- Added a possible fix for devices that either don't advertise they support certain codecs or the plugin has issues reading that data.

RRoyce if you could do the native stream test again with a flac file. Fingers crossed this should get it working.

RRoyce

  • Newbie
  • *
  • Posts: 9
Merry Xmas! All working now (with "force native stream" enabled). Plays both flac and mp3 without problem. The Marantz display indicates it is receiving original format.

Code
0; 1 Initialise - 12/03/2025 08:38:26
10; 2 GetNetworkAddresses - 192.168.0.11,dns=True,name=Ethernet,speed=1000000000
10; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
10; 4 GetNetworkAddresses - http://192.168.0.11:49382
36; 5 ProcessMessage 192.168.0.13 - device 'uuid:a528d32c-1f50-1e51-0080-000678ad6d92:Marantz PM7000N',valid=True
38; 6 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
39; 7 Profile - Marantz PM7000N, useragent=|LINUX UPnP/1.0 Denon-Heos/fc67c7b91c9f70d6c175610bb51c54463b1e5afa
62; 8 Activate - Marantz PM7000N:
9175; 9 Play - Input - G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac Output - (http://192.168.0.11:49382/files/2B05989D52F42F8Fp.flac)
9414; 10 Profile - Generic Device, useragent=AvegaMediaServer/2.0 Linux/2.6
9455; 11 StateTimer - Loading,old=Stopped
9506; 12 GetFile[1] 192.168.0.11 - GET G:\StevieB\Music\Kokoroko\Could We Be More\03 Ewà Inú.flac to 192.168.0.13
9506; 13 Profile - Generic Device, useragent=AvegaMediaServer/2.0 Linux/2.6
9873; 14 StateTimer - Playing,old=Loading
10083; 15 SetNextAVTransportURI - Cleared
37920; 16 GetFile[1] - exit=10054, playtime=28413

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Merry Xmas! All working now (with "force native stream" enabled). Plays both flac and mp3 without problem. The Marantz display indicates it is receiving original format.

Sweet. I'll fix up the next version so it's more obvious in the log when that issue is occurring.

Happy days.

I just have to sort out Jean's issue (I think that's different to yours) and that's all the problem devices sorted for now.

Except Sonos devices,, I'm not going anywhere near that dumpster fire.


RRoyce

  • Newbie
  • *
  • Posts: 9

simbun

  • Jr. Member
  • **
  • Posts: 39
Except Sonos devices,, I'm not going anywhere near that dumpster fire.

I have a couple of old Play 1's and they're working well, as I've always found them to with UPnP control points. I've only tested with 16/44.1 material, but playing, skipping and seeking are working, be it with native streams or encoded (replygain/crossfade).

If I seek within a track when playing to a WiiM renderer, playback of the current track does resume but it doesn't transition to the next track. Would you like to see a log (I think you originally said you wouldn't address seeking issues)?

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I have a couple of old Play 1's and they're working well, as I've always found them to with UPnP control points. I've only tested with 16/44.1 material, but playing, skipping and seeking are working, be it with native streams or encoded (replygain/crossfade).

I think it's more of an issue with newer devices. They have moved away from the DLNA/UPnP standard and from what I've read don't seem overly interested in fixing any issues in that regard. Based on the notes in Lyrion Music Server's source code, the Sonos do some really stupid crap with seeking and even If I wanted to entertain that nonsense, I don't think the workaround LMS use would be possible for me to implement with how the plugin works.

If I seek within a track when playing to a WiiM renderer, playback of the current track does resume but it doesn't transition to the next track. Would you like to see a log (I think you originally said you wouldn't address seeking issues)?

Seeking wasn't a priority but I will check it out if you provide the log. It's the Sonos seeking issue I'm not going to bother trying to fix.

I haven't done as much testing as I probably should have with all the changes I've made lately so It's possible some of those changes caused issues with seeking.


jean.valjean

  • Jr. Member
  • **
  • Posts: 29
Hello,

version 1.8 idem RRoyce

Version 1.8.1

only “Force native stream”, and everything in 24 bits, for music everything works, sound and display (artist, title and format).

For radio, you still need “output as a continuous stream”.

Very good work, thank you

Moodymann

  • Jr. Member
  • **
  • Posts: 29
https://imgur.com/7Fd0mK4
Does anyone know this?
With what settings can crossfade work, or is it not possible. There are no such settings in BubbleUPnP