Skip to main content
Topic: UPnP MediaRenderer output | discussion (Read 133424 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: UPnP MediaRenderer output | discussion

Reply #100
Here is a packet dump streamed from my router > wireshark, filtered on the MACs of my android phone (using BubbleUPNP) and Sony device.
Due to the possibility that it might include third party connections containing sensitive information it is password protected. I'm sending Peter the password via PM.

1: Start foobar with foo_upnp in server mode.
2: Start bubbleUPNP on my android phone
3: Browse the foobar server and load some files in the renderer's playlist and play them
4. Send stop

I'm not sure if the router is properly forwarding 100% of the packets so some of them might be lost in transit.

Re: UPnP MediaRenderer output | discussion

Reply #101
Here is a packet dump streamed from my router > wireshark, filtered on the MACs of my android phone (using BubbleUPNP) and Sony device.
Due to the possibility that it might include third party connections containing sensitive information it is password protected. I'm sending Peter the password via PM.

1: Start foobar with foo_upnp in server mode.
2: Start bubbleUPNP on my android phone
3: Browse the foobar server and load some files in the renderer's playlist and play them
4. Send stop

I'm not sure if the router is properly forwarding 100% of the packets so some of them might be lost in transit.

Can you email me a BubbleUPnP log file doing the same actions (ideally playing a track stored on your Android device so the renderer http requests appear) ? It will be a lot easier than raw wireshark traces. I will pass the relevant info to Peter to help troubleshoot this issue.
See end of the first post of this thread for logging instructions: http://forum.xda-developers.com/showthread.php?t=1118891.

Also: are you able to successfully change volume of this renderer in BubbleUPnP ? or if using foo_upnp ?
 

Re: UPnP MediaRenderer output | discussion

Reply #102
Can you email me a BubbleUPnP log file doing the same actions (ideally playing a track stored on your Android device so the renderer http requests appear) ? It will be a lot easier than raw wireshark traces. I will pass the relevant info to Peter to help troubleshoot this issue.
See end of the first post of this thread for logging instructions: http://forum.xda-developers.com/showthread.php?t=1118891.
Also: are you able to successfully change volume of this renderer in BubbleUPnP ? or if using foo_upnp ?
 

foo_upnp cannot see the soundbar renderer at all - only my TV.
foo_out_upnp can see and select the soundbar renderer but all functions fail including volume control.
bubbleUPNP (Android) - playback, seeking and volume control is working flawlessly for the soundbar.

The renderer accepts 24bit 96khz flac at 4.7mbit bitrate without a problem as indicated by the sony renderer (app?) on the devices HDMI port while a stream is being rendered.
Playing to my TV is not an option, although it's connected to the soundbar via HDMI ARC, as the screen has to be turned on while it's playing.

I'm attaching bubble's log and here are the steps I went through:
  • Switch to local renderer and enable logging.
  • Restart.
  • Go to renderers and select soundbar (HT-XT3)
  • Go to library and load a local flac file from internal storage
  • Now playing > pause > play > seek to 20% > seek to 70% > volume up > volume down > stop
  • Exit bubbleUpnp
  • Get log from phone  :))

I hope this helps. Thank you both for all you've done.

Re: UPnP MediaRenderer output | discussion

Reply #103
Thanks for the logs. Strangely it did not register the relevant requests in the wireshark log though...

Anyway, it turns out that my own Sony TV has a similar issue. I've done a thorough comparison of requests being sent, my code vs bubbleupnp, and beaten the TV into working.
For anyone interested in the details-
Apparently Sony devices require the following part of SOAP request to be set:
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

Beta 10 has been posted, Sony devices should now work.

<cue trolololo.mp3 playing on living room TV>

Re: UPnP MediaRenderer output | discussion

Reply #104
Sadly still a no-go on my Soundbar. It does work with the TV however.

