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

Moodymann

  • Jr. Member
  • **
  • Posts: 29
Guys, describe your experience of streaming Soundcloud in BubbleUPnP for Android using the plugin? What specific plugin settings are needed for this? If it is even possible? I have BubbleUPnP selected as the sound output in the settings, but the track does not play and this message pops up:

If you're streaming from the net like a radio station or soundcloud, I expect you will need to tick "output as continuous stream" at the top of the settings page. There is no getting around that. Make sure to read the little note there about not being able to display track information.

Also untick "enable remote control of musicbee via UPnP". That option is only needed if you are using Musicbee as a renderer for a control point which is very unlikely.

"Continuous stream" has never worked for me, and not with local files either. I listen to files from the library in the "force native stream" mode. It suits me. But it is not suitable for radio and Soundcloud streaming. It looks like there are some BubbleUPnP settings that I don't know about)

hiccup

  • Hero Member
  • *****
  • Posts: 9107
About improving the configuration panel:
I understand it if it's not worth your time. It's non-essential.

About the progressbar hiccup in the first second:
It doesn't bother me. I only mentioned it in case it was related to the sound clicks.

About a preset for LMS:
A new and non-savvy user will have no clue what boxes to check, or what to enter under user agent.
Isn't that what presets are for?

About adding Opus as an output format option:
Since Opus is much better for streaming purposes than e.g. mp3, I assumed there would be devices that support it. If not, there probably will be in the future?
But it's certainly not essential.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
"Continuous stream" has never worked for me, and not with local files either. I listen to files from the library in the "force native stream" mode. It suits me. But it is not suitable for radio and Soundcloud streaming. It looks like there are some BubbleUPnP settings that I don't know about)

Continuous mode will not work with "force native stream" ticked. I should probably change it so they can't both be ticked at the same time.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
About the progressbar hiccup in the first second:
It doesn't bother me. I only mentioned it in case it was related to the sound clicks.

It's also a lot more noticeable when you are playing a bunch of very short tracks. There might be be a better way to sync the bars up but I don't know what it is. Every setup will be different in how long it takes the device to start playing a track once it's been sent a play command, so waiting for the device to report back when it's hit the 1 second mark seemed like the best way to do it. Eventing might provide a better result but that's a bit of work to setup and I have a feeling a lot of devices won't support it.

Quote
About a preset for LMS:
A new and non-savvy user will have no clue what boxes to check, or what to enter under user agent.
Isn't that what presets are for?

Yes but I've set it up now so "force native stream" is ticked by default. This should just work for a vast majority of users without having to mess around with presets at all. Profiles are a bit redundant really. It's only benefit is for users that stream to multiple devices which have different capabilities. And that's probably only an issue if some of those devices are old.

Quote
About adding Opus as an output format option:
Since Opus is much better for streaming purposes than e.g. mp3, I assumed there would be devices that support it. If not, there probably will be in the future?
But it's certainly not essential.

Is there a need for it though? I might just be ignorant on the details but I think hardware has outgrown the need for more efficient encoding when it comes to audio. In terms of bandwidth and storage. For lossy codecs anyway....

jorgemg1984

  • Jr. Member
  • **
  • Posts: 31
I have an Eversolo A6 Gen2 for testing, and after Eversolo's recent UPNP fix, it works flawlessly with MusicBee's plugin, at least for listening an album from top to bottom.

Moodymann

  • Jr. Member
  • **
  • Posts: 29
"Continuous stream" has never worked for me, and not with local files either. I listen to files from the library in the "force native stream" mode. It suits me. But it is not suitable for radio and Soundcloud streaming. It looks like there are some BubbleUPnP settings that I don't know about)

Continuous mode will not work with "force native stream" ticked. I should probably change it so they can't both be ticked at the same time.
I run continuous mode separately from force native stream and it doesn't work

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I'll check it out, It might be including the wrong sample rate metadata.

It doesn't appear to be an issue with the plugin, it's sending the correct sample rates to the device. It's an issue with the Opus codec and possibly the Bass library. Maybe associated with the original sample rate stored in the header. I've replied to the bug post with a bit more info.

