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

maratsos

  • Newbie
  • *
  • Posts: 1
Hello - I just wanted to say many thanks to BoringName for giving us UPnP 2025.

It works great on my Win 10 laptop, where I use MB to stream sound to my Wiim Amp.

BoringName

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

Changes
- The profile list will properly select the new profile when clicking the add button.
- New Option - "enable remote control of musicbee via UPnP". It's a UPnP MediaRenderer service. *** Experimental ***. Don't check this unless you are actually going to use it.

The renderer doesn't work in the traditional sense. You can't stream things to Musicbee. As far as I know Musicbee can't play a stream?

But it does allow some remote control aspects via UPnP.

Using BubbleUPnP on my android phone I can browse the Musicbee library via DLNA\UPnP and set the Musicbee Renderer as the output device. When selecting to play a track with this setup, it will tell Musicbee to play that track.

What you can do when the Musicbee Renderer is set as the output in BubbleUPnP
- Play a track from the Musicbee DLNA library and Musicbee will play it.
- Basic controls will be reflected in Musicbee, Pause, play, next, seek etc.. pushing the volume buttons on the phone while Mb renderer is set as the output will adjust Musicbee's volume. Note- Next will just play the next track in the BubbleUPnP playlist, not a playlist or Now Playing list in Musicbee. The playlist is limited to 15 tracks in the free version of BubbleUPnP. But the next/previous commands are configured for other UPnP controllers to use (more below on this).

What you can't do
- Select a song on your phones internal storage and play it to the Musicbee Renderer. It will give you an error.
- Unmute. Something is broken with that at the moment with BubbleUPnP. It will allow you to mute but not unmute.
- It has no other control over Musicbee, you can't create or modify playlists or edit track info. It's purely for playing tracks.

It's experimental and a bit janky to be honest. I think most users will probably find it too clunky. There are times where you have to wait for the devices to appear. If you are having problems just close everything, start Musicbee first and then start BubbleUPnP. Everything should show up ok then.

Info for any developers wanting to use the Renderer features-

In terms of the UPnP standard, It's a proper MediaRenderer device. The only difference is it just ignores the stream info and tells Musicbee to play the track directly. Most of the other actions should work normally. It should be possible to create simple remote app that lets you send play, stop, pause, seek, next, previous, volume, mute commands to Musicbee from any device on the network. And set play modes like repeat and shuffle.

The plugin creates a hash of all tracks and keeps a list of these hashes and the track metadata including the original URL (filepath). When the MediaServer component serves tracks over DLNA, this hash is part of the URL. When the Renderer receives this URL via the SetAVTransportURI action, it strips out the hash and finds the original track URL from the previously mentioned list then tells Musicbee to play it. That's why it can't play tracks from your internal phone storage because the supplied URI will not contain the hash information.

The SetAVTransportURI action will check if the supplied CurrentURI variable is a Musicbee style URL (basically the filepath) and play it if it exists in the Musicbee library. So technically I might be able to do a workaround so songs played from a mobile devices internal storage could be played but the folder structure would have to be the same as the PC and the track would have to exist on the PC and in the Musicbee library.

SetNextAVTransportURI isn't fully implemented yet.

Controllers can subscribe to Renderer events and will receive an initial response but nothing after that. That's what I'll be working on next.

I may have missed some things, this crap is bloody complicated (for me anyway) so expect errors.

I found a devicespy app on github that I compiled. It lets you browse for UPnP devices on the network and invoke actions on UPnP services. I can supply that if anyone is interested in playing around. Its a little buggy but mostly works...

edit: Forgot to mention the Renderer port will always be one digit higher than the server port. I'll add options later to manually set it and the renderer name.
Last Edit: February 04, 2025, 07:57:10 AM by BoringName

Odysseus

  • Newbie
  • *
  • Posts: 3
Hello and thank you for reviewing this add-on

I'm having the same problem as with the old version

The Denon player is perfectly detected and works BUT the program freezes in the playlist if I want to play another music track. Sometimes it accepts a first change of music track but blocks on the second change.

I don't have this problem with Audivarna

the Denon is correctly identified in the log