On the TV:
  • is working in 16bit mode
  • title is stuck to foobar2000
  • no album art
  • album / artist show null
  • remote seekbar not synchronized
  • foobar volume control has no effect
  • 24bit mode - Unrecoverable playback error: UPnP device error: Action SetAVTransportURI failed (probably TV's limitation on formats)

On the soundbar:
  • initially properly wakes up the device and puts it in streaming mode
  • foobar volume control has no effect
  • both 16 and 24bit output modes result in "The file is corrupted or the music file is not supported" on the player's side
  • attached logs below

From the log I deduced that 44.1khz is served as PCM and 96khz is served as WAV - doesn't work.
Bubble controller chooses 24bit 96khz LPCM - works.
Sony's own streaming android controller Songpal (which is at the same time a buggy bloated mess) serves it as 24bit 96khz FLAC - works.
Afaik there are no streaming device profiles in foo_out_upnp. Is there any chance we can tell it to send the native format without transcoding?

Forgot to add: Browsing the foo_upnp server from the device properly selects the 96khz FLAC stream after I made a custom profile for the renderer and allowed higher resolution audio.

 

Re: UPnP MediaRenderer output | discussion

Reply #105
Thanks for the logs.

It looks like the Sony player at least understands some of our commands now, that's progress.

Have you been able to control volume with another app? It would be most useful to see wireshark logs, our unsuccessful volume control vs another app that works. About the logs, to make sure that relevant info is included, search the log (in notepad or alike) for User-Agent line that includes the name of the app that you're working with. Also narrowing down to TCP traffic only will exclude lots of stuff that we don't care about.

Other than that, it looks like they're trying to read our data stream and open more than one HTTP GET connection at once for some reason. We do not support this right now and opening another GET request before terminating the last one fails. I'll look into rewriting relevant part of the component to allow this.

Re: UPnP MediaRenderer output | discussion

Reply #106
Here is the dump. It's from windows' own Cast to device - fiddled with it's volume controls a bit.
You can find all the relevant info in the log.

EDIT1: Mute and Unmute is working fine from foo_upnp btw. Forgot to test it previously.
EDIT2: Monitoring in wireshark: moving the volume slider does not trigger any xml request or response to the player as opposed to muting.
EDIT3: It's most probably related to the volume slider. I created keyboard shortcuts for Vol up and down and they work. Could be a columns UI thing. Will clone my config and use the standard UI to test from now on.
EDIT4: Standard UI does not have a vol slider but has vol + / - buttons. They work but trigger a change every two clicks as the device only accepts even numbers up to 100 which translates to 100 on the TV and 50 on the soundbar. Talk about a pointless inconsistency.

Last EDIT: It seems the stream is the only remaining thing failing right now. I've attached the latest play attempt wireshark dump of just the soap communication XMLs.

Re: UPnP MediaRenderer output | discussion

Reply #107
any way to seemlessly transition from pc to android? it would be nice to be able to play music on my pc then switch to my android and back to pc without changing the output device.

ie: listening on pc, pick up my phone and play on bubble, then stop playback on bubble and it switches playback to primary sound on my pc

Re: UPnP MediaRenderer output | discussion

Reply #108
tested UPnP MediaRenderer output v1.0 beta 10 on foobar2000 v1.3.10 beta 2 with Kodi 16.0 (both on windows 7 64bit) --> does still not work, (no sound, after 4 seconds progress-bar stops)

any way to seemlessly transition from pc to android? it would be nice to be able to play music on my pc then switch to my android and back to pc without changing the output device.

ie: listening on pc, pick up my phone and play on bubble, then stop playback on bubble and it switches playback to primary sound on my pc
You can set keyboard shortcuts to the UPnP : output devices and DS : primary sounddriver. So you can switch nearly seamless between them.

Problem is, that when the UPnP device goes offline, the shortcut has to be set again, because name changes and it cannot be recognized. Any solution possible here?

Re: UPnP MediaRenderer output | discussion

Reply #109
Here is the dump. It's from windows' own Cast to device - fiddled with it's volume controls a bit.
You can find all the relevant info in the log.

EDIT1: Mute and Unmute is working fine from foo_upnp btw. Forgot to test it previously.
EDIT2: Monitoring in wireshark: moving the volume slider does not trigger any xml request or response to the player as opposed to muting.
EDIT3: It's most probably related to the volume slider. I created keyboard shortcuts for Vol up and down and they work. Could be a columns UI thing. Will clone my config and use the standard UI to test from now on.
EDIT4: Standard UI does not have a vol slider but has vol + / - buttons. They work but trigger a change every two clicks as the device only accepts even numbers up to 100 which translates to 100 on the TV and 50 on the soundbar. Talk about a pointless inconsistency.

Last EDIT: It seems the stream is the only remaining thing failing right now. I've attached the latest play attempt wireshark dump of just the soap communication XMLs.
Thanks for testing, this clears many mysterious issues.

I guess I owe you an explanation about the inconsistency of volume control between different UIs.
By design, foobar2000 originally supported slider style volume control operation. However, a slider makes it possible to accidentally max the volume out; with many UPnP devices this extremely undesirable. Hence at the point the UPnP output component was introduced (foobar2000 v1.2, 2012), foobar2000 architecture was extended to allow plus minus style volume control and disregard potentially dangerous slider input; existing menu commands & keyboard shortcuts to manipulate volume step by step are compatible with this scheme. However, any old user interfaces that present volume sliders will act erratically when UPnP output is selected and must be updated to detect plus/minus mode and show something else instead. All my UI components were updated at that time, I guess not all third parties have yet caught up with this change by now.

Re: UPnP MediaRenderer output | discussion

Reply #110
tested UPnP MediaRenderer output v1.0 beta 10 on foobar2000 v1.3.10 beta 2 with Kodi 16.0 (both on windows 7 64bit) --> does still not work, (no sound, after 4 seconds progress-bar stops)

(...)

You can set keyboard shortcuts to the UPnP : output devices and DS : primary sounddriver. So you can switch nearly seamless between them.

Problem is, that when the UPnP device goes offline, the shortcut has to be set again, because name changes and it cannot be recognized. Any solution possible here?

Re Kodi
Things should get better with beta 11 (coming soon). This component presents foobar2000's output as a live non-seekable stream, and cannot possibly behave 100% sanely if the renderer opens multiple connections - which unfortunately many renderers do. The solution until now has been to stall concurrent connections (broke Kodi badly, before beta 6), or to reply with 403 Denied (beta 6 and up). Since beta 11, I'm going to allow concurrent connections reading our data stream, and drop connections that lag behind, I'm hoping that this will properly fix Kodi as well as remaining Sony devices.

Re keyboard shortcuts
Problem acknowledged. Keyboard shortcuts require that the internal device ID remains unchanged; it is currently derived from device's URL on your network. I'll look into using something else that remains constant across device restarts. At least the current approach appears to work fine with Android/BubbleUPnP here.

Re: UPnP MediaRenderer output | discussion

Reply #111
Thanks for all the info Peter.
I tried beta11 and am getting the same Corrupted or Unsupported message on the device.
I'm wondering if I can somehow proxy the device so you can control it directly. Will experiment with l2tp on my router to see if I can open a proper tunnel.

On the other hand I think the performance of playing to the TV has increased with b11. It feels snappier now and commands seem to execute a bit faster for some reason. Could be my imagination tho.

See attached logs.

Re: UPnP MediaRenderer output | discussion

Reply #112
OK so it's not a concurrency problem after all, thanks for the logs.
They're accessing our stream 3 times yet refusing to play, there must be something wrong with the HTTP headers we give to them.

Regarding L2TP - thanks for the offer but no need to bother with that, I'm not yet out of other options, I'll get back to you with another version to test soon.

Re: UPnP MediaRenderer output | discussion

Reply #113
Beta 12:
Adjusted HTTP headers somewhat
Added an override to specifically prefer WAV over LPCM streaming, that might fix Sony which seems to hate our LPCM stream

Re: UPnP MediaRenderer output | discussion

Reply #114
beta12: again corrupted or unsupported format with both WAV and LPCM.
Also LPCM is working on the TV while WAV is not.

I did some more experiments with http://192.168.1.100:currentport/stream.wav
Playing wav url in opera: plays a few seconds and stops
Attempting to download stream: failed with reported file size 512 GB
Attempting to stream via Android VLC: plays a few seconds and stops.

I suppose the stream is cut because the device does not respond properly in time.
The stream is not interrupted while playing to the TV with the above methods.
Could it be that the renderer does not support endless streams and requires a size to be set in the metadata?

I also get ICMP port unreachable a lot in wireshark.

Re: UPnP MediaRenderer output | discussion

Reply #115
Same behaviour with beta 12 and Kodi.
Don't know if this helps: The "Playback Stream Capture" of foo_upnp by bubbleguuum works with Kodi
Since foo_upnp_out works perfect with another foobar2000 client maybe the problem is simply on Kodi side?


Re: UPnP MediaRenderer output | discussion

Reply #116
Beta 13 posted.

Re: Kodi
Further Kodi lag fixes have been added. During my tests I could no longer make it lag. It seems Kodi's user interface turns unresponsive as soon as the remote end of some UPnP operation is lagging. This is a pretty bad design and is bound to cause issues.

Re: Sony
HTTP headers have been tweaked some more.
WAV stream is now presented as 4GB not 512GB - the bad side is that playback will terminate after having transferred 4GB of data (a couple of hours depending of stream specification), but various software seems to prefer it this way.
LPCM stream is the preferred way - the only legitimate way to present an infinite-length stream. I added 3 alternate modes so we can find out which it is that Sony does not like: plain infinite-length but not chunked, infinite-length chunked and finite-length. I hope at least one of those works.

Additionally, I made our minimalist HTTP server continue to run after playback has been stopped, just to serve some 404 to anyone asking for our stream (so they don't run into a closed port); should address some more responsiveness issues.

Re: UPnP MediaRenderer output | discussion

Reply #117
Seems 13 is my lucky number! I'm extremely grateful Peter, bubbleguuum as well for helping from the sidelines.

Finite length fixed it immediately on the Sony HT-XT3.
Both WAV and LPCM work flawlessly in finite mode in both 16bit and 24bit output modes.
The device doesn't seem to like Chunked infinite and Plain infinite modes at all.

4GB sounds quite reasonable. It's around 25 tracks of around 4 minutes on high res so it's good.
Wouldn't that limitation be lifted if foo_out_upnp instructed the renderer at the end of the track to load the next one in the playlist (like what happens when we double click another track) and thus reset the starting stream position to the new track and tell the renderer to start the stream as if it's a new one? The header for length could be the actual playing track length in that case. Of course we would lose gapless playback but it might be worth it in some scenarios and would allow proper metadata for track fields.

EDIT: I've set playback thread priority to 7 in advanced settings but I'm getting some interrupt choppiness several times per track at random (both 16bit and 24bit output). Renderer is on a 100mbit lan connected via UTP cable (not wireless) - <1ms latency. Playing from a Quad core i7 2600k. When streaming from foo_upnp I don't have any hiccups.
I'll experiment with buffer levels to see if it can be alleviated with them.



Re: UPnP MediaRenderer output | discussion

Reply #118
Thanks for confirming Sony being fixed.

Beta 14 has been posted - fixed Linn not working regression, made Sony finite length fix applied by default.

As for choppyness, I doubt thread priority will have anything to do with it, I'll look into it.

Re: UPnP MediaRenderer output | discussion

Reply #119
I was just about to write "still not working" ... BUT  then I found the Advanced Preferences :-)
By selecting "Prefer WAV", UPnP Out to Kodi works perfectly! Maybe it worked already in earlier versions.

Also the keyboard shortcuts can be used with Kodi, because identifier stay the same.
So the problem is caused by foo_upnp Media "Renderer" (not "Server"). If it stops and starts again the shortcut is lost.

Anyway, thanks for the great work !!!

Re: UPnP MediaRenderer output | discussion

Reply #120
Beta 15:
Worked around 127.0.0.1 stream bug once again - hopefully properly this time.
Worked around more Kodi bugs.


Re LPCM not working with Kodi
Please clarify. I can't reproduce this issue, all LPCM scenarios work fine with Kodi here. What Kodi version are you using?

Re: UPnP MediaRenderer output | discussion

Reply #121
Kodi: found the problem is caused by the output data format (under preferences: output): with LPCM only 16-bit works.

Re: UPnP MediaRenderer output | discussion

Reply #122
Hi,

I was searching an alternative to Windows Media Player to stream music to my QED uPlay Stream device with my beloved Foobar2000. It wasn't long thanks to your component. Thank you very much. You can add QED uPlay Stream to successfull devices.

a+,=)
-=Finiderire=-

