DLNA Media Controller plugin - Common library for UPnP AV

Great !

Downloaded and speed tested with my Sony Bluray HomeTheater. I have upnp proxy installed already (don’t know if it is a problem or not).

I can browse my Plex Media Library and send it to the Sony, work like a charm.

Trying to load URI http://broadcast.infomaniak.net/ouifm-high.mp3 to try webradio. It doesn’t work but need further investigation. Same for TTS.

I will try to find more time to test today.

BTW thank soooooo lot Lolodomo for this great work… with the Vera UI Limitation.

You’re the guy man !

Thanks for the effort you put into this!

[quote=“macfly92, post:141, topic:177228”]Great !

Downloaded and speed tested with my Sony Bluray HomeTheater. I have upnp proxy installed already (don’t know if it is a problem or not).[/quote]

It is not a problem, it is even required :slight_smile:

I can browse my Plex Media Library and send it to the Sony, work like a charm.
Trying to load URI http://broadcast.infomaniak.net/ouifm-high.mp3 to try webradio. It doesn't work but need further investigation. Same for TTS.

Either it does not accept http-get protocol (probably not the reason) or it does not support MP3 audio format through HTTP ?
Can you play a MP3 file from your Plex media library for example ? If you can, please check the metadata in the Help tab and more precisely the attribute “protocolInfo” of the “res” tag.

I will try to find more time to test today.

Including with your other Linux Media Renderer ?

Please don’t forget that all stuff relative to server browsing and playback was a last minute add-on and is not yet fully finished and tested.
For example, I have a playlist with RTSP links (Freebox TV channels) and I discovered that the URL I get from XBMC server are truncated it they include a “&”. So of course the playback fails. I have to investiguate to know if the truncate is due to me or to XBMC.
But if I try with the full RTSP URL, it works 8)

Ok here some more test :

Sony Bluray
Can be discovered
Can Play MP3 From my Plex Media Library
Can’t Load MP3 WebRadio… (working with bubble upnp, but it seem it can do a shoutcast proxy for the device don’t support it, need more test)
Status feedback seem to be working, I have full media description and Volume level feedback when I change the sound level.

Linux GMrender
Can’t be discovered but I filled the Device description URL and it worked.
Can play MP3 from Plex ML
Can load and play Webradio
TTS Work.
Status feedback doesn’t seem working. When I changed the Soundlevel, it work but the value doesn’t change on the UI.

Bubble Upnp (1.7.4) on a Nexus 7
Can’t be discovered but I filled the Device description URL and it worked.
Can read and set Volume Status but seem Bubble upnp have a Volume Value Between 0 and 15 so the slider doesn’t work properly.
Edit : Can play MP3 from Plex ML (was a server side problem)
Can Load and play Webradio
TTS work.

Here it is, I will post update as soon as I have some.

Thanks again man.

[quote=“macfly92, post:144, topic:177228”]Sony Bluray
Can be discovered
Can Play MP3 From my Plex Media Library
Can’t Load MP3 WebRadio… (working with bubble upnp, but it seem it can do a shoutcast proxy for the device don’t support it, need more test)
Status feedback seem to be working, I have full media description and Volume level feedback when I change the sound level.[/quote]

Play, pause, stop, mute controls from the Vera are working ?
Feedback of the playing state to the Vera when using Sony controls is working ?

Linux GMrender Can't be discovered but I filled the Device description URL and it worked. Can play MP3 from Plex ML Can load and play Webradio Status feedback doesn't seem working. When I changed the Soundlevel, it work but the value doesn't change on the UI.

Same for the state of play, pause, stop buttons (working but no feedback) ?
Either the event subscription failed (can you check for errors in the logs), or the notified event has an unexpected format (I should say a format not well interpreted by my code).
If there is no errors relative to event subscription, could you replace debug by log at line 858 in the I_DLNA…xml file and try again your volume change. Then provide the new logged line.

Regarding the discovery, is it discovered by Device Spy ?

Bubble Upnp on a Nexus 7 Can't be discovered but I filled the Device description URL and it worked. Can read and set Volume Status but seem Bubble upnp have a Volume Value Between 0 and 15 so the slider doesn't work properly. Seem (or not) I can load a MP3 from Plex ML because I see the metadata and picture loaded but nothing append when I hit play. (I just noticed I see Metadata on the Vera UI but not on the Bubble UI) Can Load and play Webradio TTS work.