1530; 10 Profile - Generic Device, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674

I use the generic or bubbleUpnp or upnpplay profile

BoringName

  • Sr. Member
  • ****
  • Posts: 916
1530; 10 Profile - Generic Device, useragent=LINUX UPnP/1.0 Denon-Heos/08de8fcd6d08b43bcefbbc8c6001666b16418674

Is that all that is in the error log? It's not much to go on.

Just to make sure I have this right
- Start playing in Musicbee with the Denon set as the output device.
- This plays through fine and transitions through each song if you don't touch it?
- If you right click a different song and select "play now" most of the time it will freeze Musicbee but sometimes it will let you change it once and it will freeze the second time you try?
- Does it eventually unfreeze or do you have to force close Musicbee?
- What does the Denon do when this freeze happens?

What's the Denon model?

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I've been playing around with it a bit today with different renderers and there is definitely a playback issue there. Especially when attempting to seek. I can make it crap itself fairly consistently. The only renderer I've found with an error log is BubbleUPnP but it's stupidly vague which makes troubleshooting a pain.

I'll see if I can figure it out.

xxubiqts

  • Newbie
  • *
  • Posts: 1
Just wanted to say thank you for taking on this project. Works perfectly out of the box with my WiiM.

Arylic67

  • Newbie
  • *
  • Posts: 19
Hi, Musicbee has problems with any song. The song stops, goes back and starts again from a certain point. With Foobar downloaded from the site, everything is ok!! Is it possible that it is the plugin? same problem also with new plugin 2025. I noticed that Musicbee increases the bitrate of some songs from the original 850 to 4780 (fake)!!

hiccup

  • Hero Member
  • *****
  • Posts: 9107
What's your deal with starting many similar topics, ignoring any answers and suggestions given by other forum members, but just starting yet another topic?
That's very bad practice and can you get banned or ignored pretty quickly.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10266
Is it possible that it is the plugin? same problem also with new plugin 2025
What version of MB are you using? (Help > About) INCLUDE THE LETTER (if any) AFTER THE NUMBER
How was MB installed? (Store, Installer, Portable)
It would be extremely helpful to anyone trying to help you if you told us what plugin you're referring to.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

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

BoringName

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

Changes
- Made it more obvious in the log if the renderer doesn't support the codec you're trying to stream to it.
- Increased the number of concurrent connections that can be made which might stop some devices from locking up Musicbee.
- Added a warning to the log when the max connections has been reached.
- Improved seek handling. Note - Some formats cannot be seeked and might cause a device crash. Using BubbleUPnP as a renderer will crash BubbleUPnP if you try and seek an MP3 stream. WAV seems ok. I'll look into improving this.

Arylic67

  • Newbie
  • *
  • Posts: 19
Hi, Musicbbe version is portable (but it also happens with installer) version 3.5.8698 P. Plugin installed is upnp version 2024 or also 2025 (new). I use Windows 10.Thanks
Last Edit: February 11, 2025, 07:18:05 AM by Arylic67

Arylic67

  • Newbie
  • *
  • Posts: 19
What's your deal with starting many similar topics, ignoring any answers and suggestions given by other forum members, but just starting yet another topic?
That's very bad practice and can you get banned or ignored pretty quickly.

Excuse me, I didn't think I had opened the same topic. Yes it's true I have opened many, I'm a new user and I'm having problems.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Take it to the UPnP plugin thread and I'll try and fix your problem. There is a new version that might have fixed it already....
https://getmusicbee.com/forum/index.php?topic=42468.75

What would help a lot is if you could enable the debug log. Perform whatever action is failing for you and copy paste the log file results into your post.

The reason the bitrate is changing is you probably haven't setup a streaming profile for your device so it's just using the generic profile and re-encoding the track.

Thanks.

aktor

  • Sr. Member
  • ****
  • Posts: 336
Just wanted to say thank you for taking on this project. Works perfectly out of the box with my WiiM.

What Wiim, mini?

Arylic67

  • Newbie
  • *
  • Posts: 19
Hi, I saved the debug log is requested. I also have problems with the new 2025 plugin. It's too long, How can I send it as an attachment? Thanks