Ive added Ape support and that seems to be working fine. Files show as Monkey Audio in foobar as a native stream and there doesn't appear to be any issues when Ape files are encoded to other formats. I won't be setting Ape as an output format (probably can't even if I wanted to). Also considering the limitations of Opus (details in the bug thread link), I think that will create more issues than it solves so won't be making that an output format either.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I run continuous mode separately from force native stream and it doesn't work

It looks like I've broken something here. I'll look into it.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Continuous streaming to BubbleUPnP is broken and I don't think there is anything I can do to fix that. The issue is BubbleUPnP queries the stream first, closes it then requests it again. For normal file streaming this isn't a problem as the plugin can just open a new stream to the track but for continuous streams this is not possible.

There was a bug where Musicbee would not close streams and eventually lock up, this bug is probably what allowed BubbleUPnP to previously work with continuous streams as it's attempts to close the stream wouldn't actually close it. Fixing that bug made the plugin a lot more stable and allowed normal streams to work properly with multiple renderers including BubbleUPnP but it has obviously broken continuous streams for BubbleUPnP.

Also continuous streaming was generally just an option to get the plugin to work with difficult devices. I think we are at a point now where most devices work without the need for the continuous stream setting. Which is good because you couldn't display track information with that method, I think cross fading is probably the only thing lacking.

Continuous stream does still work with Foobar except there seems to be a problem with Musicbee switching to the next track when it reaches 50% of the current playing track. I'm currently trying to work out if that's a plugin or Musicbee issue.
Edit: Actually there isn't a problem. Musicbee just transitions to the next song early because it's caching it ahead of time. Foobar still plays the initial song to the end and transitions to the next song ok.

I can't get radio streams to work. I've set the plugin to force those streams as continuous play but they stop after 5 seconds with Foobar. I don't think that's something I can fix either. I'll run it by Steven when I sort out the 50% issue listed above. It might be possible to send the original URL to the device but then you lose any ability to change the format so it would be dependent on the device supporting whatever format the stream is in.
Edit: This isn't going to work. If I manually force continuous streams for radio streams Musicbee wont stream it correctly. It's just how it works. So to stream radio the 'output as continuous stream' option will need to be checked. The stream stopping after 5 seconds appears to be Musicbee stopping the stream and not a foobar issue so I'll discuss that with Steven.

In the meantime I'd suggest just opening radio streams on the device directly. If it's running android there's probably a desktop service like VNC you can use to connect to it from your PC.
Last Edit: April 12, 2025, 01:03:43 AM by BoringName

hiccup

  • Hero Member
  • *****
  • Posts: 9107
About a preset for LMS:
A new and non-savvy user will have no clue what boxes to check, or what to enter under user agent.
Isn't that what presets are for?
Yes but I've set it up now so "force native stream" is ticked by default. This should just work for a vast majority of users without having to mess around with presets at all. Profiles are a bit redundant really. It's only benefit is for users that stream to multiple devices which have different capabilities. And that's probably only an issue if some of those devices are old.
That won't work for me, because when using your suggested default setting using 'force native stream':
-  ReplayGain information is ignored/not working (Opus being the sole exception)
-  24 bit audio won't play
-  less common file types such as APE won't play
  (I am aware APE may be fixed after ongoing updates for both LMS and UPnP2025, but there are also other file types that MusicBee 'knows' but LMS can't play)

So I persist in my belief that having a build-in LMS preset will be beneficial.
Contrary to some 'default' setting, I'm pretty sure this proposed preset of mine will 'just work' for all LMS users and owners of Squeezebox devices.

Perhaps other older existing presets can get rid of to clean things up?
But that may require feedback from other users that are using this plugin and are using those hardware or software players.

Or maybe take the Elon Musk approach?:
Remove all presets.

And then only add presets for software/hardware devices that forum members have tested, recommended and specified because the default setting didn't work well for them and their device?

Some software and hardware devices that I think have been mentioned in this thread that seem relevant enough to make sure they work with either a default setting or else a custom preset:

-  foobar2000
-  LMS (Logitech/Lyrion Media Server)
-  Cambridge devices
-  Denon/Marantz devices
-  Eversolo devices
-  WIIM devices

And perhaps some popular gaming devices such as PlayStation and Xbox, but I don't think there has been any input or responses from users of such devices so far, so those devices can probably be ignored for now.
 
And… perhaps it makes sense to add MusicBee as a renderer preset?
edit: no, not a very smart suggestion, since that would require some UPnP rendering plugin/functionality that currently does not exist.
Last Edit: April 12, 2025, 09:29:47 PM by hiccup

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New version - mb_Upnp2025_2.0.1 link deleted, see further post for newer version.

Changes
- Updated some tooltips.
- Added support for source files using Monkey Audio (Ape). I haven't done extensive testing but it seems to work fine with Foobar.
- 'force native stream' will be automatically unchecked if 'continuous stream' is checked.
- The plugin will ignore the state of 'disable NextURI Support' and not send a NextURI if continuous stream is checked. It's not automatically unchecked like 'force native stream' because it's a profile specific setting.
- Added a preset for Logitech/Lyrion music server. Note - presets are only loaded during initial install of the plugin.
- Added some limited support for radio streams. Continuous output needs to be unchecked.

For radio streams, the plugin will send the original radio stream URL to the device. It basically bypasses Musicbee so it can't be encoded to a different format. The device needs to support the radio stream format for it to work. I tested in Foobar and BubbleUPnP and it worked but foobar didn't like one radio stream ending in .pls, it played streams ending in .mp3 and .aac ok. Edit: .m3u8 also work. Musicbee will display the name of the radio station, the current play position and name of the first track if it's provided with the stream but it will not continually update the playing track. Not much I can do about that. When I was testing Foobar would update the current playing track if that metadata was provided in the stream but Musicbee always displayed the initial track title.
Last Edit: April 13, 2025, 03:26:05 AM by BoringName

hiccup

  • Hero Member
  • *****
  • Posts: 9107
New version - mb_Upnp2025_2.0.1
- Added a preset for Logitech/Lyrion music server. Note - presets are only loaded during initial install of the plugin.
Selecting that preset still seems to force native stream?

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Selecting that preset still seems to force native stream?1

'force native stream' is a global setting and is enabled by default on initial install. I've set it up that way because I expect for 90% of users that will just work without having to do any profile shenanigans.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
'force native stream' is a global setting and is enabled by default on initial install. I've set it up that way because I expect for 90% of users that will just work without having to do any profile shenanigans.
I wish is it wasn't, and I have explained why.
It breaks some functionality for LMS/Squeezebox devices. (and probably for anyone else wanting to use ReplayGain)
So in the current state the newly added LMS preset is pretty much useless.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I wish is it wasn't, and I have explained why.

With it ticked by default, a large majority of users will not even have to open the settings page for the plugin to work.

If you're asking me to make the 'force native stream' profile specific or not have it ticked by default, I'm not going to do that because of the reason above.

All LMS users have to do is untick a box. I expect people talented enough to setup and install Lyrion will have a lot less problems figuring that out than a majority of general users.

edit: The biggest issue from what I've seen in here is users trying to figure out what the useragent field should be, presets get around that. The rest of the settings are pretty straight forward.