Very strange that discovery is not working for you, while it is working for me (I use a Nexus too).
Don’t forget to push again the Discover button, because the selection box is not automatically updated.
And with BubbleUPnP, the UPnP device disappears after a certain time when the tablet is in standby.

Volume range is something provided by each vendor and can depend on the hardware. I can reproduce the problem with my Nexus tablet. The UI requires a pre-defined range, while this range cannot be known. So it is fixed in the UI to 0-100. We are constrained by a Vera UI limit. By the way, I am not reading the vendor specific value (but I could).

Rgearding the playback that doesn’t start, I am not sure to understand which play button you push…

For the Sony
Play, pause, stop, mute controls from the Vera are working → YES !
Feedback of the playing state to the Vera when using Sony controls is working ? → YES !
Seem the only problem is webradio, but I will investigate further to see capability.

Linux Renderer
All function works without return status … I will check the logs as soon as I can… Maybe the Linux software is not fully upnp compliant too…

Bubble UPNP
As I say in my previous edited post (bad thing, but I though you will be not so fast to respond :slight_smile: ), Plex ML problem is a server side problem, it is solved. Work fine !

For the Discovery thing, Yes I saw both Bubble UPNP and Linux Renderer with device spy. With it, I catch the Device description URL to put in your UI.
And yes, I hit several time the Discover button…
It seem I only Discover LAN devices with Vera UI (On LAN to)… not the Wireless devices. But the computer I used with upnp spy is in Ethernet and It discover LAN and Wifi devices. (and it is on the same switch than Vera).

Did you told us that you have change something in the Upnp Proxy Plugin ? (not sure … but I’m reminding something like this in this thread…)

I’m over-motivated to do more testing but I have some other Duty to do and my girlfriend is starting her Super Sayan Mutation :o :stuck_out_tongue: :wink: so I must go…

Be sure I’ll post update as soon as I can ! (if I’m already alive)

[quote=“macfly92, post:144, topic:177228”]Bubble Upnp (1.7.4) on a Nexus 7
Edit : Can play MP3 from Plex ML (was a server side problem)[/quote]

Ok, I prefer :wink: because it is working for me from XBMC to BubbleUPnP (including album art and media details).

[quote=“macfly92, post:146, topic:177228”]Linux Renderer
All function works without return status … I will check the logs as soon as I can… Maybe the Linux software is not fully upnp compliant too…[/quote]

So it is clarly the main problem to solve.

Maybe my plugin is not fully UPnP compliant too… :slight_smile:

How does it work with BubbleUPnP as a control point with Linux Renderer as renderer ?

For the Discovery thing, Yes I saw both Bubble UPNP and Linux Renderer with device spy. With it, I catch the Device description URL to put in your UI. And yes, I hit several time the Discover button... It seem I only Discover LAN devices with Vera UI (On LAN to)... not the Wireless devices. But the computer I used with upnp spy is in Ethernet and It discover LAN and Wifi devices. (and it is on the same switch than Vera).

Strange because my Nexus tablet is on Wifi too.