Configuration:
Hardware: QED uPlay Stream v01.00.04 configured in Wi-Fi
Operating System: Windows 10
Foobar2000 v1.3.10
Foobar2000 component: UPnP MediaRenderer Output v1.0 beta 15, released on 2016-03-24, configured as output 16-bit, default buffer size 1000ms.

Re: UPnP MediaRenderer output | discussion

Reply #123
Hi Folks I have this successfully sending a stream to my Samsung S5 mini smartphone using Bubble Upnp on the phone. I was previously using foo_upnp at the foobar end but for some reason it stopped working for me a while back so I'm glad this is working for me.

Is there any way we could add a feature to allow foobar to send audio to the local PC soundcard as well as the Upnp device at the same time? I'm not necessarily concerned about having these in perfect sync (i suspect having local and streamed playback in perfect sync would be v hard to do anyway) but it would be very handy to be able to stream to a Upnp client whilst having the PC speakers still playing music albeit with a few millieseconds of drift. Thanks again for an ace product.

Re: UPnP MediaRenderer output | discussion

Reply #124
I am using the UPnP Media Renderer Output component, the version 1.0 Beta 15 and I consistently get the following error the first time I try to play the first track after starting foobar and after selecting the DLNA Output in Preferences/Playback/Output... The error is: "Unrecoverable playback error: UPnP device error: launch receiver already in progress".

After I try to play again any track, there is no error anymore. So this only happens only once and immediately after I start my PC and Foobar and not anymore. Did anyone notice this?

Thank you!

 
SimplePortal 1.0.0 RC1 © 2008-2019