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

jean.valjean

  • Jr. Member
  • **
  • Posts: 29
Good evening,

I wrote too quickly.
When listening to a certain album, on Musicbee, only one song advances and on the Marantz two tracks start in a row and then the album stops.
On others, there's a one-track lag between Musicbee and the Marantz.
When the album is launched, Musicbee doubles the 1st track and everything shifts.

I enclose the log file

Code
 0; 1 Initialise - 12/03/2025 18:34:40
25; 2 GetNetworkAddresses - 192.168.1.11,dns=True,name=Ethernet,speed=1000000000
25; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
25; 4 GetNetworkAddresses - http://192.168.1.11:49382
41; 5 ProcessMessage 192.168.1.12 - device 'uuid:a0de4b19-c49c-10de-0080-0006787c2e26:Marantz ND8006',valid=True
44; 6 Profile - Marantz ND8006 | AvegaMedia, useragent=|LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
44; 7 Profile - Marantz ND8006 | AvegaMedia, useragent=|LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
98; 8 Activate - Marantz ND8006:
1343; 9 Profile - Generic Device, useragent=Unspecified, UPnP/1.0, SoftAtHome
1441; 10 Profile - Marantz ND8006 | AvegaMedia, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
8062; 11 Play - Input - E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\01 - Faire.flac Output - (http://192.168.1.11:49382/files/6012959B7E531B16p.flac)
8223; 12 Profile - Marantz ND8006 | AvegaMedia, useragent=AvegaMediaServer/2.0 Linux/2.6
8252; 13 StateTimer - Loading,old=Stopped
8319; 14 GetFile[1] 192.168.1.11 - GET E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\01 - Faire.flac to 192.168.1.12
8319; 15 Profile - Marantz ND8006 | AvegaMedia, useragent=AvegaMediaServer/2.0 Linux/2.6
9058; 16 StateTimer - Playing,old=Loading
9440; 17 SetNextAVTransportURI - Success - http://192.168.1.11:49382/files/3C81C1D7E1FC32DAp.flac:E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\02 - Mes indépendances et ma révolte.flac
225198; 18 GetFile[1] - exit=0, playtime=216877
226613; 19 Profile - Marantz ND8006 | AvegaMedia, useragent=AvegaMediaServer/2.0 Linux/2.6
226645; 20 GetFile[2] 192.168.1.11 - GET E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\02 - Mes indépendances et ma révolte.flac to 192.168.1.12
226645; 21 Profile - Marantz ND8006 | AvegaMedia, useragent=AvegaMediaServer/2.0 Linux/2.6
238005; 22 SetNextAVTransportURI - Success - http://192.168.1.11:49382/files/AD676C14909C6119p.flac:E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\03 - Un paradis pour moi.flac
467210; 23 GetFile[2] - exit=0, playtime=240565
468794; 24 Profile - Marantz ND8006 | AvegaMedia, useragent=AvegaMediaServer/2.0 Linux/2.6
468794; 25 GetFile[3] 192.168.1.11 - GET E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\03 - Un paradis pour moi.flac to 192.168.1.12
468810; 26 Profile - Marantz ND8006 | AvegaMedia, useragent=AvegaMediaServer/2.0 Linux/2.6
701299; 27 GetFile[3] - exit=0, playtime=232489
716045; 28 StateTimer - Stopped,old=Playing
716045; 29 SyncNewPlayState - Stopped,mb=Playing

  

BoringName

  • Sr. Member
  • ****
  • Posts: 916
For radio, you still need “output as a continuous stream”.

I haven't done any testing with radio streams but I expect as they are a continuous stream themselves, the plugin will always need to be set to continuous stream for them to work. I could change the plugin to always send them as continuous streams so it won't be necessary to change settings if you alternate between radio streams and normal tracks.

I enclose the log file

I'll probably need a screen shot of your now playing list before you click play to confirm what's happening there as the log looks relatively normal.

The log shows.
The following track is set to play - E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\01 - Faire.flac
While that is playing the following track is set to play next - E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\02 - Mes indépendances et ma révolte.flac
The first track plays for 3min 47 seconds and then switches to - E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\02 - Mes indépendances et ma révolte.flac
While the second track is playing the following track is set to play next - E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\03 - Un paradis pour moi.flac
The second track plays for 4 min and then switches to - E:\Musique\Chanson Française\Blondino\Blondino - Un paradis pour moi\03 - Un paradis pour moi.flac
This third track plays for 3 min 52 seconds and playback ends

The only thing that does seem odd is it doesn't seem to attempt to perform SetNextAVTransport while the third track is playing.

edit:
When the album is launched, Musicbee doubles the 1st track and everything shifts.

I know what can cause this but I thought I'd fixed it. I'll take another look.
Last Edit: March 12, 2025, 08:52:53 PM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
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

You need to use a continuous stream for crossfading to work. So you need to choose if you want crossfading or if you want native playback which you initially stated was a requirement, you can't have both.


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

You need to use a continuous stream for crossfading to work. So you need to choose if you want crossfading or if you want native playback which you initially stated was a requirement, you can't have both.


Yes, I initially needed a continuous stream. But I can't find the settings to make it work.
Do I need to add the plugin port to the win 7 firewall?
Last Edit: March 13, 2025, 01:48:35 PM by Moodymann

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Yes, I initially needed a continuous stream. But I can't find the settings to make it work.
Do I need to add the plugin port to the win 7 firewall?

BubbleUPnP usually plays pretty much everything so there is a good chance your issues are windows 7 related. Windows 10 did change some fundamental network functions because the company I worked for at the time had a big argument with a software vendor, we had just paid a pretty big license fee and windows 10 broke the network functionality of the software and they wanted to charge us another license for a windows 10 version. Anyway, point being whatever they changed could be why the plugin isn't working for you.

At the risk of sounding like a prick, rocking windows 7 at this point is pretty nuts unless you have a specific piece of software that won't work in windows 10. If you're worried about all the telemetry/spy stuff that can be turned off. I'd be extremely surprised if your PC didn't run better on Windows 10 vs Windows 7 not to mention the massive security risk. You probably cant upgrade for free anymore but windows 10 keys are less than $20.

Windows 10 is amazing on older hardware which you must be running if you still have windows 7. Hell, it's amazing on new hardware, it gives better gaming frame rates than windows 11.

Sorry but I don't think I have it in me to troubleshoot a windows 7 install. It's over 15 years old at this point.

Moodymann

  • Jr. Member
  • **
  • Posts: 29
Yes, I initially needed a continuous stream. But I can't find the settings to make it work.
Do I need to add the plugin port to the win 7 firewall?

BubbleUPnP usually plays pretty much everything so there is a good chance your issues are windows 7 related. Windows 10 did change some fundamental network functions because the company I worked for at the time had a big argument with a software vendor, we had just paid a pretty big license fee and windows 10 broke the network functionality of the software and they wanted to charge us another license for a windows 10 version. Anyway, point being whatever they changed could be why the plugin isn't working for you.

At the risk of sounding like a prick, rocking windows 7 at this point is pretty nuts unless you have a specific piece of software that won't work in windows 10. If you're worried about all the telemetry/spy stuff that can be turned off. I'd be extremely surprised if your PC didn't run better on Windows 10 vs Windows 7 not to mention the massive security risk. You probably cant upgrade for free anymore but windows 10 keys are less than $20.

Windows 10 is amazing on older hardware which you must be running if you still have windows 7. Hell, it's amazing on new hardware, it gives better gaming frame rates than windows 11.

Sorry but I don't think I have it in me to troubleshoot a windows 7 install. It's over 15 years old at this point.
Thanks anyway. There are other modes of operation of the plugin besides the stream. I am happy with it.

BoringName

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

Changes
- Better logging of mime type errors, specifically when it cannot be verified if a device supports a mime type.
- Improvements to track transition handling for gapless playback.

I have no way of knowing if a device has transitioned to a NextUri track other than checking timers. I was doing a secondary check of comparing what the device had stored as the currentURI and NextURI. If they matched it was assumed it had transitioned. The logic for this falls over if you queue the same track multiple times. I think it will also cause problems if the device is a bit slow transitioning as the plugin was waiting until they matched. If it waited too long Musicbee would automatically start playing the same track from the start.

It would be great if the NextURI was set to null once the device switched as that would be a very easy way to ascertain if the device had switched to the next track. I think that is actually what is supposed to happen but the AvTransport documentation is worded poorly and from the devices I've tested, none do this. When the device transitions, it copies the NextURI to the CurrentURI so they are the same value until another NextURI is set.

So I have removed the currentURI/NextURI comparison check as it was pretty much pointless. The plugin/Musicbee will now just transition to the next track once a track ends with the assumption being the device has switched as well. I believe it should work better than it did previously. If the device is slow switching it should sync the track progress bar once it gets there and if something goes wrong with the transition it will get picked up pretty quickly on a playstate check that occurs regularly.

Eventing is another way of getting notified when it's transitioned but I feel like trying to support that functionality will be a massive headache. Some of these devices don't even support basic UPnP functionality properly so the odds they did eventing correct is slim.

edit: No changes to radio streams automatically being set to continuous streams in this version, I'll look at that in the next version.

jean.valjean

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

version 1.8.2  idem version 1.8.1

the song hasn't started and this stops the rest of the list.

866449; 35 SetNextAVTransportURI - Success - http://192.168.1.11:49382/files/3557F57DA3E94307p.flac:E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\03. Je tiens d'elle.flac



Code
 1; 1 Initialise - 14/03/2025 18:10:00
23; 2 GetNetworkAddresses - 192.168.1.11,dns=True,name=Ethernet,speed=1000000000
23; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
23; 4 GetNetworkAddresses - http://192.168.1.11:49382
1339; 5 Profile - Generic Device, useragent=Unspecified, UPnP/1.0, SoftAtHome
95550; 6 ProcessMessage 192.168.1.12 - device 'uuid:a0de4b19-c49c-10de-0080-0006787c2e26:Marantz ND8006',valid=True
98004; 7 Profile - Marantz ND8006, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
601210; 8 Profile - Marantz ND8006, useragent=|LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
601210; 9 Profile - Marantz ND8006, useragent=|LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
601226; 10 Activate - Marantz ND8006:
612342; 11 Play - Input - stream Output - (http://192.168.1.11:49382/encode/continuousstream-2147483641.wav)
612576; 12 Profile - Marantz ND8006, useragent=AvegaMediaServer/2.0 Linux/2.6
612576; 13 Profile - Marantz ND8006, useragent=AvegaMediaServer/2.0 Linux/2.6
612577; 14 GetEncodedFile[1] 192.168.1.11 - GET  to 192.168.1.12; mime=audio/wav,rate=44100,channels=2
612609; 15 StateTimer - Loading,old=Stopped
612836; 16 StateTimer - Playing,old=Loading
612855; 17 SetNextAVTransportURI - Success - http://192.168.1.11:49382/encode/continuousstream0.wav:E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\02. Voyages.flac
643182; 18 StateTimer - Paused,old=Playing
651617; 19 SyncNewPlayState - Stopped,mb=Paused
651693; 20 GetEncodedFile[1] - exit=10054, playtime=39116
653732; 21 Profile - Generic Device, useragent=Unspecified, UPnP/1.0, SoftAtHome
653745; 22 Profile - Generic Device, useragent=Unspecified, UPnP/1.0, SoftAtHome
653833; 23 Profile - Marantz ND8006, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
657406; 24 Play - Input - E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\01. Le cœur du monde.flac Output - (http://192.168.1.11:49382/files/535025555998162Fp.flac)
657628; 25 Profile - Marantz ND8006, useragent=AvegaMediaServer/2.0 Linux/2.6
657657; 26 StateTimer - Loading,old=Stopped
657759; 27 GetFile[2] 192.168.1.11 - GET E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\01. Le cœur du monde.flac to 192.168.1.12
657760; 28 Profile - Marantz ND8006, useragent=AvegaMediaServer/2.0 Linux/2.6
658240; 29 StateTimer - Playing,old=Loading
658469; 30 SetNextAVTransportURI - Success - http://192.168.1.11:49382/files/086EC385A9C351FFp.flac:E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\02. Voyages.flac
848278; 31 GetFile[2] - exit=0, playtime=190517
849675; 32 Profile - Marantz ND8006, useragent=AvegaMediaServer/2.0 Linux/2.6
849675; 33 GetFile[3] 192.168.1.11 - GET E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\02. Voyages.flac to 192.168.1.12
849675; 34 Profile - Marantz ND8006, useragent=AvegaMediaServer/2.0 Linux/2.6
866449; 35 SetNextAVTransportURI - Success - http://192.168.1.11:49382/files/3557F57DA3E94307p.flac:E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\03. Je tiens d'elle.flac
1131969; 36 GetFile[3] - exit=0, playtime=282293
1151899; 37 StateTimer - Stopped,old=Playing
1151899; 38 SyncNewPlayState - Stopped,mb=Playing

Playlist
https://imgur.com/a/moDSUo5

BoringName

  • Sr. Member
  • ****
  • Posts: 916
the song hasn't started and this stops the rest of the list.
866449; 35 SetNextAVTransportURI - Success - http://192.168.1.11:49382/files/3557F57DA3E94307p.flac:E:\Musique\Chanson Française\Bernard Lavilliers\Bernard Lavilliers - Sous un soleil énorme\03. Je tiens d'elle.flac

Based on the log, the first 2 tracks on the list play through successfully. Is this correct?
Does everything display correctly on Musicbee while the first 2 tracks are playing?

With the info supplied so far it looks like the Marantz is stopping when attempting to play the 3rd track. The NextURI is getting set correctly so the device should just transition to that 3rd track automatically. The log isn't showing any errors from Musicbee's side.

As a test, can you create a playlist of the same tracks but change the play order so the third track is in position 2. Try playing that again and see if it stops on the same track.

jean.valjean

  • Jr. Member
  • **
  • Posts: 29
Quote
Based on the log, the first 2 tracks on the list play through successfully. Is this correct?
yes
Quote
Does everything display correctly on Musicbee while the first 2 tracks are playing?
yes

Quote
As a test, can you create a playlist of the same tracks but change the play order so the third track is in position 2. Try playing that again and see if it stops on the same track.
 i
dem

I reversed tracks 2 and 3 in the list.
Track 2, which has become 3, is displayed in the bottom bar in MusicBee but remains at 00:00. It does not start and the Marantz stops.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I reversed tracks 2 and 3 in the list.
Track 2, which has become 3, is displayed in the bottom bar in MusicBee but remains at 00:00. It does not start and the Marantz stops.

So just to confirm, it played the first 2 tracks successfully and stopped again on the 3rd track?

If that is the case, I don't think there is much I can do there. The plugin is setting the NextURI successfully, Musicbee is switching to the 3rd track like it should but the device is not. When the plugin checks the play state of the device, it's returning that it has stopped so it stops Musicbee.

The device should be automatically switching over to the third track but it isn't. It's not even making a request for the file. This problem appears to be caused by the device and there isn't much I can do about that.

Maybe try a few different combinations of tracks and see if it always stops on the third one.

You could check "disable NextURI support". This will most likely work but you will lose gapless playback. You will probably need to restart Musicbee to make sure the setting change applies.


edit: Actually before you try those suggestions, there is something else I can try. I previously had a delay when setting the NextURI but with recent changes there is a scenario where it may be attempting to set a NextURI right when the device is switching tracks. That might be causing problems. Leave it with me.
Last Edit: March 15, 2025, 12:57:14 AM by BoringName

BoringName

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

Changes
- The plugin will now only attempt to set the NextURI once it has confirmed the device has transitioned to the next track and added a small delay before setting NextURI to avoid possible device issues.


edit: I've noticed the progress bar sync isn't always occurring after a track transition. I'm looking into it.

edit2: Yeah, don't bother downloading this version. I'm overhauling the track transition code.... again. The recent changes highlighted some other issues that have been in the background unnoticed. I'll get another version out soonish that should handle it all a lot better.
Last Edit: March 15, 2025, 09:36:03 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Before I put out the next version I wanted to set it up so radio streams default to a continuous stream so the user doesn't have to manually set it every time they want to play a radio stream vs normal tracks.

Musicbee actually reads the plugin's settings and provides an empty URL string to the plugin if continuous stream is set and the plugin knows what to do with that when continuous stream is set.

If you try and play a radio stream without continuous stream set, Musicbee will provide the URL to the radio stream eg) something like - http://www.abc.net.au/res/streaming/audio/aac/triplej.pls
This makes the plugin fall over as it's expecting a normal file path (or network path) when continuous stream is not set.

What I was planning on doing was checking if the URL started with "http" and setting it blank if that was the case.

Before I did that I just wanted to double check if that would cause issues. Is there any scenario where someone would have a library that uses URL's starting with HTTP? eg) Can musicbee be set to use a library at an offsite location requiring HTTP URL's to connect?

I could make it an optional thing but I'm trying to avoid that, the config page is already getting too busy with options.

edit: actually I imagine some people might be using a HTTP path to connect to their NAS instead of UNC paths. It might be better to check the path extension for stream formats instead. Nope, that's not going to work as some streams end in .mp3
Last Edit: March 15, 2025, 11:32:41 AM by BoringName

jean.valjean

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

Quote
So just to confirm, it played the first 2 tracks successfully and stopped again on the 3rd track? 
yes


Radio playlist sites
“http://radio.pervii.com/fr/online-playlists-m3u.htm”
“https://fluxradios.blogspot.com/p/vlc-playlist.html”

Streaming works, and depending on the radio station, the tracks may or may not be displayed in MusiBee.
ex: “http://ouifm5.ice.infomaniak.ch/ouifm5.mp3”


jorgemg1984

  • Jr. Member
  • **
  • Posts: 31
Does anyone have the 1.6 file? 1.8.3 behaves erratically (repeats tracks, skips tracks, etc...), 1.6 was perfect. Thanks!