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

Casual Tea

  • Jr. Member
  • **
  • Posts: 23
All I can do is ad an option so the plugin doesn't send a blank NextURI but that might cause the player to just repeat the last song over and over again. Musicbee is supposed to stop if I call NextTrackPlayStarted and there is no next track in the now playing list so that might make everything work ok for you.

edit: looks like that response code is part of libupnp, it's a neverending rabbit hole....
I've set upmpdcli to debug level logging and captured what happens when MusicBee clears the nexturi. When removing the next song from Upcoming Tracks, the next song is correctly dropped by upmpdcli/mpd.
upmpdcli log:
Code
:4:../libupnpp/device/device.cxx:434::UPNP_CONTROL_ACTION_REQUEST: SetNextAVTransportURI args: InstanceID = 0
NextURI =
NextURIMetaData =

:4:../src/avtransport.cxx:396::Set(next)AVTransportURI: next 1 uri  metadata[]
:4:../src/mpdcli.cxx:886::MPDCli::repeat:0
:4:../src/mpdcli.cxx:910::MPDCli::random:0
:4:../src/mpdcli.cxx:922::MPDCli::single:0
:4:../src/mpdcli.cxx:898::MPDCli::consume:0
:4:../src/mpdcli.cxx:1063::MPDCli::deletePosRange [1, 2[
:4:../src/mpdcli.cxx:983::MPDCli::insert at :1 uri
:5:../src/mpdcli.cxx:254::MPDCli::eventloop: mpd_run_idle_mask: 4
:2:../src/mpdcli.cxx:336::(m_lastinsertid = mpd_run_add_id_to(m_conn, uri.c_str(), (unsigned)pos)) != -1 failed: No such song
:2:../src/mpdcli.cxx:339::(m_lastinsertid = mpd_run_add_id_to(m_conn, uri.c_str(), (unsigned)pos)) != -1 server error: 50
:2:../libupnpp/device/device.cxx:467::UpnpDevice: Action failed:  code -911
:4:../src/mpdcli.cxx:181::MPDCli::pollerCtl: mpd is playing
:5:../src/avtransport.cxx:363::AVTransport::onMpdEvent()
:4:../src/mpdcli.cxx:1124::MPDCli::getQueueData
:4:../src/mpdcli.cxx:1104::MPDCli::getQueueSongs: 1 songs
:4:../src/ohplaylist.cxx:262::OHPlaylist::makeIdArray: dropping uri http://192.168.1.5:49382/files/2BDE9E2934676BABp.flac
:4:../src/ohplaylist.cxx:269::OHPlaylist::makeIdArray: saving metacache
:5:../src/ohservice.cxx:69::Playlist: change: IdArray -> AAAAAg==
:4:../src/ohmetacache.cxx:98::dmcacheSave: got save task: 1 entries to /var/cache/upmpdcli//metacache
:5:../src/ohservice.cxx:69::Info: change: BitRate -> 799000

However after this it keeps repeating:
Code
:4:../libupnpp/device/device.cxx:434::UPNP_CONTROL_ACTION_REQUEST: SetNextAVTransportURI args: InstanceID = 0
NextURI =
NextURIMetaData =

:4:../src/avtransport.cxx:396::Set(next)AVTransportURI: next 1 uri  metadata[]
:4:../src/mpdcli.cxx:886::MPDCli::repeat:0
:4:../src/mpdcli.cxx:910::MPDCli::random:0
:4:../src/mpdcli.cxx:922::MPDCli::single:0
:4:../src/mpdcli.cxx:898::MPDCli::consume:0
:4:../src/mpdcli.cxx:983::MPDCli::insert at :1 uri
:2:../src/mpdcli.cxx:336::(m_lastinsertid = mpd_run_add_id_to(m_conn, uri.c_str(), (unsigned)pos)) != -1 failed: No such song
:2:../src/mpdcli.cxx:339::(m_lastinsertid = mpd_run_add_id_to(m_conn, uri.c_str(), (unsigned)pos)) != -1 server error: 50
:2:../libupnpp/device/device.cxx:467::UpnpDevice: Action failed:  code -911
:4:../libupnpp/device/device.cxx:434::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo args: InstanceID = 0

:4:../libupnpp/device/device.cxx:475::Response data: CurrentTransportState = PLAYING
CurrentTransportStatus = OK
CurrentSpeed = 1
At an insane rate (the log got to multiple MB in the span of 2 <3min test songs).

So I guess just send the command once and treat the "action failed" as the expected behavior I guess?

When casting from Symfonium and clearing the remaining tracks from the queue, the nexturi is cleared in the same way but there are no more requests after that.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I've set upmpdcli to debug level logging and captured what happens when MusicBee clears the nexturi. When removing the next song from Upcoming Tracks, the next song is correctly dropped by

I don't think that is what is happening. It attempts to insert the track with a blank NextURI and it produces an error.
Code
:2:../src/mpdcli.cxx:336::(m_lastinsertid = mpd_run_add_id_to(m_conn, uri.c_str(), (unsigned)pos)) != -1 failed: No such song
:2:../src/mpdcli.cxx:339::(m_lastinsertid = mpd_run_add_id_to(m_conn, uri.c_str(), (unsigned)pos)) != -1 server error: 50

The line where it's dropping a track is where it's removing the track that's just played.
Code
:4:../src/ohplaylist.cxx:262::OHPlaylist::makeIdArray: dropping uri http://192.168.1.5:49382/files/2BDE9E2934676BABp.flac

But it does seem to be the plugin that's sending thousands of SetNextAVTransport commands so there is something wrong on my end. It shouldn't matter what upmpdcli returns. If it's not 200 it should just log the attempt as failed and move on, not just resend indefinitely. I'll go through it again, I've missed something somewhere.

So I guess just send the command once and treat the "action failed" as the expected behavior I guess?

The method that sends the NextURI checks for a 200 code. 200 means it worked, anything other than 200 means the device had an error. I'm pretty sure that part of the code is fine as there is just no way for it to get stuck in a loop sending the command thousands of times. But it sends the command via a SOAP request which is handled elsewhere in the code, this handles all the communication and returns the response code to the NextURI method. I expect that's where it's falling over.

edit: for comparison, when the plugin sends a blank NextURI to foobar or BubbleUPnP they respond with 200. Accepting an error code when a blankURI is sent won't be a problem, I just need to figure out why it's looping.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
edit: Nope, I was wrong with that idea.

With the log spam, is it just upmpdcli log that gets spammed or does the plugin error log get spammed as well?

If it's both I'm going to be surprised as I can't find any way for the plugin to be doing this. I think it's upmpdcli getting stuck in the loop after erroring on the blank NextURI. Which means going back to the idea I had previously of just adding an option to stop it sending a blank one.
Last Edit: March 18, 2025, 06:13:05 AM by BoringName

simbun

  • Jr. Member
  • **
  • Posts: 39
New version mb_Upnp2025_1.9.1

Changes
- Some small changes to hopefully fix simbun's issues.

That's fixed it for both renderers.

So far I've only really checked FLAC native and decoded (applying replaygain) gapless playback, which seems to work well, so I'll try and spend some time testing seeking/skipping/continuous stream in the next day or two.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
So far I've only really checked FLAC native and decoded (applying replaygain) gapless playback, which seems to work well, so I'll try and spend some time testing seeking/skipping/continuous stream in the next day or two.

Take your time. Let me bask in the light of small victories before you find something else :)

Casual Tea

  • Jr. Member
  • **
  • Posts: 23
I've asked medoc (the dev of upmpdcli) about how to properly clear the nexturi. His response:
Quote
I’m afraid that this case is not expected by the current code. The UPnP standard does not seem to offer guidance on this.

I can have a look at fixing the code, but it won’t help with existing instances.

At the moment, the best idea I can come up with is to send a valid but guaranteed to not play command, setNextAVTransportURI with something like:
Code
uri = "http://192.2.0.2:0/song.mp3"
metadata = '<?xml version="1.0" encoding="utf-8"?><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"><item id="abc" parentID="ab" restricted="1" searchable="0"><dc:title>a</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><res duration="0:0:0" size="0" bitrate="192000" sampleFrequency="44100" bitsPerSample="16" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:* ">http://192.2.0.2:0/song.mp3</res></item></DIDL-Lite>'
Quote
You could probably get by with less metadata, I did not try for a minimal record which would still parse. The problem is that some of the renderers will have the checkcontentformat parameter set, and this wants valid metadata.
So until it's fixed on the side of  upmpdcli, you could try if this workaround works.

edit: Nope, I was wrong with that idea.

With the log spam, is it just upmpdcli log that gets spammed or does the plugin error log get spammed as well?

If it's both I'm going to be surprised as I can't find any way for the plugin to be doing this. I think it's upmpdcli getting stuck in the loop after erroring on the blank NextURI. Which means going back to the idea I had previously of just adding an option to stop it sending a blank one.

The log spam happens in both logs. The error spam stops the second I change the playback device to a local one in musicbee, so it's not like upmpdcli gets stuck (that would also happen when clearing the last track via Symfonium and that works without issues). So I'm fairly certain the plugin is causing it (sorry, haha).

Here's a quick repro of exactly what I'm doing:

In this 40s demonstration the plugin log grew to 508 lines of errors. The
Code
SetNextAVTransportURI - Failed -
block is in there 20 times.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
OK!
It looks like I am finally getting somewhere with getting this to work with LMS.

But, it is only working with MP3's.
Flac, Opus, Ape and Wav won't play.
SqueezePlay will show a popup: "Problem: Unable to play filetype:" for those.



I can get them all to play using 'force transcoding to MP3', but I would rather have them play at their original format/quality.
(playing them from LMS itself is working fine, so I don't think the problem is with LMS or SqueezePlay)

Any clue what I could do to get this to work?

In case it is helpful, here is the log after first playing an mp3 (successfully) and then a FLAC (unsuccessfully)

Code
11153; 11 Profile - Generic Device, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
14527; 12 Play - Input - K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - MP3.mp3 Output - (http://192.168.2.1:49382/files/4B6B04DD1FA4405Fp.mpeg)
14541; 13 Profile - LMS, useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
14548; 14 GetFile[1] 192.168.2.1 - GET K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - MP3.mp3 to 192.168.2.1
14548; 15 GetFile - range=bytes 0-8256988/8256989
14549; 16 Profile - LMS, useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
14661; 17 StateTimer - Loading,old=Stopped
14874; 18 ForcedEncode - Stream is being encoded to apply Replaygain/DSP settings.
14881; 19 SetNextAVTransportURI - Success - http://192.168.2.1:49382/encode/D57E65A1C1CE182E0.L16:K:\_MusicBee test library\_flac opus mp3\Don Grusin - Banana Fish\07 - Don Grusin - Goodbye.mp3
25633; 20 GetFile[1] - exit=10054, playtime=11083
27564; 21 ForcedEncode - Stream is being encoded to apply Replaygain/DSP settings.
27564; 22 Play - Input - K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - FLAC.flac Output - (http://192.168.2.1:49382/encode/C440319DFEE4A51F-2147483637.L16)
27685; 23 StateTimer - Loading,old=Stopped

Looking at this myself, I am wondering why the log contains something like:
Profile - Generic Device, useragent=LINUX UPnP/1.0 Denon-Heos
and
Profile - LMS, useragent=iTunes/4.7.1

I don't have iTunes installed.
I do have a Marantz receiver somewhere in the network, but it is off and not configured in the plugin.
(Marantz and Denon is the same company, so their DLNA/HEOS stuff is probably the same)

Perhaps I have set the profile incorrectly?:



- - -

edit

When checking ''force native stream (global setting)" things improve somewhat.
Flac will now also play. (so maybe it wasn't playing a Flac stream with that option unchecked?)

But when trying to play Opus or Ape there is now a MusicBee error popup: "Unable to start playback"
(Wav will now also play, it being with a small 'click' at the beginning)

Here's the log for first playing a Flac (successfully) and then an Opus (unsuccessfully)
(some weird "<?xml version=..." at the bottom?)

Code
9680; 11 Profile - Generic Device, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674
12772; 12 Play - Input - K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - FLAC.flac Output - (http://192.168.2.1:49382/files/C440319DFEE4A51Fp.x-flac)
12792; 13 Profile - LMS, useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
12800; 14 GetFile[1] 192.168.2.1 - GET K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - FLAC.flac to 192.168.2.1
12800; 15 GetFile - range=bytes 0-26558156/26558157
12800; 16 Profile - LMS, useragent=iTunes/4.7.1 (Windows; N; Windows 10; 8664; EN; cp1252) SqueezeCenter, Squeezebox Server, Logitech Media Server/8.5.2/1716215514
12908; 17 StateTimer - Loading,old=Stopped
13017; 18 SetNextAVTransportURI - Success - http://192.168.2.1:49382/files/D57E65A1C1CE182Ep.mpeg:K:\_MusicBee test library\_flac opus mp3\Don Grusin - Banana Fish\07 - Don Grusin - Goodbye.mp3
23317; 19 GetFile[1] - exit=10054, playtime=10515
26748; 20 Mimetype Error - Mimetype support cannot be verified with Renderer
26748; 21 DIDL Error - startIndex cannot be larger than length of string.
Parameter name: startIndex
26748; 22 Play - Input - K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - OPUS.opus Output - ()
26756; 23 PostSoapRequest - 500,send=POST /plugins/UPnP/MediaRenderer/AVTransport/control?player=d8%3Abb%3Ac1%3A89%3A80%3A77 HTTP/1.1
Host: 192.168.2.1:9000
User-Agent: MusicBee UPnP Plugin
Content-Type: text/xml; charset="utf-8"
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#Play"
Content-Length: 304

<?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play></s:Body></s:Envelope>
26756; 24 SoapRequest:Play:urn:schemas-upnp-org:service:AVTransport:1:InstanceID=0,Speed=1 - <?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError><errorCode xsi:type="xsd:int">716</errorCode><errorDescription xsi:type="xsd:string">Resource not found</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
26756; 25 Play - status=500,url=

- - -

edit 2

Perhaps when we have this figured out and have the plugin working well for LMS, you could add a preset for   LMS (Logitech Media Server/Lyrion) ?

It's fun to see how many people are using LMS, and still own—sometimes a lot of—various Squeezebox devices.
They seem even more popular and appreciated than in the ole' days.
The days when I could buy a good 2nd hand Squeezebox Classic for some 25 gulden/euro/dollars are also gone now ;-)
Last Edit: March 18, 2025, 10:48:45 PM by hiccup

jorgemg1984

  • Jr. Member
  • **
  • Posts: 31
1.9.1 is now working fine with an MXN10 streamer from Cambridge Audio, just heard a full album without any issues.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
So until it's fixed on the side of  upmpdcli, you could try if this workaround works.

Looking at the upmpdcli code, I think an invalid url (track that doesn't exist) will produce the same error code. And seeing as you have stated both logs are getting spammed, I don't think it will solve the problem. Although the code I was looking at hasn't been updated for 12 years so maybe I was just looking at an old fork of the code if the developer is still working on it.

Can you send me the plugin log that shows multiple instances of the error, just half a dozen or so. 500 lines over 40 seconds is not as spammy as I thought. That could be the NextURI code triggering every time the status check is made which probably just means I've missed something when the device returns an error for that command.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Any clue what I could do to get this to work?

In case it is helpful, here is the log after first playing an mp3 (successfully) and then a FLAC (unsuccessfully)

The flac is getting encoded because you have DSP or replaygain settings. The plugin has to encode the track to apply those.
27564; 22 Play - Input - K:\_MusicBee test library\_flac opus mp3\flac - mp3 - opus - ape\Walter Becker - 01 - Door Number Two - FLAC.flac Output - (http://192.168.2.1:49382/encode/C440319DFEE4A51F-2147483637.L16)

L16 is 16 bit PCM. I need to see the next few lines of the log to see what happens when you try and play this. Does it just stop or play noise?

Looking at this myself, I am wondering why the log contains something like:
Profile - Generic Device, useragent=LINUX UPnP/1.0 Denon-Heos
and
Profile - LMS, useragent=iTunes/4.7.1

iTunes is the useragent LMS uses. It's probably for compatibility reasons somewhere.

Marantz and denon do seem to show up as HEOS from the logs I've seen. Are you sure it's turned off? LMS could be using it too I suppose I can't remember.

Some devices use multiple useragents to communicate. You can see how many individual devices there are at the start of the log. Devices are listed after a "ProcessMessage" entry. It will show the IP address, uuid and name of the device.

Perhaps I have set the profile incorrectly?:

That should work. The useragent field just has to be a partial match of the useragent. If LMS is also using heos you can separate multiple useragents with a pipe symbol. So Logitech Media Server|Denon


But when trying to play Opus or Ape there is now a MusicBee error popup: "Unable to start playback"
(Wav will now also play, it being with a small 'click' at the beginning)

Ape? that's a new one. The plugin doesn't recognise those mimetypes currently. I should be able to sort that out. I assume LMS supports Opus and Ape?

Perhaps when we have this figured out and have the plugin working well for LMS, you could add a preset for   LMS (Logitech Media Server/Lyrion) ?

I think the issue you are going to have is you will want to use DSP/relaygain settings which will always trigger an encode. There is no way around that. I expect LMS might do some encoding of it's own if the incoming format isn't supported by the Squeezebox.

If you want the track to keep it's original samplerate, bit depth etc... just set the ranges for the output sample rate to the minimum and maximum values, leave "stereo only" unchecked and set the max bit depth to 24.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New version mb_Upnp2025_1.9.3

Changes
- Added support for Opus mimetypes. The musicbee API doesn't support Ape. The fact I only first heard of it today and it's 25 years old might be why....
- Errors occurring when setting a blank URI will now be ignored. It will be reported in the logs when this occurs.
- Fixed an issue that would cause the plugin to retry indefinitely when a NextURI call repeatedly fails. After 4 failed attempts in a row, sending NextURI will be disabled for that device until Musicbee is restarted.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
iTunes is the useragent LMS uses. It's probably for compatibility reasons somewhere.

Marantz and denon do seem to show up as HEOS from the logs I've seen. Are you sure it's turned off? LMS could be using it too I suppose I can't remember.

Some devices use multiple useragents to communicate. You can see how many individual devices there are at the start of the log. Devices are listed after a "ProcessMessage" entry. It will show the IP address, uuid and name of the device.
The Marantz receiver is in standby actually. (no actual on/off button) It's probably advertising itself on the network in that mode.


Quote from: BoringName
The useragent field just has to be a partial match of the useragent. If LMS is also using heos you can separate multiple useragents with a pipe symbol. So Logitech Media Server|Denon
I have changed the 'match useragent' to Logitech|iTunes
Do you think that is good?
(I won't be using the Marantz for this)


Quote from: BoringName
Ape? that's a new one. The plugin doesn't recognise those mimetypes currently. I should be able to sort that out.
I assume LMS supports Opus and Ape?
Yes it does.
When Ape came out, I think it was the first lossless audio compression algorithm, and that gained it a lot of popularity.
I also used it a lot:

But later on Flac became more and more popular and pretty much won the battle.
(Flac being open source and Ape not, being one of the reasons for that)
After a couple of years I converted all my Ape files to Flac and stuck with that.

But, these days I have a dedicated purpose for Ape again, so I would like to be able to play them using UPnP2025.
(I'll post a request to have APE added to the API)


Quote from: BoringName
I think the issue you are going to have is you will want to use DSP/relaygain settings which will always trigger an encode. There is no way around that.
I won't be using DSP or EQ, but I do want to use ReplayGain.

Making sure that I understand correctly:
So as soon as you play a song that has ReplayGain tags, and you have ReplayGain activated in MusicBee, the plugin will re-encode the file to PCM?
But if a song does not have ReplayGain tags, and/or ReplayGain is deactivated in MusicBee, it should be possible to stream the song in its original format, and preserving its RG tags?

Hm, I would prefer not to re-encode the files, and I want to use the ReplayGain information present in the tags.
Because same as MusicBee, LMS can also use ReplayGain. (album-, track-, smart- etc.)
So if the track would not be re-encoded, I am guessing LMS should be able to use the RG tag values?

If that is the case, I would need to turn off RG in MB when using UPnP2025, and then turn it on again after that.
Would it be possible for the plugin to have an option that can disable RG in MusicBee when the plugin is being used?
LMS will then take care of the correct loudness by using the RG tags, and re-encoding can be avoided?
(but hold on before doing anything. I'll first need to confirm that LMS will indeed use the RG tags information when rendering from UPnP2025, and for now that seems to fail)


- - -


A new test, using UPnP2025 v1.9.3.0 and MB v3.6.9208, no DSP, EQ or ReplayGain

using these settings:


I played a couple of tracks for some 10 seconds:

play an mp3 file
plays fine
stop

play a Flac file
no sound
stop

play an Opus file
no sound
stop

play a Wav file
no sound
stop

play an mp3 file again
plays fine
stop


the logfile:

Code
23080; 10 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 01 - Door Number Two - MP3.mp3 Output - (http://192.168.2.1:49382/files/709A3B8A1FA4405Fp.mpeg)
23131; 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
23139; 12 GetFile[1] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 01 - Door Number Two - MP3.mp3 to 192.168.2.1
23139; 13 GetFile - range=bytes 0-8256988/8256989
23140; 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
23235; 15 StateTimer - Loading,old=Stopped
23458; 16 PostSoapRequest - 500,send=POST /plugins/UPnP/MediaRenderer/AVTransport/control?player=d8%3Abb%3Ac1%3A89%3A80%3A77 HTTP/1.1
Host: 192.168.2.1:9000
User-Agent: MusicBee UPnP Plugin
Content-Type: text/xml; charset="utf-8"
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetNextAVTransportURI"
Content-Length: 352

<?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetNextAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><NextURI /><NextURIMetaData /></u:SetNextAVTransportURI></s:Body></s:Envelope>
23458; 17 SoapRequest:SetNextAVTransportURI:urn:schemas-upnp-org:service:AVTransport:1:InstanceID=0,NextURI=,NextURIMetaData= - <?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError><errorCode xsi:type="xsd:int">714</errorCode><errorDescription xsi:type="xsd:string">Illegal MIME-type</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
23461; 18 SetNextAVTransportURI - Failed - Ignored as a blank URI is probable cause.
36813; 19 GetFile[1] - exit=10054, playtime=13672
39418; 20 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 02 - Door Number Two - FLAC.flac Output - (http://192.168.2.1:49382/files/939522C965308B1Cp.x-flac)
39430; 21 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
39431; 22 GetFile[2] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 02 - Door Number Two - FLAC.flac to 192.168.2.1
39431; 23 GetFile - range=bytes 0-26558156/26558157
39431; 24 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
39557; 25 StateTimer - Loading,old=Stopped
50722; 26 GetFile[2] - exit=10054, playtime=11290
53881; 27 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 03 - Door Number Two - OPUS.opus Output - (http://192.168.2.1:49382/encode/BECBE4282A21C9BD-2147483633.L16)
54009; 28 StateTimer - Loading,old=Stopped
54252; 29 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
54253; 30 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
54254; 31 GetEncodedFile[3] - range=bytes 0-52468415/52468416
54254; 32 GetEncodedFile[3] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 03 - Door Number Two - OPUS.opus to 192.168.2.1; mime=audio/L16;rate=48000;channels=2,rate=48000,channels=2
64643; 33 GetEncodedFile[3] - exit=10054, playtime=10387
66959; 34 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 05 - Door Number Two - PCM.wav Output - (http://192.168.2.1:49382/encode/472DD050DD4B6785-2147483622.L16)
67095; 35 StateTimer - Loading,old=Stopped
67311; 36 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
67312; 37 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
67312; 38 GetEncodedFile[4] - range=bytes 0-48204119/48204120
67312; 39 GetEncodedFile[4] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 05 - Door Number Two - PCM.wav to 192.168.2.1; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
77482; 40 GetEncodedFile[4] - exit=10054, playtime=10169
79575; 41 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 01 - Door Number Two - MP3.mp3 Output - (http://192.168.2.1:49382/files/709A3B8A1FA4405Fp.mpeg)
79586; 42 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
79586; 43 GetFile[5] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 01 - Door Number Two - MP3.mp3 to 192.168.2.1
79586; 44 GetFile - range=bytes 0-8256988/8256989
79586; 45 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
79698; 46 StateTimer - Loading,old=Stopped
79909; 47 PostSoapRequest - 500,send=POST /plugins/UPnP/MediaRenderer/AVTransport/control?player=d8%3Abb%3Ac1%3A89%3A80%3A77 HTTP/1.1
Host: 192.168.2.1:9000
User-Agent: MusicBee UPnP Plugin
Content-Type: text/xml; charset="utf-8"
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetNextAVTransportURI"
Content-Length: 352

<?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetNextAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><NextURI /><NextURIMetaData /></u:SetNextAVTransportURI></s:Body></s:Envelope>
79909; 48 SoapRequest:SetNextAVTransportURI:urn:schemas-upnp-org:service:AVTransport:1:InstanceID=0,NextURI=,NextURIMetaData= - <?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError><errorCode xsi:type="xsd:int">714</errorCode><errorDescription xsi:type="xsd:string">Illegal MIME-type</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
79912; 49 SetNextAVTransportURI - Failed - Ignored as a blank URI is probable cause.
90182; 50 GetFile[5] - exit=10054, playtime=10596

- - -

edit:

OK, this is weird.

Trying it again less than an hour later, Flac will now also play.
Without me having changed any setting at all.
(Opus and Wav still fail)

Code
0; 1 Initialise - 3/19/2025 18:14:26
30; 2 GetNetworkAddresses - 192.168.2.1,dns=True,name=Ethernet 2,speed=1000000000
30; 3 GetNetworkAddresses - 127.0.0.1,dns=False,name=Loopback Pseudo-Interface 1,speed=1073741824
30; 4 GetNetworkAddresses - http://192.168.2.1:49382
50; 5 ProcessMessage 192.168.2.111 - device 'uuid:6e52c5d4-d3c1-1894-0080-0005cdf71792:Marantz NR1509',valid=True
963; 6 ProcessMessage 127.0.0.1 - device 'uuid:AB9A065F-27CA-0727-FA47-55F54D527FA3:SqueezePlay',valid=True
965; 7 Profile - LMS (Lyrion/Logitech Media Server), useragent=|Logitech Media Server (8.5.2 - 1716215514)
966; 8 Profile - LMS (Lyrion/Logitech Media Server), useragent=|Logitech Media Server (8.5.2 - 1716215514)
981; 9 Activate - SqueezePlay: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:*
1865; 10 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 01 - Door Number Two - MP3.mp3 Output - (http://192.168.2.1:49382/files/709A3B8A1FA4405Fp.mpeg)
1879; 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
1886; 12 GetFile[1] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 01 - Door Number Two - MP3.mp3 to 192.168.2.1
1886; 13 GetFile - range=bytes 0-8256988/8256989
1886; 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
2204; 15 PostSoapRequest - 500,send=POST /plugins/UPnP/MediaRenderer/AVTransport/control?player=d8%3Abb%3Ac1%3A89%3A80%3A77 HTTP/1.1
Host: 192.168.2.1:9000
User-Agent: MusicBee UPnP Plugin
Content-Type: text/xml; charset="utf-8"
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetNextAVTransportURI"
Content-Length: 352

<?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetNextAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><NextURI /><NextURIMetaData /></u:SetNextAVTransportURI></s:Body></s:Envelope>
2205; 16 SoapRequest:SetNextAVTransportURI:urn:schemas-upnp-org:service:AVTransport:1:InstanceID=0,NextURI=,NextURIMetaData= - <?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError><errorCode xsi:type="xsd:int">714</errorCode><errorDescription xsi:type="xsd:string">Illegal MIME-type</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2207; 17 SetNextAVTransportURI - Failed - Ignored as a blank URI is probable cause.
12478; 18 GetFile[1] - exit=10054, playtime=10587
15268; 19 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 02 - Door Number Two - FLAC.flac Output - (http://192.168.2.1:49382/files/939522C965308B1Cp.x-flac)
15278; 20 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
15278; 21 GetFile[2] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 02 - Door Number Two - FLAC.flac to 192.168.2.1
15278; 22 GetFile - range=bytes 0-26558156/26558157
15279; 23 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
15390; 24 StateTimer - Loading,old=Stopped
15613; 25 PostSoapRequest - 500,send=POST /plugins/UPnP/MediaRenderer/AVTransport/control?player=d8%3Abb%3Ac1%3A89%3A80%3A77 HTTP/1.1
Host: 192.168.2.1:9000
User-Agent: MusicBee UPnP Plugin
Content-Type: text/xml; charset="utf-8"
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetNextAVTransportURI"
Content-Length: 352

<?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetNextAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><NextURI /><NextURIMetaData /></u:SetNextAVTransportURI></s:Body></s:Envelope>
15613; 26 SoapRequest:SetNextAVTransportURI:urn:schemas-upnp-org:service:AVTransport:1:InstanceID=0,NextURI=,NextURIMetaData= - <?xml version="1.0" encoding="UTF-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError><errorCode xsi:type="xsd:int">714</errorCode><errorDescription xsi:type="xsd:string">Illegal MIME-type</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
15616; 27 SetNextAVTransportURI - Failed - Ignored as a blank URI is probable cause.
25736; 28 GetFile[2] - exit=10054, playtime=10456
28196; 29 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 03 - Door Number Two - OPUS.opus Output - (http://192.168.2.1:49382/encode/BECBE4282A21C9BD-2147483632.L16)
28211; 30 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
28211; 31 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
28213; 32 GetEncodedFile[3] - range=bytes 0-52468415/52468416
28213; 33 GetEncodedFile[3] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 03 - Door Number Two - OPUS.opus to 192.168.2.1; mime=audio/L16;rate=48000;channels=2,rate=48000,channels=2
28327; 34 StateTimer - Loading,old=Stopped
38960; 35 GetEncodedFile[3] - exit=10054, playtime=10746
40924; 36 Play - Input - K:\_MusicBee test library\UPnP test\Walter Becker - 05 - Door Number Two - PCM.wav Output - (http://192.168.2.1:49382/encode/472DD050DD4B6785-2147483621.L16)
40935; 37 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
40935; 38 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
40935; 39 GetEncodedFile[4] - range=bytes 0-48204119/48204120
40935; 40 GetEncodedFile[4] 192.168.2.1 - GET K:\_MusicBee test library\UPnP test\Walter Becker - 05 - Door Number Two - PCM.wav to 192.168.2.1; mime=audio/L16;rate=44100;channels=2,rate=44100,channels=2
41051; 41 StateTimer - Loading,old=Stopped
51777; 42 GetEncodedFile[4] - exit=10054, playtime=10840
Last Edit: March 19, 2025, 06:21:40 PM by hiccup

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I have changed the 'match useragent' to Logitech|iTunes
Do you think that is good?

That should be fine.

So as soon as you play a song that has ReplayGain tags, and you have ReplayGain activated in MusicBee, the plugin will re-encode the file to PCM?
But if a song does not have ReplayGain tags, and/or ReplayGain is deactivated in MusicBee, it should be possible to stream the song in its original format, and preserving its RG tags?

If replaygain is enabled AND the track has replaygain tags, it will be encoded.
If replaygain is enabled and the track does not have replaygain tags, it will not be encoded.
If replaygain is disabled, the track will not be encoded whether it has tags or not.
If the equaliser or any DSP is enabled, the track will be encoded regardless of any tags.

So if the track would not be re-encoded, I am guessing LMS should be able to use the RG tag values?

Replaygain is currently not included in the metadata that is sent to the device. I'll see if that's possible.

Would it be possible for the plugin to have an option that can disable RG in MusicBee when the plugin is being used?

"force native stream" does this.

(but hold on before doing anything. I'll first need to confirm that LMS will indeed use the RG tags information when rendering from UPnP2025, and for now that seems to fail)

As above, that information isn't currently passed on to the device.

using these settings:


I played a couple of tracks for some 10 seconds:

If you look at the start of the log, it lists all the mimetypes supported by squeezeplay. Opus and Wav are not listed there so the plugin is encoding those files to L16. I don't know why they are not playing any audio though.

Try it again with "force native stream" and see what happens.

I'll probably have to install LMS again to sort this one out.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Actually, what you want to do isn't going to work. LMS isn't really involved in the process other than providing the Squeezeplay renderer.

Musicbee is the control point.
Squeezeplay is the renderer.

For what you want to do LMS would need to be the control point. That's why Opus and Wav are getting encoded, even though LMS supports those codecs, the Squeezeplay device does not and LMS is not really involved when Musicbee sends a track to the Squeezeplay device.

If the Squeezeplay device supports replaygain tags in the metadata it might work.

edit: Nope, replaygain isn't included in the standard so you're out of luck there sorry.
Last Edit: March 19, 2025, 11:44:10 PM by BoringName

hiccup

  • Hero Member
  • *****
  • Posts: 9107
Thanks for the explanations and thoughts about all this.
I'll digest and test things further later.

That's why Opus and Wav are getting encoded, even though LMS supports those codecs, the Squeezeplay device does not...
Are you sure about that?
As I said before, all formats including Wav and Ape play fine using LMS > Squeezeplay.