Did you told us that you have change something in the Upnp Proxy Plugin ? (not sure .. but I'm reminding something like this in this thread...)

No, finally, nothing was changed … as it works well.

I'm over-motivated to do more testing but I have some other Duty to do and my girlfriend is starting her Super Sayan Mutation :o :P ;) so I must go...

Be sure I’ll post update as soon as I can ! (if I’m already alive)

:slight_smile: :slight_smile:

Last thing … OMG I’m writting in secret :slight_smile:

It is what I got when I loaded a webradio with bubbleupnp to the Sony in the protocolinfo

http://192.168.0.11:57645/shoutcast/H4sIAAAAAAAAAMsoKSmw0tfPLTDWy8ksS9UrKdMtSkzJzNdLzs_VT85ILcpMjU_L1U_MyQHx4g2NTIwNDfSAygEiWdeWOQAAAA==.mp3

When I looked to the source URL, It seem bubble upnp do a shoutcast proxy because .11 is bubble upnp IP address.

:slight_smile:

It is what I got when I loaded a webradio with bubbleupnp to the Sony in the protocolinfo

http://192.168.0.11:57645/shoutcast/H4sIAAAAAAAAAMsoKSmw0tfPLTDWy8ksS9UrKdMtSkzJzNdLzs_VT85ILcpMjU_L1U_MyQHx4g2NTIwNDfSAygEiWdeWOQAAAA==.mp3

When I looked to the source URL, It seem bubble upnp do a shoutcast proxy because .11 is bubble upnp IP address.

As it works for XBMC, I checked (with Device Spy) which are the protocols supported by XBMC:
http-get::audio/mpegurl:
http-get::audio/mpeg:
http-get::audio/mpeg3:
http-get::audio/mp3:
One of these is probably required for a WEB radio.
Check what protocols you have for your Sony. You can find the GetProtocolInfo on the ConnectionManager service.

Regarding the UPnP discovery, I will provide a new part of code to test with “Test lua code”.
Maybe your Linux renderer is well discovered but then filtered by my current code.

There is what I get in protocolInfo from Sony device:
http-get::audio/L16:DLNA.ORG_PN=LPCM;DLNA.ORG_FLAGS=9d700000000000000000000000000000,
http-get:
:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_FLAGS=9d700000000000000000000000000000,
http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_FLAGS=9d700000000000000000000000000000

No MP3 … craps… sure it is why Bubble do a proxy… Maybe I can add a webradio to plex, because of it transcoding capability too…

[quote=“lolodomo, post:151, topic:177228”]Regarding the UPnP discovery, I will provide a new part of code to test with “Test lua code”.
Maybe your Linux renderer is well discovered but then filtered by my current code.[/quote]

Ready to test.

I also tried to put my Vera directly connected to my router, same effect.

[quote=“macfly92, post:152, topic:177228”]There is what I get in protocolInfo from Sony device:
http-get::audio/L16:DLNA.ORG_PN=LPCM;DLNA.ORG_FLAGS=9d700000000000000000000000000000,
http-get:
:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_FLAGS=9d700000000000000000000000000000,
http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_FLAGS=9d700000000000000000000000000000

No MP3 … craps… sure it is why Bubble do a proxy… Maybe I can add a webradio to plex, because of it transcoding capability too…[/quote]

No. The second line seems to be ok for a MP3 file.

[quote=“macfly92, post:152, topic:177228”][quote=“lolodomo, post:151, topic:177228”]Regarding the UPnP discovery, I will provide a new part of code to test with “Test lua code”.
Maybe your Linux renderer is well discovered but then filtered by my current code.[/quote]

Ready to test.

I also tried to put my Vera directly connected to my router, same effect.[/quote]

Please run the following code and tels me what it logs:

[code]
local socket = require(“socket”)

local UPNP_DISCOVERY = “M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\nMX: 5\r\nST: %s\r\n\r\n”

function UPnP_discover(target)
local devices = {}
local udp = socket.udp()
if (udp ~= nil) then
local result, message = udp:sendto(UPNP_DISCOVERY:format(target), “239.255.255.250”, 1900)
if (result ~= nil) then
udp:settimeout(5)
for i=1,500 do
result, message = udp:receivefrom()
if (result == nil) then
break
else
luup.log(“UPnP device discovered " … result)
local location, ip, port = result:match(”[Ll][Oo][Cc][Aa][Tt][Ii][Oo][Nn]:%s?(http://([%d%.]-):(%d+)/.-)\r\n")
local st = result:match(“[Ss][Tt]:%s?(.-)\r\n”)
if (location ~= nil and ip ~= nil and port ~= nil and st ~= nil) then
local new = true
for i,device in ipairs(devices) do
if (device.descriptionURL == location and device.st == st) then
new = false
break
end
end
if (new) then
table.insert(devices, { descriptionURL=location, ip=ip, port=port, st=st })
end
end
end
end
end
udp:close()
end
return devices
end

local devices = UPnP_discover("urn:schemas-upnp-org:device:MediaRenderer:1")
for i,dev in ipairs(devices) do

luup.log("Kept UPnP device " … dev.descriptionURL)
end[/code]

Seem to be more a broadcast problem or multicast between Lan and Wifi on my setup … I also tried to tweak some router setting but with no luck.

Here is the logs from your script :

50 11/10/13 18:11:26.459 luup_log:0: UPnP device discovered HTTP/1.1 200 OK
ST: urn:schemas-upnp-org:device:MediaRenderer:1
CACHE-CONTROL: max-age=900
EXT:
USN: uuid:6d2c6af5-8da1-4c54-bcb2-20fbe60f7362::urn:schemas-upnp-org:device:MediaRenderer:1
SERVER: Windows NT/5.0, UPnP/1.0, Intel CLR SDK/1.0
LOCATION: http://192.168.0.10:53594/
Content-Length: 0
This is a Media Render from Intel SDK that run on my LAN PC

<0x2db61680>
50 11/10/13 18:11:26.732 luup_log:0: UPnP device discovered HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
EXT:
LOCATION: http://192.168.0.90:52323/dmr.xml
SERVER: Linux/2.6 UPnP/1.0 Sony-BDV/2.0
ST: urn:schemas-upnp-org:device:MediaRenderer:1
USN: uuid:00000000-0000-1010-8000-544249199c7c::urn:schemas-upnp-org:device:MediaRenderer:1
X-AV-Physical-Unit-Info: pa=“BLU-RAY HOME THEATRE SYSTEM”;
X-AV-Server-Info: av=5.0; cn=“Sony Corporation”; mn=“BLU-RAY HOME THEATRE SYSTEM”; mv=“2.0”;
This is My Lan connected Sony Bluray

<0x2db61680>
50 11/10/13 18:11:28.156 luup_log:0: UPnP device discovered HTTP/1.1 200 OK
CACHE-CONTROL: max-age=100
EXT:
LOCATION: http://192.168.0.24:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:2f402f80-da50-11e1-9b23-001788103998
This is a Philips HUE Lights bridge … don’t know why it broadcast upnp. It appear 3 or 4 time in the script logs. It is connected by Ethernet too.

<0x2db61680>
50 11/10/13 18:11:28.605 luup_log:0: UPnP device discovered HTTP/1.1 200 OK
CACHE-CONTROL: max-age=100
DATE: Sun, 10 Nov 2013 17:11:28 GMT
EXT:
LOCATION: http://192.168.0.100:49494/description.xml
SERVER: Linux/3.5.0-23-generic, UPnP/1.0, Portable SDK for UPnP devices/1.6.6
X-User-Agent: redsonic
ST: urn:schemas-upnp-org:device:MediaRenderer:1
USN: uuid:GMediaRender-1_0-000-000-003::urn:schemas-upnp-org:device:MediaRenderer:1
And here … this is Same program used in my Wifi raspberry audio box, but running on My Lan connected Server. This one I can see it.

So I can discover only Lan thing …

A last test. Replace

    local devices = UPnP_discover("urn:schemas-upnp-org:device:MediaRenderer:1")

by

    local devices = UPnP_discover("upnp:rootdevice")

Be carreful, it will return a lot of devices.

Nop, more device but no Wifi Device at all. (Linux or Bubble tablet)
But the strange thing is that My PC with Upnp Spy in ethernet catch them all…

Not working Discovery for me is more annoying for Bubble Upnp, because it changing his port each boot time … GmediaRender not.
Do you know if there is a way to send a Discovery message to a specific IP ? maybe it will work better …
AV control work for those devices, so Direct connection seem to be working …

[quote=“macfly92, post:157, topic:177228”]Nop, more device but no Wifi Device at all. (Linux or Bubble tablet)
But the strange thing is that My PC with Upnp Spy in ethernet catch them all…

Not working Discovery for me is more annoying for Bubble Upnp, because it changing his port each boot time … GmediaRender not.
Do you know if there is a way to send a Discovery message to a specific IP ? maybe it will work better …
AV control work for those devices, so Direct connection seem to be working …[/quote]

Yes, there is a method for UPnP devices version 1.1, apparently not for UPnP devices version 1.0. I was not able to make it work with all my v1.0 devices.

Note that I created a special action for you (I should say for BubbleUPnP users). SearchAndSelectDMRDevice. It allows to search on your network a Media Renderer by its name and optionally its IP address, and if found select it automatically. But of course it relies on the regular UPnP discovery … that does not work for you :frowning:

Can we try to debug the last problem that could be a bug on my side: notifications not working with your Linux renderer ?

I’m sorry but I will not be able to test anymore this evening.

I promise you will have some feedback tomorrow in the morning on this thing !