Vera - Smarter Home Control Forum

Advanced => Plugins & Plugin Development => Programming => DLNA Media Controller plugin => Topic started by: lolodomo on October 06, 2013, 06:39:30 am

Title: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 06, 2013, 06:39:30 am
Plugin version 0.8 has been released.
You can download it here (ZIP archive at the bottom of this page): http://code.mios.com/trac/mios_dlna-cntroller/browser/tags/1.0


What's new in version 1.0:


What's new in version 0.8:


What's new in version 0.7:


What's new in version 0.6:


What's new in version 0.5:


What's new in version 0.4:

What's new in version 0.3:

What's new in version 0.2:

It is a classical installation, meaning you have to upload all the files with the Vera UI, except the PNG file that requires to be uploaded using WinSCP in directory /www/cmh/skins/default/icons/
Then create a new device using D_DLNAMediaController1.xml. Don't care about the IP. Restart LUA. When restarted, refresh your browser cache (Ctrl+F5). Then open the Settings tab to select your DMR, either using the UPnP discovery or filling in the UPnP device description URL. Wait few seconds until the setup is done and that's all, you can now open the Player tab.

Automatic discovery (UPnP discovery) could require an additional setup of your Vera Lite. Please read the explanations in this message if it does not work directly: ​http://forum.micasaverde.com/index.php/topic,16905.msg132502.html#msg132502

Known issues:
Title: Re: Common library and services for UPnP control
Post by: garrettwp on October 06, 2013, 08:15:26 am
Squeezebox plugin doesn't use upnp, it uses the telnet service of the squeezebox server. I'll look into seeing if it can support upnp.

- Garrett

Title: Re: Common library and services for UPnP control
Post by: RichardTSchaefer on October 06, 2013, 10:42:36 am
With this done ... how far from making Vera a DLNA Media Controller that can control any DLNA Media Server and Player ?
 

Title: Re: Common library and services for UPnP control
Post by: futzle on October 06, 2013, 04:59:58 pm
A UPnP controller library is a natural next step.  I sort of had it in the back of my mind when I was writing the WeMo code, so it's sort of broken into platform-dependent functions and platform-independent functions.  I've got absolutely no time to commit to it, though, but I'll gladly donate any code that I've already written to the cause.
Title: Re: Common library and services for UPnP control
Post by: lolodomo on October 07, 2013, 05:44:13 am
With this done ... how far from making Vera a DLNA Media Controller that can control any DLNA Media Server and Player ?

A UPnP AV / DLNA Media Controller would require 3 items:
- UPnP discovery of UPnP AV Media servers and UPnP AV Media renderer: - this is not implemented and may be bot easy from Vera (I don't know)
- Browse media on UPnP AV Media servers: this is more a user manual task and something that requires a good UI. Vera is not really a good choice for this task
- Send a media to a UPnP AV Media Renderer: this is typically what we can do with Vera.

Unfortunately, it exists a lot of UPnP AV Media Player (Playstation PS3, Freebox Player, some TV, some DVD and BR players, ...) but only few UPnP AV Media Renderers. Media Player don't provide UPnP interface for remote control by a Control Point. After a quick WEB search, the candidates for a control by a control point would be only:
- XBMC
- Windows Media Player/Connect
- BubbleUPnP (Android)
- Sonos

So, I can make a generic plugin for these few Media Renderers (XBMC and WMP).

PS: finally XBMC seems to not be a UPnP Media Server, there is no browse capability exposed to UPnP. It is a Media Player + Media Renderer.
PS2: Sonos is a Media Server + Media Renderer
Title: Re: Common library and services for UPnP control
Post by: lolodomo on October 07, 2013, 05:48:02 am
One problem to make something generic is that every device implements its own subset of UPnP AV services. This can be retrieved from the description (XML) file. With Vera, we are constrained by statically declared services.
And I even not sure that in Vera we can hevae different services with the same service type/id ?
Does DLNA defines standard services (AVTransport, RenderingControl, ...) ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 06:02:19 am
On the DLNA Web site, we can serarch for certified DLNA products.
It look slike the Xbox 360 is a Media Renderer. So it could be probably controlled from the Vera too.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 06:05:51 am
Regarding BubbleUPnP: https://play.google.com/store/apps/details?id=com.bubblesoft.android.bubbleupnp&hl=fr
Quote
BubbleUPnP is a full featured UPnP/DLNA Control Point, UPnP Media Renderer and UPnP Media Server

So it is a new candidate.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 06:07:10 am
Updated list of UPnP AV Media Renderers:
- Xbox 360
- XBMC
- Windows Media Player/Connect
- BubbleUPnP (Android)
- Sonos

On Wikipedia, we can find the list of UPnP media render hardware: http://en.wikipedia.org/wiki/List_of_UPnP_AV_media_servers_and_clients
This list includes Sonos and Xbox 360. But it seems that this list includes few products that are only Media Player without ability to control by a remote control point, like for example "Panasonic Plasma Viera NeoPDP V10-Series". I will check again this evening.
So I am sure that the list in Wikipedia makes a clear distinction between Media Player and Media Renderer.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 06:22:51 am
Do you think that browsing UPnP Media Server from the Vera could be of any real interest ?
Through actions ?
Through UI ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 07:07:19 am
Regarding UPnP AV standards, we can find all services here: http://upnp.org/index.php/sdcps-and-certification/standards/sdcps/
So we could define the 4 different versions of AVTransport service for example.
But if I take Sonos example, it does not use the standard, Sonos add additional actions to the AVTransport:1 service.

So if we want something as generic as possible, we use the standards as services, but in this case, we could loose some actions really provided by certain UPnP devices.

Here are ideas:
- we could have a generic UPnP AV controller plugin, based on UPnP AV standards services.
- For Sonos plugin (example), we would define additional services, like Sonos_AVTransport:1 that will contain specific actions and state variables defined by Sonos that are not in the UPnP AV standards.

Other point: few URL are currently hardcoded, while they should be extracted from the description file, like control URL or event URL. But without UPnP discovery implementation, that would require that the user provides the URL for the XML device description file.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: RichardTSchaefer on October 07, 2013, 08:29:17 am
We might need layers of shared components. I think it would be good to have components that match the standards where they are defined ... with a specialization layer that customizes for some specific devices. This would allow continued development to someday get to a DLNA controller.

On the other hand Vera App store provides no support for handling/managing/enforcing the dependencies between shared components.
It will not allow us to maintain the files as components and replicate in a plugin ... it enforces that ALL file names are unique across all plugins.

I have a shared evaluation engine between PLEG and PLTS in an invisible plugin called PLC. This is very confusing for users to have a plugin that has no devices on the UI ... and then of course they have the problem of making sure all components have compatible versions ...
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 10:40:29 am
I could first create a generic plugin UPnP_AV_DMC, defining and implementing standard UPnP AV services. This plugin should be ok to control basically any existing UPnP DMR.
This generic plugin would become a template for any specific DMC plugin, like Sonos or XBMC for example.
A specific DMC plugin would allow to add non standard features. It will consist in:
- defining new dedicated services for non standard actions and state variables
- implementing some of the standard services actions and dedicated services
- using the generic plugin library for the standard stuff
- adding specific code, including UI, for the non standard stuff

The generic plugin would include:
1 - a common library for UPnP:  the current L_Sonos1.lua library + additional utility functions relative to UPnP proxy event plugin; a check has to be done to WeMo plugin for UPnP request code, in case it is better handled in WeMo plugin.
2 - a common library for standard UPnP AV with all standard actions implemented
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: guessed on October 07, 2013, 12:56:58 pm
Regarding UPnP AV standards, we can find all services here: http://upnp.org/index.php/sdcps-and-certification/standards/sdcps/
So we could define the 4 different versions of AVTransport service for example.
But if I take Sonos example, it does not use the standard, Sonos add additional actions to the AVTransport:1 service.
It's part of the [UPnP] standard to permit "extensions", and these (both state and action) are permitted to live within the existing Service files (but these must be downloadable/discoverable from the Device.  These are logically in the same namespace, so putting them into separate/special S_ files, in addition to the standard/baseline ones, might cause havoc on the declarations in the corresponding D_*.xml files

This is why I checked in the Sonos ones as S_Sonos*.xml, which also avoids NS collisions.

Technically, and with a little work, these could be dynamically downloaded/stored as required.  They'd likely end up with odd-looking names, but it would then be possible to code-gen the wrappers using (a derivative of) L_Sonos.lua

This is functionality that's supposed to be in Vera, but has never really worked.

Anyhow, given there aren't that many things that folks want to control, and it's not too hard to do the important ones by hand.  The hard part here is that Vera lacks a dependency system.  These could readily be packaged into a Lib (plus related files) but we'd be left without a mechanism to indicate that "Plugin X requires Lib Y" from the App Store.

There would also need to be a LOT more thought given to compatible changes over time.


On Squeezebox...
The original Sonos plugin had several things done to it to support a UPnP interface to SqueezeBox, at the [PM] request of 'Ap.  Not sure that the validation was ever done though.

On L_Sonos.lua...
The one thing I should have done when I originally wrote this is to extract out the "Connection" level information, into a connection object, and then have the service-level objects require that.  It wouldn't be a hard change to make, and I'd make it before broadening the usage of this lib, since there are other "things" that need the connection also.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 02:07:19 pm
A usual, you break my enthousiasm :) If I listen to you, I just do nothing because the ideal cannot be reached (due to MCV implementaition or bugs) :)
My idea is more to do what is possible to do with what we have. And I think there is now place for a generic UPnP AV Media Control plugin.

Ok, we keep a full service file for each specific UPnP device. I just discovered that they can be easily retrieved from one URL displayed by Device Spy. No need to create the file manually.
I can at least create the standard services for the generic UPnP device.

Technically, what I want to improove is at least get device supported services from the device description file and then filter these services to keep only the services having a service type defined in the D_xxx.xml file. Then I will automatically initialize in the plugin code a service (call to upnp.service) for these services. Is it possible with lua to go through the services attached to a device ? Edit: function device_supports_service should help me.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: guessed on October 07, 2013, 02:35:06 pm
Not my intent to put you off, just to ensure that you're aware of the UPnP ruleset, vs what MCV has done...  mostly to avoid problems down the line (where we assume that the MCV [UPnP rules were correct, and box ourselves into a corner)...  This is easy to do, since they often don't validate stuff.

Quote
Ok, we keep a full service file for each specific UPnP device. I just discovered that they can be easily retrieved from one URL displayed by Device Spy. No need to create the file manually.
Yup, that's what I was referring to when I said you could do it dynamically.  Each UPnP endpoint provides a way to retrieve these, and they could be stored locally, using locally-derived names, as needed.  The rest would have to be code-gen'd, but again, not mission impossible (I tried this some time back in the SQ stuff, in UI4, but it should work better in UI5)

Quote
Is it possible with lua to go through the services attached to a device ?
There's a method to "ask" if a Device supports a service, not enumerate them, but I've never tried it:
    http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_device_supports_service

Worst case, it's always possible to derive since the I_*.xml stuff gets code-gen'd into fns.  You can likely grab hold of the fn table from inside of Lua, and then just enum it (again, haven't tried, but lots of stuff like this is exposed in Lua, so there's a lot of hacking potential).  The names of the code-gen'd stuff follow the Service/Action names with a reasonable pattern (a bit lossy).

... On a related note, I've always wondered if this technique can be used to dynamically inject methods [at startup, etc] into the runtime map of an I_*.xml, so that you could do the type of thing really needed....  just haven't had the time to play with that (or inclination, since I'll eventually move off Vera, it's just my prototyping platform).

I suspect the Service validations, added in UI5, would get a little in the way if it were tried.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 07, 2013, 03:34:43 pm
Quote
Is it possible with lua to go through the services attached to a device ?
There's a method to "ask" if a Device supports a service, not enumerate them, but I've never tried it:
    http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_device_supports_service

This function does not eexactly what I expect because it returns true if you have a variable of a certain service id set for the device, even if this service is not declared in the D_xxx.xml file.
You could say that it might not normal to be in such a case. Maybe something to change in the Sonos plugin.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 09, 2013, 10:03:41 am
Regarding UPnP AV standards, we can find all services here: http://upnp.org/index.php/sdcps-and-certification/standards/sdcps/

I see there are 4 versions of MediaServer and MediaRenderer.
Are they all used today ? Or is almost everybody using MediaServer:1 and MediaRenderer:1 ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 09, 2013, 10:58:20 am
Just for Info if it can help, My Sony Amp Media Renderer and my Raspberry Media Renderer both use MediaRenderer:1 service

I just realize I reply to your other thread about XBMC (http://forum.micasaverde.com/index.php/topic,16879.msg130899.html#msg130899) while my post probably must be here ....
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 10, 2013, 07:36:06 am
My initial idea to control XBMC through UPnP has quickly evolved in a more general plugin that I could name "DLNA Media Renderer Controller". It should work with any DLNA Digital Media Renderer.
I will add some settings presets to help final users selecting the settings for certain usual DMR like XBMC, Windows Media Connect, BubbleUPnP, ...
If you can provide the URL of the XML description file of your specific DMR, I can add a preset for it. And the description file itself would be appreciated too.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 10, 2013, 01:43:50 pm
Your initial idea was cool, but your evolv is great  ;D

Ok if I don't missunderstood your request, this is the description of my renderers and a link for the service description xmls grab with Device Spy:

First is GMrender Resurect. This is a Linux shell apps that listen uPnp Request and play Media. (Actually installed on a Raspberry Pi).

Device Description URL : http://192.168.0.123:49494/description.xml
description.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_description.xml)

Base URL   http://192.168.0.123:49494/
Device icon   Present, 128x128
Device URN   urn:schemas-upnp-org:device:MediaRenderer:1
Embedded devices   0
Expiration timeout   100
Friendly name   SalleDeBain
Has presentation   True
Manufacturer URL   http://github.com/hzeller/gmrender-resurrect
Model description   gmediarender 0.0.7-git
Model name   gmediarender
Model number   2013-09-07_9bcc832
Model URL   http://github.com/hzeller/gmrender-resurrect
Presentation URL   http://192.168.0.123:49494/
Product code   
Proprietary type   
Remote endpoint   192.168.0.123:49494
Serial number   
Services   3
Standard type   
Unique device name   GMediaRender-1_0-000-000-002
Version   1.0

Link to services URL, and xml link :

Methods   12
Parent presentation URL   http://192.168.0.123:49494/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:AVTransport
Service URL   http://192.168.0.123:49494/upnp/rendertransportSCPD.xml
State variables   30
Version   1.0
rendertransportSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_rendertransportSCPD.xml)

Methods   21
Parent presentation URL   http://192.168.0.123:49494/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:RenderingControl
Service URL   http://192.168.0.123:49494/upnp/rendercontrolSCPD.xml
State variables   21
Version   1.0
rendercontrolSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_rendercontrolSCPD.xml)

Methods   4
Parent presentation URL   http://192.168.0.123:49494/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:ConnectionManager
Service URL   http://192.168.0.123:49494/upnp/renderconnmgrSCPD.xml
State variables   10
Version   1.0
renderconnmgrSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_renderconnmgrSCPD.xml)


Second is a SONY Blu-ray HomeTheatre :

Device Description URL : http://192.168.0.90:52323/dmr.xml
dmr.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_dmr.xml)

Base URL   http://192.168.0.90:52323/
Device icon   Present, 48x48
Device URN   urn:schemas-upnp-org:device:MediaRenderer:1
Embedded devices   0
Expiration timeout   1800
Friendly name   BLU-RAY HOME THEATRE SYSTEM
Has presentation   True
Interface to host   192.168.0.10
Manufacturer   Sony Corporation
Manufacturer URL   http://www.sony.net/
Model description   
Model name   BDV
Model number   
Presentation URL   http://192.168.0.90:52323/
Product code   
Proprietary type   
Remote endpoint   192.168.0.90:52323
Serial number   
Services   5
Standard type   
Unique device name   00000000-0000-1010-8000-544249199c7c
Version   1.0

Link to services URL, and xml link :

Methods   15
Parent presentation URL   http://192.168.0.90:52323/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:AVTransport
Service URL   http://192.168.0.90:52323/AVTransportSCPD.xml
State variables   33
Version   1.0
AVTransportSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_AVTransportSCPD.xml)

Methods   6
Parent presentation URL   http://192.168.0.90:52323/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:RenderingControl
Service URL   http://192.168.0.90:52323/RenderingControlBdvSCPD.xml
State variables   7
Version   1.0
RenderingControlBdvSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_RenderingControlBdvSCPD.xml)

Methods   3
Parent presentation URL   http://192.168.0.90:52323/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:ConnectionManager
Service URL   http://192.168.0.90:52323/ConnectionManagerSCPD.xml
State variables   10
Version   1.0
ConnectionManagerSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_ConnectionManagerSCPD.xml)


If I can provide any other help or beta test, please let me know !

Thanks.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 10, 2013, 01:55:01 pm
Your initial idea was cool, but your evolv is great  ;D

Ok if I don't missunderstood your request, this is the description of my renderers and a link for the service description xmls grab with Device Spy:

In fact, what I need is the URL of the device description file. It is the URL opened when you request menu "Get Device XML" in Device Spy.

PS: it is something normally provided by the UPnP discovry process...
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 10, 2013, 02:06:21 pm
Oww Ok, I edited my first post with the Device XML

Merci !
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 07:45:24 am
I tested with Windows Media Player and BubbleUPnP renderers this morning and I encountered problems.

I switch to technical discussion. Help is welcome.

Event subscription is working for Windows Media Player and BubbleUPnP.

Problem with Windows Media Player, variables AVTransportURI, AVTransportURIMetaData and CurrentTrackURI are set to "" ! Is it compliant with the UPnP AV standard ?

Problem with BubbleUPnP, value for AVTransportURIMetaData has some characters replaced by code, for example I got &#60; rather than < and &#62; rather than >. I can fix that problem.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 08:12:36 am
With Windows Media Player and BubbleUPnP, the UPnP request systematically failed with the HTTP code 415. This error code means I am using a bad format ! Two possibilities:
1 - the XML sent is not standard. The XML model is defined by the variable UPNP_REQUEST in L_Sonos1.lua. I see nothing choking.
2 - the content type is not right. In L_Sonos1.lua, it is set by default to "application/x-www-form-urlencoded". I tried with "application/xml" and "text/xml" with no success. What value has to be used ?

SOLVED.
I got my answer checking futzle's code in WeMo plugin. She uses text/xml; charset="utf-8" as content type and bingo it works with Windows Media Player and XBMC. I will check with Sonos and BubbleUPnP too and if it works, I will set this content type as new default in L_Sonos1.lua.
Edit:  and it is what is defined by the standard.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: garrettwp on October 13, 2013, 08:27:05 am
Glad to see you are making progress.

- Garrett

Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 09:04:34 am
New specific problem with BubbleUPnP: UPnP request failed with code 401 and this description: No action by that name at this service. Missing SOAP action header.
I got the same error whatever the action.
Of course, the "Pause" action exists and I can run it through Device Spy.

Here is what is sent:

Code: [Select]
UPnP_request: url=[http://192.168.1.15:42316/dev/b4e54b11-54bc-7162-ffff-ffffdee3b0aa/svc/upnp-org/AVTransport/action], body=[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:Pause>
</s:Body>
</s:Envelope>] <0x302de680>

Any idea what could be wrong ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 09:20:40 am
Other problem with Windows Media Player, I cannot request UPnP for RenderingControl. I got an error code 402 and the following description: Invalid Args

Here is my request:
Code: [Select]
50      10/13/13 15:16:54.936   luup_log:446: XBMC: UPnP_request: url=[http://192.168.1.16:2869/upnphost/udhisapi.dll?control=uuid:1cbdde94-4e1f-442c-9613-298d0aec799f+urn:upnp-org:serviceId:RenderingControl], body=[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><DesiredMute>1</DesiredMute><Channel>Master</Channel></u:SetMute>
</s:Body>
</s:Envelope>] <0x2f71a680>
I got the same error with SetVolume.

I see nothing wrong.

Is the order of arguments important ? I mean, should I put in my request Channel before DesiredMute ?
What says the standard about that ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 13, 2013, 10:46:47 am
New specific problem with BubbleUPnP: UPnP request failed with code 401 and this description: No action by that name at this service. Missing SOAP action header.
I got the same error whatever the action.
Of course, the "Pause" action exists and I can run it through Device Spy.

Here is what is sent:

Code: [Select]
UPnP_request: url=[http://192.168.1.15:42316/dev/b4e54b11-54bc-7162-ffff-ffffdee3b0aa/svc/upnp-org/AVTransport/action], body=[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:Pause>
</s:Body>
</s:Envelope>] <0x302de680>

Any idea what could be wrong ?

The only difference I can see between your exemple and when I invoked this action with upnp spy is under the envelope opening tag : In Spy, s:encodingStyle is before xmlns:s ... I don't know if it change something or not ... But maybe it is the same problem than your second question : Is the order of arguments count ?


POST /dev/88dc63c0-34c9-8eb5-ffff-ffffb33991ec/svc/upnp-org/AVTransport/action HTTP/1.1
HOST: 192.168.xx.xx:47800
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Pause"
CONTENT-TYPE: text/xml ; charset="utf-8"
Content-Length: 331

<?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:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
         <InstanceID>0</InstanceID>
      </u:Pause>
   </s:Body>
</s:Envelope>
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 10:57:01 am
How do you see the SOAP message with Device Spy ?

Yes the order is required by the standard and this is a major problem with the vera already discovered by others in the past. The way we manage things cannot guarantee the good order. I have to do it differently.
While I was reading the spec, I got confirmation that only in parameters have to be passed. I will fix that in Sonos plugin.

I will try to inverse the two tags as you propose.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 13, 2013, 11:05:24 am
Other problem with Windows Media Player, I cannot request UPnP for RenderingControl. I got an error code 402 and the following description: Invalid Args

Here is my request:
Code: [Select]
50      10/13/13 15:16:54.936   luup_log:446: XBMC: UPnP_request: url=[http://192.168.1.16:2869/upnphost/udhisapi.dll?control=uuid:1cbdde94-4e1f-442c-9613-298d0aec799f+urn:upnp-org:serviceId:RenderingControl], body=[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><DesiredMute>1</DesiredMute><Channel>Master</Channel></u:SetMute>
</s:Body>
</s:Envelope>] <0x2f71a680>
I got the same error with SetVolume.

I see nothing wrong.

Is the order of arguments important ? I mean, should I put in my request Channel before DesiredMute ?
What says the standard about that ?

For this question and after what I'm able to test, I don't think arguments orders is important :

I managed to get my GmediaRender working with the help of this thread : http://forum.micasaverde.com/index.php?topic=10220.0

And using this LUA test code :

local lul_arguments = {}
lul_arguments["InstanceID"] = 0
lul_arguments["DesiredMute"] = "1"
lul_arguments["Channel"] = "Master"
lul_resultcode, lul_resultstring, lul_job, lul_returnarguments = luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetMute", lul_arguments, 37)

 ... produce same result than this one :

local lul_arguments = {}
lul_arguments["InstanceID"] = 0
lul_arguments["Channel"] = "Master"
lul_arguments["DesiredMute"] = "1"
lul_resultcode, lul_resultstring, lul_job, lul_returnarguments = luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetMute", lul_arguments, 37)

A good old working mutting command :)

But I know you do things with a different way, so I'm not sure if it help...

Desole de ne pouvoir aider plus ! Courage !
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 13, 2013, 11:13:04 am
How do you see the SOAP message with Device Spy ?

Yes the order is required by the standard and this is a major problem with the vera already discovered by others in the past. The way we manage things cannot guarantee the good order. I have to do it differently.
While I was reading the spec, I got confirmation that only in parameters have to be passed. I will fix that in Sonos plugin.

I will try to inverse the two tags as you propose.

Woot ! I can help :) To see SOAP message with Spy :

Right click on Pause in AV Transport -> Invok Action -> Hit Invok Button, then RIGHT CLICK on Invok Button and click on "Show Packet Capture" or F12

You will see the request and the Ack of the renderer.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 01:33:09 pm
Unfortunately, I confirm that the order is important for certain UPnP devices. I made a quick and dirty patch to have InstanceID before Channel and Channel before others arguments, and now SetMute and SetVolume are working to control Windows Media Player.
If it worked before for Sonos and XBMC with a wrong order is just because these devices certainly allow any order for arguments, even if the UPnP AV standard requests to use the order defined by the service.
The way UPnP request is done in Sonos makes impossibile to manage a right order. I have to switch to something similar to what has done futzle in WeMo plugin, that is providing an ordered table as parameter.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 01:56:26 pm
How do you see the SOAP message with Device Spy ?

Yes the order is required by the standard and this is a major problem with the vera already discovered by others in the past. The way we manage things cannot guarantee the good order. I have to do it differently.
While I was reading the spec, I got confirmation that only in parameters have to be passed. I will fix that in Sonos plugin.

I will try to inverse the two tags as you propose.

Woot ! I can help :) To see SOAP message with Spy :

Right click on Pause in AV Transport -> Invok Action -> Hit Invok Button, then RIGHT CLICK on Invok Button and click on "Show Packet Capture" or F12

You will see the request and the Ack of the renderer.

Thank you a lot, it will certainly help me a lot.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 03:16:16 pm
New specific problem with BubbleUPnP: UPnP request failed with code 401 and this description: No action by that name at this service. Missing SOAP action header.
I got the same error whatever the action.
Of course, the "Pause" action exists and I can run it through Device Spy.

Here is what is sent:

Code: [Select]
UPnP_request: url=[http://192.168.1.15:42316/dev/b4e54b11-54bc-7162-ffff-ffffdee3b0aa/svc/upnp-org/AVTransport/action], body=[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID></u:Pause>
</s:Body>
</s:Envelope>] <0x302de680>

Any idea what could be wrong ?

The only difference I can see between your exemple and when I invoked this action with upnp spy is under the envelope opening tag : In Spy, s:encodingStyle is before xmlns:s ... I don't know if it change something or not ... But maybe it is the same problem than your second question : Is the order of arguments count ?


POST /dev/88dc63c0-34c9-8eb5-ffff-ffffb33991ec/svc/upnp-org/AVTransport/action HTTP/1.1
HOST: 192.168.xx.xx:47800
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#Pause"
CONTENT-TYPE: text/xml ; charset="utf-8"
Content-Length: 331

<?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:Pause xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
         <InstanceID>0</InstanceID>
      </u:Pause>
   </s:Body>
</s:Envelope>

I found the explanation. We were not surrounding the SOAPACTION with " in the header.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 13, 2013, 04:05:29 pm
I summarize the work/discovery of the week-end:

PS: One problem with BubbleUPnP is that the port to be used always change when you restart the application.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: fhreid on October 13, 2013, 04:20:35 pm
That's awesome..  Keep up the good work!
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 13, 2013, 04:22:26 pm
I summarize the work/discovery of the week-end:
  • I fixed few things relative to the way UPnP action is requested in the Sonos plugin, in order to be more compliant with the UPnP specification.
  • A major problem has been discovered, relative to the order of arguments when requesting an UPnP action. I just implemented a dirty and temporary patch to be able to use SetMute and SetVolume
  • With few things still hardcoded, I am now able to control (basic commands - play, stop, pause, mute, volume) the following Media Renderers: XBMC, Windows Media Player and BubbleUPnP

PS: One problem with BubbleUPnP is that the port to be used always change when you restart the application.

For Bubble Upnp I've seen the same problem, I think unfortunately getting the port is a part of uPnP discovery method ... so we can't blame it...

anyway it is very great work, keep going man !
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: futzle on October 13, 2013, 05:26:17 pm
Great work, lolodomo. It amazes me how fragile most UPnP implementations are. (Well, not really, *cough*Onkyo*cough*.)  I recall hitting several of the issues you encountered as I was writing the WeMo code. It accounts for some of the odd design decisions such as ordered lists of parameter names and values. If only Lua had an order-preserving hash structure...

I'm way out of my depth with respect to the UPnP transport and media discussion. You lot are managing fine without me, so carry on.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 14, 2013, 10:18:23 am
For Bubble Upnp I've seen the same problem, I think unfortunately getting the port is a part of uPnP discovery method ... so we can't blame it...

Absolutely.

@futzle, @guessed: any idea if we could iimplement the UPnP discovery code ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: guessed on October 14, 2013, 12:18:09 pm
It's doable.  Would likely need to be in a freestanding (non Vera) codebase, like @futzle's codebase, for flexibility but the components are all there.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 14, 2013, 01:12:35 pm
It's doable.  Would likely need to be in a freestanding (non Vera) codebase, like @futzle's codebase, for flexibility but the components are all there.

Mhhh it's very interesting thing ... maybe we must think again on the concept.

What do you think about a Little program in Java (for ex.) running in daemon, that do Upnp Controller's work and provide to each other component (Vera, Openremote and other) an Json API ....

It must be pretty doable with the famous Cling Library (http://4thline.org/projects/cling/) ...

I think it will be more flexible, more "standardized  method" (more software are compatibles with REST method...) and without Vera restriction and overload ...

I will look forward into it, but i'm very far of an appkiller developer ... or maybe someone know if something like this already exist ?
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: garrettwp on October 14, 2013, 01:19:16 pm
You have to release that the programming languages on Vera are very limited. You are pretty much restricted to using lua with out installing other software dependencies.

- Garrett
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 14, 2013, 01:30:48 pm
Sure about that, but I'm talking about a software that can running on another computer to help Vera (and other in the same time) to handle Media oriented upnp...

It can be your MediaServer or a little Raspberry Pi or something like this.

Not a vera Plugin, but a Vera companion :) but It's true it's going away from the vera plugin concept ...
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: guessed on October 14, 2013, 01:41:09 pm
That's certainly one style of integration, but once you do that you might a well dump Vera altogether (apart from, say, lock support) since you'd end up running both devices.

If you're interested in that type of thing, check out the OpenHAB project.  Just haven't had enough time to cutover yet, runs on Raspi, Mac, etc... And there are a few other Arm based devices getting Java also, with a bunch if RAM so should get interesting in next 6mth of so.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 14, 2013, 03:58:40 pm
OpenHab look very interesting, thank you for the link I will take a look !
But sorry to turn away this thread, let's talk upnp !

Lolodomo, i'm so sorry to don't have enough skill to help you little more ...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: chixxi on October 17, 2013, 01:53:20 am
This is far over my level of experience with upnp and general coding, therfore I want be able to contribute a lot. Very cool project, keep it up!

Is this only going to be able to send commands or will it also be able to report states back to vera?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 17, 2013, 01:55:26 am
I have now fixed the problem of arguments order when requesting a UPnP action.
I created a UPnP utility library that I can share between this new plugin and the Sonos plugin. This library is an extent to the Sonos library, fixing few things and adding stuff relative to the management of the UPnP proxy event.

The next steps:
- create a DLNA utility library that I could share between this new plugin and the Sonos plugin
- improve the extact of media information to make it as generic as possible
- adapt the Player tab
- test all the different Media Renderer controls (the ones I have not yet checked), in particular the SetAVTransportURI

When ready, I will release a first version for the DLNA Media Renderer Controller plugin + a new beta version for the Sonos plugin.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 17, 2013, 01:59:59 am
Is this only going to be able to send commands or will it also be able to report states back to vera?

It will allow to send commands and to be informed of updates done by other controllers.

If by "report states", you mean Vera triggers, currently there is only one trigger defined relative to the playing state (play, pause, stop, ...). But we could imagine other triggers. You can propose...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 17, 2013, 02:02:22 am
This is far over my level of experience with upnp and general coding, therfore I want be able to contribute a lot. Very cool project, keep it up!

You will use it to control which Media Renderers ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 17, 2013, 03:11:33 am
I have now fixed the problem of arguments order when requesting a UPnP action.
I created a UPnP utility library that I can share between this new plugin and the Sonos plugin. This library is an extent to the Sonos library, fixing few things and adding stuff relative to the management of the UPnP proxy event.

The next steps:
- create a DLNA utility library that I could share between this new plugin and the Sonos plugin
- improve the extact of media information to make it as generic as possible
- adapt the Player tab
- test all the different Media Renderer controls (the ones I have not yet checked), in particular the SetAVTransportURI

When ready, I will release a first version for the DLNA Media Renderer Controller plugin + a new beta version for the Sonos plugin.

Great news Lolodomo !

Do you think the upnp proxy event can do the trick of discovery ? especially our port discovery thing ? or only reporting status ? I'm planning to try to set up a DIY HA Alarm clock with a little Android pad. I will propably use Bubble upnp to play music at the wake up time ... and modifying Vera's config each time I reboot the pad to manage the bubble random port setting will be very annoying...

For the SetAVTransportURI part, I'm able to invok command succefully with upnp spy to my GMediarender on Linux, but I can't manage to do the same thing with My Sony Home Theater (maybe I must send some commands before or something else). So it seem to be a little more tricky ... I will be happy if I can do some beta testing for you.

Keep that way man, I think your work will be a great improvement to the vera capability ... It is so bad that this device, who claim is upnp compliant, can't play with it out of the box ... or maybe MIOS team are stuck with the discovery part like us ... ( but it seem your are going far away ...)
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: chixxi on October 17, 2013, 04:43:12 am
@lolodomo:

I will use it for xbmc based devices, specifically openelec.

I was involved in the development of the current XBMC plugin, but this ist not upnp based. I also developped a plugin which allowed to control xbmc devices by json calls, but I never finished and published it. And as far as I know, these json based commands are outdated for current versions of xbmc. However, if you think you could use it I can give you the files.

I'd also be happy to do testing if this is any help for you.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 02:26:25 am
Do you think the upnp proxy event can do the trick of discovery ? especially our port discovery thing ? or only reporting status ? I'm planning to try to set up a DIY HA Alarm clock with a little Android pad. I will propably use Bubble upnp to play music at the wake up time ... and modifying Vera's config each time I reboot the pad to manage the bubble random port setting will be very annoying...

Yesterday, I read the part of the UPnP specification relative to the discovery process and I discovered that when you know the IP of a UPnP device, you can send to it a discovery message and get a response in less than 1 second.
UPnP discovery is using SSDP protocol ( based on UDP transport protocol).
The specification tells that it should be the normal way to check if a UPnP device is ON or OFF (currently I try to read the description file).
It should be doable to implement this message.
Of course, it would solve the problem with the port because the port would be automatically discovered.

Quote
For the SetAVTransportURI part, I'm able to invok command succefully with upnp spy to my GMediarender on Linux, but I can't manage to do the same thing with My Sony Home Theater (maybe I must send some commands before or something else). So it seem to be a little more tricky ... I will be happy if I can do some beta testing for you.

The URI is certainly provided by the DLNA Media Server. I have not yet read this part of the specification, but maybe there is no real standard to define this URI.
In the future, I will implement media server browsing in order to converge to a real Control Point.
In a first time (only control of the Media Renderer), I will display the values of URI + metadata. It will help the user to understand what URI delivers a particular Media Server and so what values to deliver to SetAVTransportURI .
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 02:30:38 am
@lolodomo:

I will use it for xbmc based devices, specifically openelec.

That is my final intention too.


We can think about intesresting additional events, like for example an event for mute/unmute.
Concerning the volume, we could imagine a "volume up" or "volume down" event too. Is it something that could be of any interest in the real life ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 04:23:29 am
Yesterday, I read the part of the UPnP specification relative to the discovery process and I discovered that when you know the IP of a UPnP device, you can send to it a discovery message and get a response in less than 1 second.
UPnP discovery is using SSDP protocol ( based on UDP transport protocol).
The specification tells that it should be the normal way to check if a UPnP device is ON or OFF (currently I try to read the description file).
It should be doable to implement this message.

Technically, I have to open a UDP socket to send the M-SEARCH message using port 1900. Then I have to receive the response. But there could be several responses. Does it mean that I have to call receive several times during a certain time period (5 secondes) ?

The unicast message sent directly to the UPnP device seems to be something implemented only bu UPnP 1.1 devices. I hope that most of our devies (XBMC, WMP, Sonos, ...) are UPnP 1.1 devices and not only UPnP 1.0 devices. That is solething to be checked too.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 18, 2013, 02:14:04 pm
Yesterday, I read the part of the UPnP specification relative to the discovery process and I discovered that when you know the IP of a UPnP device, you can send to it a discovery message and get a response in less than 1 second.
UPnP discovery is using SSDP protocol ( based on UDP transport protocol).
The specification tells that it should be the normal way to check if a UPnP device is ON or OFF (currently I try to read the description file).
It should be doable to implement this message.

Technically, I have to open a UDP socket to send the M-SEARCH message using port 1900. Then I have to receive the response. But there could be several responses. Does it mean that I have to call receive several times during a certain time period (5 secondes) ?

The unicast message sent directly to the UPnP device seems to be something implemented only bu UPnP 1.1 devices. I hope that most of our devies (XBMC, WMP, Sonos, ...) are UPnP 1.1 devices and not only UPnP 1.0 devices. That is solething to be checked too.

Do you know if I can test an unicast upnp discover with upnp tools ?

If it technically simpler to implement (and if most of device are upnp 1.1 compliant), setup IPs of devices is not very annoying, and maybe we don't want to add all of the upnp devices in the LAN... or maybe you want to implement stuff like Discover -> Device name like "name" -> Add.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 04:47:22 pm
I just tried to code the discovery code.
I send a M-SEARCH request to IP 239.255.255.250.
Strangely, I only discover UPnP devices from my Vera but no UPnP AV devices (Sonos, XBMC, ...). Why ?
What could be wrong in my code ?

Here is my code

Code: [Select]
    local udp = socket.udp()
    if (udp == nil) then
log("Call to socket.udp failed")
    else
log("Call to socket.udp ok")
        local result, message
            result, message = udp:setoption("broadcast", true)
            if (result == nil) then
log("Call to udp:setoption failed with message " .. message)
            else
log("Call to udp:setoption ok")
            end
            udp:settimeout(5)
log("send UDP")
            local datagram = "M-SEARCH * HTTP/1.1\r\n"
                           .. "HOST: 239.255.255.250:1900\r\n"
                           .. 'MAN: "ssdp:discover"\r\n'
                           .. "MX: 5\r\n"
                           .. "ST: upnp:rootdevice\r\n"
                           .. "Content-Length: 0\r\n"
                           .. "\r\n"
            result, message = udp:sendto(datagram, "239.255.255.250", 1900)
            if (result == nil) then
log("Call to udp:send failed with message " .. message)
            else
log("Call to udp:send ok")
                for i=1,500 do
                   datagram, message = udp:receive()
                   if (datagram == nil) then
log("Call to udp:receive failed with message " .. message)
                       break
                   else
--log("UDP datagram received " .. datagram)
                       local location = datagram:match("LOCATION: (.-)\r\n")
                       local st = datagram:match("ST: (.-)\r\n")
log("LOCATION " .. (location or "nil"))
log("ST " .. (st or "nil"))
                   end
                end
            end
        udp:close()
    end

Unicast discovery addressed to my PC is not working (nothing received). But it could be simply a consequence of the first problem.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 18, 2013, 05:22:06 pm
There are quite a few differences between your code and the ssdpSearch() function in the WeMo plugin. The latter works (with my UPnP devices) in both multicast and unicast modes, so it may give you some ideas on what to tweak. I recall that SSDP discovery was as fragile as the rest of UPnP: you had to list the headers in the right order, and capitalization matters.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 05:45:05 pm
There are quite a few differences between your code and the ssdpSearch() function in the WeMo plugin. The latter works (with my UPnP devices) in both multicast and unicast modes, so it may give you some ideas on what to tweak. I recall that SSDP discovery was as fragile as the rest of UPnP: you had to list the headers in the right order, and capitalization matters.

I did not know that you were doing UPnP discovery in the WeMo plugin.
Fantastic, I should find what is wrong.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 06:08:28 pm
I moved udp:settimeout, replaced udp:receive by udp:receivefrom and suppress the "Content-Length" header to have something similar to you.
This is still working (I receive all data from the Vera) except that I receive nothing from outside the Vera.

@futzle, what Vera model do you own ? VeraLite or Vera3 ?
I own a VeraLite.
Maybe the VeraLite is setup to filter all incoming messages when coming from outside ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 06:16:28 pm
One thing potentially interesting: Device Spy on my PC does not discover devices from my VeraLite.
Is it the same for you all ? Is it normal ?

My current feeling is that something is deactivated on the Vera. There is no communication relative to UPnP with outside the Vera.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 18, 2013, 06:21:33 pm
@futzle, what Vera model do you own ? VeraLite or Vera3 ?

Mine's a Lite too, set to get a (reserved) address over DHCP.

What's upstream of your Vera?  Routers have a habit of not always forwarding multicast packets, especially across segments.  I've got my Vera on a separate subnet so I have to run a multicast proxy program on my router to allow the packets to cross the subnet boundary.  See: http://bda.ath.cx/blog/2009/01/24/multicast-routing-upnp-traffic-with-linux/ (but this should not be an issue for unicast packets unless you are deliberately filtering them out).

See what happens when you run your Lua discovery code on a real computer, perhaps somewhere where you can run Wireshark.  Capturing packets was essential to my debugging process; it's what identified the parts of the UPnP spec that the WeMo UPnP stack was a stickler about.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 18, 2013, 06:37:40 pm
My Vera is normally on a different subnet, but for these tests I put it again in the same subnet as my PC and my Sonos.

If the problem was due to my router setup, I think Device Spy on my PC would not discover my Sonos ?

I never thought about that, but is it normal that Device Spy on my PC discovers nothing relative to the Vera ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 04:32:43 am
First, keep in mind that Multicast can't pass through different subnet unless your router implement IGMP protocol to do this...

For the second part, I think upnp spy can only discover Media related upnp devices ?!

To see whole vera notification, you must use another software: Device Sniffer from the same set of tools.

Launch it, push F5 to launch a whole Search, and you will see NOTIFY and M-SEARCH and how talkative vera can be !

Hope it help !
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 05:14:38 am
Hmm, self reply but ...

I maybe wrong with device spy ... I found here http://wiki.micasaverde.com/index.php/UI_Notes#UPnP_messaging_system at the bottom of the text :

"To test UPnP calls you can use the Intel Device Spy utility available here. It should pick up Vera, show you all the devices, like light switches, thermostats, etc., let you expand the services and see the actions and variables. Click an action, like SetTarget, to specify the arguments and click 'Invoke' to run the action, such as turning on and off the light."

But for me too, I don't see anything related to vera in Device Spy ... and whole of my House Lan is in the same subnet... strange ...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 05:22:51 am
But for me too, I don't see anything related to vera in Device Spy ... and whole of my House Lan is in the same subnet... strange ...

Thank you, that's interesting and could confirm my assymption that something is wrong in the VeraLite.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 05:37:21 am
I have now tested my lua code on my Windows PC using a lua interpreter and I can confirm that this code is working well. It discovers Sonos, XBMC, BubbleUPnP ... and Vera.
I have noticied that in the received message, we can have either LOCATION or Location (in case of XBMC and BubbleUPnP).
The code is only not working to discover Windows Media Player. Something to investiguate.


So the lua code is clearly not the problem. The problem is that, when run on my VeraLite, it does not behave like on my PC.
I see two possibilities:
1 - either the SSDP SEARCH message does not leave the VeraLite (blocked by the Vera ?)
2 - either the return messages coming from outside the VeraLite are filtered, by the Vera or something else.

What is strange is that @futzle succeeded to have a working UPnP discovery inside a VeraLite.

Is there a parameter to setup in the Vera ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 05:39:55 am
Yes, but with Device Sniffer, you can look that Vera Advertise whole Z-wave devices (dimmable lights, Media Renderer, etc.)
This is somewhat contradictory ....  ???

I've spent my morning in google and Mios Wiki to find if we need to configure something, but with no luck .
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 05:58:45 am
Regarding the unicast SSDP, it does not work better on my PC but I think it is simply because addressed devices (Sonos, XBMC, ...) are UPnP 1.0 devices and not UPnP 1.1 devices. It is what I read in the received messages (SERVER).
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 06:08:22 am
Same with my devices, they advertise all Upnp1.0 compliant in messages.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 06:14:15 am
Yes, but with Device Sniffer, you can look that Vera Advertise whole Z-wave devices (dimmable lights, Media Renderer, etc.)
This is somewhat contradictory ....  ???

I don't understand how the Sniffer is working exactly. When I run my code on the PC, I receive feedbacks from Vera devices while the sniffer show nothing... Maybe the sniffer does not detect response to M-SEARCH ?
And on my side, the Sniffer does not see Vera Advertise (NOTIFY messages). Should I wait several minutes to see them ?


Edit: ok, I found that I can launch "Search all devices" in Sniffer and then Vera devices appears in the Sniffer.

Regarding Device Spy, if Vera devices are not listed, it maybe a bug in Device Spy ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 06:16:18 am
I didn't configure my Vera Lite's network in any way when developing the WeMo plugin. Nor will its users have, and there have been users who've successfully just installed the plugin and had it work.

So. There's something else. Clutching at straws:

Vera lite has more than one interface. Perhaps the multicast request is going out on the wrong interface? I remember having to use getsockname() in the WeMo code to figure out the source address, which varies across each interface. But I don't think that's it.

How long are you waiting for discovery responses to come back? In the WeMo plugin I wait for 5 seconds, and only give up when there's been a timeout.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 06:26:58 am
To summarize:
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 06:29:38 am
lolodomo, please send me your current code and I will see if it discovers a WeMo device.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 06:31:41 am
Vera lite has more than one interface. Perhaps the multicast request is going out on the wrong interface? I remember having to use getsockname() in the WeMo code to figure out the source address, which varies across each interface. But I don't think that's it.

Do you think I should use setsockname to bind to the local IP address of my Vera (192.168.1.xxx) ?
You have a good idea, I will check the result of getsockname first.

Quote
How long are you waiting for discovery responses to come back? In the WeMo plugin I wait for 5 seconds, and only give up when there's been a timeout.

Same here.
I tried with 10 seconds and even more and it changes nothing.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 06:41:53 am
lolodomo, please send me your current code and I will see if it discovers a WeMo device.

Here is my full test code:

Code: [Select]
  local soclet = require("socket")

    local udp = socket.udp()
    if (udp == nil) then
log("Call to socket.udp failed")
    else
log("Call to socket.udp ok")
        local result, message
        local datagram = "M-SEARCH * HTTP/1.1\r\n"
                           .. "HOST: 239.255.255.250:1900\r\n"
                           .. 'MAN: "ssdp:discover"\r\n'
                           .. "MX: 5\r\n"
                           -- .. "ST: ssdp:all\r\n"
                           .. "ST: upnp:rootdevice\r\n"
                           -- .. "ST: urn:schemas-upnp-org:device:MediaRenderer:1\r\n"
                           -- .. "ST: urn:schemas-upnp-org:device:MediaServer:1\r\n"
                           .. "\r\n"
        result, message = udp:sendto(datagram, "239.255.255.250", 1900)
        if (result == nil) then
log("Call to udp:sendto failed with message " .. message)
        else
            udp:settimeout(5)
log("Call to udp:sendto ok")
            for i=1,500 do
               datagram, message = udp:receivefrom()
               if (datagram == nil) then
log("Call to udp:receivefrom failed with message " .. message)
                   break
               else
--log("UDP datagram received " .. datagram)
                   local location = datagram:match("LOCATION: (.-)\r\n")
                   if (location == nil) then
                       location = datagram:match("Location: (.-)\r\n")
                   end
                   local st = datagram:match("ST: (.-)\r\n")
                   local server = datagram:match("SERVER: (.-)\r\n")
                   if (server == nil) then
                       server = datagram:match("Server: (.-)\r\n")
                   end
log("LOCATION " .. (location or "nil"))
log("ST " .. (st or "nil"))
log("SERVER " .. (server or "nil"))
                end
            end
        end
        udp:close()
    end

I think it is identical to your code in WeMo plugin (except the decoding of the received message - but the problem is not here).
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 06:49:49 am
Regarding getsockname, if I call it just after calling sendto, I get IP 0.0.0.0 and a port number like 37770.
On the PC, I get another port number but the IP is 0.0.0.0 too.

Should I first call setsockname with "192.168.1.xx" and a port number ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 06:57:44 am
I tried to add this part of code before calling sendto:

Code: [Select]
        result, message = udp:setsockname("192.168.1.xx", 0)
        if (result == nil) then
log("Call to udp:setsockname failed with message " .. message)
        else
log("Call to udp:setsockname ok")
        end

With 192.168.1.xx the IP of my Vera (or my PC).

The new code still work on the Windows PC.
On the Vera, it is even worst, now I have no answer at all, even from Vera devices.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 07:03:52 am
When I run ifconfig on my VeraLite, I see one interface eth0:0 with inet addr 192.168.1.xx but I see another interface eth0 with inet addr 192.168.81.x. Is it normal and could it be the source of my current problem ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 07:10:54 am
Here is my full test code:

I ran that from a shell on my Veralite and I got responses from twelve devices on my LAN (one of which was Vera itself) before it timed out.  The WeMo was among them along with a NAS and my cat-spying security webcams.

I agree, your code is good.  Time to see what your upstream connection is doing.  Perhaps the router isn't forwarding multicast packets symmetrically.  Something that occurs to me is that you haven't said if your PC is connected over Ethernet or Wi-Fi.

Don't use setsockname(), that was a red herring.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 07:11:27 am
I tried to run the code alone in "Test luup code" rather than in a plugin to be sure that it could not be relative to something else in the plugin. No change.
I tried to set timeout to 30 seconds. No change.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 07:17:31 am
Here is my full test code:

I ran that from a shell on my Veralite and I got responses from twelve devices on my LAN (one of which was Vera itself) before it timed out.  The WeMo was among them along with a NAS and my cat-spying security webcams.

I agree, your code is good.  Time to see what your upstream connection is doing.  Perhaps the router isn't forwarding multicast packets symmetrically.  Something that occurs to me is that you haven't said if your PC is connected over Ethernet or Wi-Fi.

My PC is connected over Ethernet (through CPL). My Vera is now connected directly to my switch router.

If the problem was due to the router, I think the code would not work on the PC. No ?
I see no parameter on my router relative to multixast packets forwarding.
I disabled UPnP IGD on the router. Could it be a problem ? I will check immediately. Edit: it changes nothing.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 07:20:58 am
@futzle: you are running firmware 1.5.622 ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 07:27:26 am
My PC is connected over Ethernet (through CPL). My Vera is now connected directly to my switch router.

I don't know what CPL is. Try to put the two devices as close to each other as possible.  If you have a Layer 2 Ethernet switch (not a router), connect that to the PC, Vera and router in a star topology.  You are trying to make sure that all packets are present on the network segment and that the router can't drop packets because it is too far upstream.

Quote
If the problem was due to the router, I think the code would not work on the PC. No ?

No, not necessarily.  They are running different operating systems and there's no guarantee that the packets generated have all the same flags or properties on them (such as the time to live).  You'd need Wireshark or something equally low level to debug that.

I asked about Wi-Fi because some Wi-Fi access points have a habit of forwarding multicast from the Wi-Fi segment to the Ethernet segment, but not vice versa.  Sometimes there is a configuration option to change this behaviour, usually not.

@futzle: you are running firmware 1.5.622 ?

1.5.621, which is apparently the identical beta.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 08:23:42 am
Using Wireshark, I can see the message is sent to 239.255.255.250 from IP 192.168.81.xx and not 192.168.1.xx. But then I see no response coming from my Sonos devices to 192.168.81.xx (neither 192.168.1.xx).
Of course, when the code is run from my PC, I see these response messages.
In the two cases, the UDP packets have the same size (109); the frame has the same size (143 bytes - 1144 bits).

I see that the same M-SEARCH message is immediately repeated by my router. That's done in the two cases.

The problem might be that 192.168.81.xx is used rather than 192.168.1.xx. I don't know exactly what is subnet 192.168.81.xx (eth0 on my VeraLite) but my Sonos devices are on subnet 192.168.1.xx and it looks obvious that they cannot communicate with 192.168.81.xx.

What is this interface/subnet in the Vera Lite ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 08:39:16 am
Ok, same issue here :

When I test your code in the luup test code, I see only my vera rootdevice.

And I have the same strange network configuration :

eth0 192.168.81.1 (don't know for what it is)

and eth0:0 with 192.168.0.x, who is my correct network subnet.

So it seem right that Vera use the wrong interface to send discovery, but I don't know what is the purpose of eth0...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 08:42:44 am
So it seem right that Vera use the wrong interface to send discovery

That's my feeling.

I hope we have a chance to force the right interface through lua code...

That would be interesting if @futzle could confirm having the same network setup and confirm that the wrong interface is used too.

Quote
but I don't know what is the purpose of eth0...

Good question...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 08:51:07 am
I tried to use  udp:setsockname("*", 0) that should bind to all interfaces ... but no change.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 09:01:03 am
Looking result of these command on Vera :
$ grep -r 192.168.81.1 /etc/*

It seem 192.168.81.1 is the default network configuration for the vera.

Present in default light_http config (webserver) or in the init script freshinstall.sh

Otherwise when you look the config file for the network configuration used at Vera startup (/etc/config/network) eth0 is named LAN with this fixed IP adresse and eth0:0 is named WAN (witch is dhcp in my case).

But I don't know if we can remove safely eth0 and change the eth0:0 naming to eth0 without having internal bug.

I'm so sorry, but my vera is in production :) and my girlfriend will just kill me if the house run crazy :P


Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 09:01:41 am
Looking in file /etc/config/network, it seems that eth0 is the lan interface with a static IP and eth0:0 is the wan interface with DHCP..
As VeraLite is not a router, does it make sense to find LAN and WAN interfaces ?

I am now really curious to know what is different on @futzle VeraLite setup.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 19, 2013, 09:05:40 am
I'm so sorry, but my vera is in production :) and my girlfriend will just kill me if the house run crazy :P

Yes, there is a big risk to brick the VeraLite. We really need a network expert to understand what's wrong and what we can change without risk.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 09:45:22 am
I'm pretty comfortable with Network and Linux (wich is my work) much more than programming :) , and I can tell you we must be able to do a ssh after reboot even if the Vera Z-wave not working anymore to revert back the network config.

But ... course there is a but ... I can't guarantee there is no startup script or process that will hang up the vera startup process if the "Lan" interface disappear .... so maybe the ssh daemon will not be launched ... and if it the case, I don't know if we can do a factory reset or something else ...

Sure having @futzle network config or someone who have a working wemo plugin will help !
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 19, 2013, 10:04:29 am
Lolodomo, I tried to force multicast to go out through eth0:0 with the help of this command :

ip route add 239.255.255.250/32 dev eth0:0 src 192.168.x.x (ip of vera in your network)

But no change to the result of your script...only discover Vera upnp root, but maybe you can give it a try ?

You can do it without risk and revert back with this command :

ip route del 239.255.255.250/32 dev eth0:0 src 192.168.x.x (ip of vera in your network)

It seem possible to perform a Factory Rest if we are stuck but it scared me  :o not sure if we can do a real backup to restore parameters and zwave association after that ...
http://wiki.micasaverde.com/index.php/Factory_Reset

Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 06:27:29 pm
Sure having @futzle network config or someone who have a working wemo plugin will help !

Code: [Select]
eth0      Link encap:Ethernet  HWaddr 00:0E:8F:7B:72:A3 
          inet addr:192.168.81.1  Bcast:192.168.81.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3419384 errors:0 dropped:8 overruns:0 frame:0
          TX packets:3430990 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:213992713 (204.0 MiB)  TX bytes:860438133 (820.5 MiB)
          Interrupt:5

eth0:0    Link encap:Ethernet  HWaddr 00:0E:8F:7B:72:A3 
          inet addr:10.191.21.248  Bcast:10.191.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:5

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:148428 errors:0 dropped:0 overruns:0 frame:0
          TX packets:148428 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:28094022 (26.7 MiB)  TX bytes:28094022 (26.7 MiB)

10.191.x.x/16 is Vera's subnet.

Here is the outgoing packet from Vera caught at my router:

Code: [Select]
# tcpdump -c 1 -x -i br-vera udp port 1900
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br-vera, link-type EN10MB (Ethernet), capture size 65535 bytes
09:16:52.914423 IP veralite.icemoonprison.com.50195 > 239.255.255.250.1900: UDP, length 101
0x0000:  4500 0081 0000 4000 0111 68bb 0abf 15f8
0x0010:  efff fffa c413 076c 006d 25dd 4d2d 5345
0x0020:  4152 4348 202a 2048 5454 502f 312e 310d
0x0030:  0a48 4f53 543a 2032 3339 2e32 3535 2e32
0x0040:  3535 2e32 3530 3a31 3930 300d 0a4d 414e
0x0050:  3a20 2273 7364 703a 6469 7363 6f76 6572
0x0060:  220d 0a4d 583a 2035 0d0a 5354 3a20 7570
0x0070:  6e70 3a72 6f6f 7464 6576 6963 650d 0a0d
0x0080:  0a

Bytes 0x000c-0x000f show that the source address is 10.191.21.248, and byte 0x0008 shows the TTL is 1.

This might also be useful:

Code: [Select]
# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.81.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
10.191.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         10.191.1.1      0.0.0.0         UG        0 0          0 eth0
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 06:32:05 pm
There's a special socket option (http://www.tldp.org/HOWTO/Multicast-HOWTO-6.html#ss6.3) to specify which interface you should be using to send multicast packets.  I'm not at all convinced that you can set this from within Lua though. :/
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 19, 2013, 08:26:39 pm
ip route add 239.255.255.250/32 dev eth0:0 src 192.168.x.x (ip of vera in your network)

Give this a go:

Code: [Select]
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0:0
where eth0:0 is whichever interface has your LAN address in ifconfig.

Undo with:

Code: [Select]
route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0:0
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 20, 2013, 04:56:09 am
I am lost. futzle, it seems that you have a similar VeraLite setup as ours (macfly and me). Why is it working for you and not for us ? :( What a mistery.


Even if we succeed to find a solution for the basic local network case, then I will have to make it work with the Vera in a sunet and the DLNA DMR in another subnet...


TTL is something that we have to consider. futzle, in one of your message, you say that Vera uses TTL 1 for SSDP message ? That would mean that there is no chance to go through a router ?
 Doing Web searches yesterday, it seems that Windows 7 uses TTL 1 too but it exists a registry key to adjust that.


Thinking about Wireshark, I have a big doubt. Maybe it is normal that I cannot see the network traffic beween a Sonos and the Vera ? I presume that Wireshark only see the network traffic going through the PC ?


Regarding Windows Media Player discovery, I think I know why it is not working. I read that WMP is using IP v6 so we have certainly to send a discovery message to special multicast IP v6 too, 239.255.255.250 isl only for devices using IP v4.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 20, 2013, 05:24:18 am
As I say before Lolodomo, even if you can up the ttl of you packet, Mulicast don't pass trough Vlan unless your router implement a special protocol to do this (like IGMP or PIM).

And your right for Wireshark, you will see only PC packet or broadcast because you have a Network Switch and not a network HUB.

I was pretty sure That @Futzle don't have the same primary network interface than our... but it is the case ... so why it work for him and not for us ...

I will try a tshark on my plex media server to see if I received something from vera when launching the script.

EDIT : Ok, source adresse is really our problem :

205.839014 192.168.81.1 -> 239.255.255.250 SSDP 136 M-SEARCH * HTTP/1.1
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 20, 2013, 05:33:18 am
As I say before Lolodomo, even if you can up the ttl of you packet, Mulicast don't pass trough Vlan unless your router implement a special protocol to do this (like IGMP or PIM).

Do you know if it is possible with DD-WRT ? (i have not yet checked)

Quote
And your right for Wireshark, you will see only PC packet or broadcast because you have a Network Switch and not a network HUB.

Ok, thank you for confirming that point.
I should at least see response messages from my PC (XBMC) and the Vera. I am not sure XBMC was running when I did my Wireshark tests. I will do it again.

Quote
I was pretty sure That @Futzle don't have the same primary network interface than our... but it is the case ... so why it work for him and not for us ...

her
Did you try route command proposed by futzle ?

Searching on the forum, I discovered an interesting discussion: http://forum.micasaverde.com/index.php/topic,13890.msg104717.html#msg104717
It seems possible to set the LAN IP in the same subnet as the WAN IP.

Quote
I will try a tshark on my plex media server to see if I received something from vera when launching the script.

Ok.
On my side, I am a little desesperate...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 20, 2013, 06:05:59 am
Woot, I think I found a workaround ...

Now I'm Able to discover my plex media server with your script :

From Plex (192.168.0.100) :
  0.000000 192.168.0.101 -> 239.255.255.250 SSDP 169 M-SEARCH * HTTP/1.1  // This Is My really Vera IP Address in source

From Vera Log :
50      10/20/13 11:44:08.068   luup_log:0: Call to socket.udp ok <0x2d3e1680>
50      10/20/13 11:44:08.069   luup_log:0: Call to udp:sendto ok <0x2d3e1680>
50      10/20/13 11:44:10.073   luup_log:0: LOCATION http://192.168.0.100:32469/DeviceDescription.xml <0x2d3e1680> // This is my plex media server
50      10/20/13 11:44:10.074   luup_log:0: ST urn:schemas-upnp-org:device:MediaServer:1 <0x2d3e1680>
50      10/20/13 11:44:10.074   luup_log:0: SERVER UPnP/1.0 DLNADOC/1.50 Platinum/1.0.4.9 <0x2d3e1680>

How To :

1st, ip route command or route add doesn't seem to take the Alias attribute of a NIC. So eth0 or eth0:0 is the same for those.
I learnt from my plex media server that I received the M-SEARCH notification but with the wrong IP Address source... (this crappy 192.168.81.1)

So what can we do ... Of course ! let do some IP source natting with Netfilter ! (hope iptables is installed on Vera .. woot yes !, next  !)

Use this command on Vera:

Code: [Select]
iptables -t nat -I POSTROUTING -d 224.0.0.0/4 -j SNAT --to-source 192.168.0.101

Last Parameter is your Vera LAN Ip Address (not the crappy .81.)

What it does :
iptables -t nat -I POSTROUTING (Put this rule In TOP of POSTROUTING table - Netfilter stuff)
-d 224.0.0.0/4 (Match all packet with Multicast destination)
-j SNAT --to-source 192.168.0.101 (Action -> Replace source IP address by this one)

You can undo this command with :
Code: [Select]
iptables -t nat -D POSTROUTING -d 224.0.0.0/4 -j SNAT --to-source 192.168.0.101
or reboot Vera.

This rule is volatile, so you must add it after each boot.

It is not a solution, it is a Workaround without having to delete this primay network configuration... It will not having a negative effect on vera routine unless Internal code use Multicast too but with the .81. address .... (I doubt but can't be really sure).

@lolodomo It must be working for you too ! unless we find a better solution !

@futzle please can you post the result of this command ? :
Code: [Select]
iptables -t nat -nvLIt will print your NAT netfilter configuration.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 20, 2013, 06:58:17 am
Searching on the forum, I discovered an interesting discussion: http://forum.micasaverde.com/index.php/topic,13890.msg104717.html#msg104717
It seems possible to set the LAN IP in the same subnet as the WAN IP.

In this post I see two interesting thing :
1st LAN & WAN config seem not really used, It is a workaround to have the same network architecture with Vera not lite (with two real NIC)
2nd This man change the .81. address without brick his Vera ... So we can set 2 IP address in the same subnet and use 2 IP  for vera.. Not sure if it is annoying thing.
or maybe we can just config LAN Interface with our config, and delete WAN one.
or maybe we could too use THE SAME IP for the two interface, since is just an Alias...

Quote
On my side, I am a little desesperate...

Don't Be Man ! My previous post give you a working workaround, and we are pretty close to find a better solution !

EDIT :

Regarding my (our) Vera NAT configuration ... I found why we have this bug (MASQUERADE wildcard for wan interface use eth0 and so replace source with .81.) ... but what I don't understand, is why it is working for @Futzle :) hope she (? Am I understand right ?) can give us the result of the command in my previous post.

Anyway, my iptables nat command is pretty the same than Vera config, without the bug, but we have to set the correct IP of Vera by hand.

If we keep this workaround, it will be easy to launch it at vera startup.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 20, 2013, 07:22:10 am
Use this command on Vera:

Code: [Select]
iptables -t nat -I POSTROUTING -d 224.0.0.0/4 -j SNAT --to-source 192.168.0.101

Last Parameter is your Vera LAN Ip Address (not the crappy .81.)

macfly, you are a genius. 8)
This workaround is working perfectly for me too. My lua UPnP discovery code is now working from the Vera too.

I imagine that the workaround will probably be required for Vera3 users too ?

Can we conclude that futzle's VeraLite internal route table is simply different from ours ? What could be the reason ?


Additionnal good news: even Windwos Media Player is finally discovered. There was just a little difference in the returned message, no space after each entry, like "Location:hhtp://..." rather than "Location: http://...".
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 20, 2013, 07:41:13 am
I am not familiar with advanded network stuff, I will certainly never find this workaround.
Thanks a lot to macfly92 and futzle.


Now I have to try to make the discovery code work even with a router between the Vera and the DMR devices !


We have to think about how we can use this UPnP discovery. The idea could be to have a UI to launch the discovery, display the result and let the user select the right DMR device. If the user entered an IP address, the result could be filtered with only DMR running on this IP. For this, the UPnP discovery will only be launched each time the user requests it.

Running the full discovery for each device at lua startup, and even regurlarly (every 5 minutes for example) to check if the DMR is still alive and to find change of port (BubbleUPnP) is possible too, but I don't know if it is a good idea to have several Vera devices launching a full UPnP discovery more or less at the same time ? Each discovery will "lock" the Vera for about 5 seconds.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 20, 2013, 07:42:46 am
macfly, you are a genius. 8)
This workaround is working perfectly for me too. My lua UPnP discovery code is now working from the Vera too.

I imagine that the workaround will probably be required for Vera3 users too ?

Can we conclude that futzle's VeraLite internal route table is simply different from ours ? What could be the reason ?

Additionnal good news: even Windwos Media Player is finally discovered. There was just a little difference in the returned message, no space after each entry, like "Location:hhtp://..." rather than "Location: http://...".

My knowledge on linux and network are much more than programming, so I'm very happy to help in your very interesting project ! Even if I have head heck to write in english while I assume that you are french like me :) (But it give me some training so it isn't a bad thing....)

Vera3 have a Wifi router function no ? so It have Two real Interfaces and the Netfilter bug don't apply ... so no need this "patch". I've see Futzle have a vera lite too so it is strange ... (or maybe i'm wrong)
It is not Routing related, much more Firewall related thing ... it appear because we have only one interface with a MIOS trick to apply same config as Vera with routing capability but with a side effect...

Discover with a router between will by tricky I think ...
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 20, 2013, 07:48:46 am
My knowledge on linux and network are much more than programming, so I'm very happy to help in your very interesting project ! Even if I have head heck to write in english while I assume that you are french like me :) (But it give me some training so it isn't a bad thing....)

 ;D Same here.
Some training without teacher to correct faults ;)
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 20, 2013, 07:53:15 am
Discover with a router between will by tricky I think ...

The router seems to have a "Multicast forward" feature. Isn't it what I need ?
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: futzle on October 20, 2013, 08:12:23 am
1st, ip route command or route add doesn't seem to take the Alias attribute of a NIC. So eth0 or eth0:0 is the same for those.

I noticed that /sbin/route (the traditional one, not /usr/sbin/ip from iproute2) does produce different behaviour when I mention eth0:0 versus eth0 in the command line, even though when you print out the route afterwards it looks the same.  For me, that route command was enough to affect the source address selection on the outgoing multicast packet from lolodomo's code.

Quote
@futzle please can you post the result of this command ? :
Code: [Select]
iptables -t nat -nvLIt will print your NAT netfilter configuration.

It all looks pretty bog-standard.  In fact it looks effectively empty.

Code: [Select]
# iptables -t nat -nvL
Chain PREROUTING (policy ACCEPT 23 packets, 1632 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 6959  517K prerouting_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 1936  162K zone_lan_prerouting  all  --  eth0   *       0.0.0.0/0            0.0.0.0/0           
    0     0 zone_wan_prerouting  all  --  eth0:0 *       0.0.0.0/0            0.0.0.0/0           

Chain INPUT (policy ACCEPT 23 packets, 1632 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 137 packets, 7902 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 137 packets, 7902 bytes)
 pkts bytes target     prot opt in     out     source               destination         
42259 2425K postrouting_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 5317  303K zone_lan_nat  all  --  *      eth0    0.0.0.0/0            0.0.0.0/0           
    0     0 zone_wan_nat  all  --  *      eth0:0  0.0.0.0/0            0.0.0.0/0           

Chain nat_reflection_in (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain nat_reflection_out (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain prerouting_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_lan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 6957  517K prerouting_lan  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain zone_wan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination         
16496  939K MASQUERADE  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain zone_wan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 5021  355K prerouting_wan  all  --  *      *       0.0.0.0/0            0.0.0.0/0     

One thing that's different between my LAN and yours is that I've got a 10.x.x.x/16 subnet and you've got a 192.168.x.x/24 subnet. (Or is it 192.168.x.x/16 you have?)  Either the size of the netmask, or the overlap with the rogue 192.168.81.x/24 subnet, is causing a different default source address on the multicast packets.  Care to take that thought and run with it?

As I say before Lolodomo, even if you can up the ttl of you packet, Mulicast don't pass trough Vlan unless your router implement a special protocol to do this (like IGMP or PIM).

Do you know if it is possible with DD-WRT ? (i have not yet checked)

Probably.  You need a kernel with the iptable_mangle module (to bump the TTL back up above zero), and the smcroute program to forward multicast packets across from Vera's segment to the LAN segment.  Both are present in OpenWrt, so if DD-WRT has feature parity you're good to go.  See that page I linked to about ten posts back.

I'm really not sure how this will translate to a Vera3.  Yes, the upstream "WAN" interface and downstream "LAN" (the cursed 81 subnet) interfaces have different physical Ethernet jacks, and then there is also the wireless WLAN interface which may or may not be bridged onto the LAN interface.  I'm afraid you might have to send out a discovery on each of the interfaces, and that's going to be tricky when you're relying on iptables voodoo to do the job.  Ugh.  It's really a pity that Luasocket doesn't expose the proper ioctls for doing this from Lua.

The router seems to have a "Multicast forward" feature. Isn't it what I need ?

It's possible, but that could also be a badly-worded synonym for IGMP snooping, which is technically also "multicast forwarding" and nothing like what you need.

I assume that you are french like me :)

By all means, slip into French if you need.  I can understand it just fine, but I won't be butchering your language by trying to reply in it. :)
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 20, 2013, 05:46:47 pm
Hi Futzle !

We will keep trying to speak international language since we are on a international forum, if you (and the other) forgive us (especially me  :-[) for the butchery like you said :)

No Overlapping for me, each Vlan are with 24 bits netmask. (255.255.255.0) This is one of the first think that pop in my mind :)

The only difference between your config and mine is in POSTROUTING Chain :

While you have :
0     0 zone_wan_prerouting  all  --  eth0:0 *       0.0.0.0/0            0.0.0.0/0   

I have :
53283   16M zone_wan_nat  all  --  *      eth0    0.0.0.0/0            0.0.0.0/0

Ok, that is the Bug, because it affect Masquerading source address (eth0:0 in your case, eth0 in mine, so it's not cool)

But the strange thing in your case is The first two digits of your line, this is the packets and bytes counter, and in your case, it seem that no packet go through this rule ... even if it seem that you have freshly boot your Vera... some packets could already be counted ... and I don't know why we have a different config because I never touched the OpenWRT system of my vera before this story.

For the Multicast routing, I say it will be tricky, not impossible :) Futzle gave good tips !

@Lolodomo : My mind to think this project is a setup process, with discovery method that we can Add devices we want, name it, etc. With this "static" bind, I hope be able to Script some event for some Media Renderer like say some TTS, or Launch Webradio, with the help of scenario and without having to use Vera UI.
And for sure, in a second time, be able to browse a media library and launch it to a media renderer will be so cool, but I don't know how far you could go with VeraUI customization.

Don't know if it is your way of mind  :P

Anyway, we must absolutely keep in mind the Vera Load limit, It will be great to have a powerfull Media Controller, but If it affect the Z-wave network reliability or too much Scenario delay, this will be worst than all...

Time to sleep for me, big step today :) good night folks !
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 22, 2013, 02:12:59 am
What I plan to do for the DLNA Media Renderer controller plugin (and the Sonos plugin) is to replace the Settings UI tab by a tab in which the user can lauch an UPnP discovery and then select the UPnP device he wants to control. He will neven ot have to know the IP of the device.
The "Location" data returned by the discovery process will be stored in a variable.
Of course, I will keep the ability to enter manually these data, in case of the UPnP discovery is not working for few users.


Adding the UPnP discovery was a major step leading to a full Control Point implementation. Now I am even able to discover DLNA Media Servers. What is now missing is just browsing data from a Media Server (that is probably not very hard to implement) and connecting a Media Server to a Media Renderer.
So I could increase my ambition and try to create a generic DLNA Control Point.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 22, 2013, 05:37:18 am
Oh yes, please could :)

We are here to provide help and/or testing if you need ! (and if we could :))
I repeat myself, but I think this is a major feature !
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 22, 2013, 07:58:35 am
We are here to provide help and/or testing if you need ! (and if we could :))

Tests will be appreciated, because of course I will not be able to test myself with all existing Media renderers (and Media Servers).
On my side, I will ccheck ompatibility of the plugin with the following Media Renders:
- XBMC on PC (and later on Raspberry)
- Windows Media Player (version included with Windows 7)
- BubbleUPnP (Android)
- Sonos devices
- Media renderer provided with the Intel UPnP tools


Then there are tests to run with all kinds of media and formats (music, video, ...).


To provide something in a reasonable delay, first I will provide something that include discovery of Media Renderers + control of Media Renderer. It will allow getting feedback from all volunteers
In a second time, I will add the last part relative to the control of any DLNA Media Servers.
Finally I could name the plugin "DLNA Control Point" even if the first version will not be exactly a control point.


I am not totally sure but it might be possible to connect to Sonos any Media Server (delivering music).
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: fhreid on October 26, 2013, 10:58:14 pm
Any Updates?  Your work here is the most exciting thing on these boards.
Title: Re: DLNA Media Renderer Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 28, 2013, 07:19:23 am
Any Updates?  Your work here is the most exciting thing on these boards.

I have now almost finished integration of the UPnP discovery process but the UI is not fully finished 'presentation to improove and few additional fields to be added)). But I can now change dynamically from the UI from one DMR to another.
An action SelectUPnPDevice will allow to select a UPnP device, providing its descrtiption URL.
Anoother action SearchAndSelectUPnPDevice will allow to search and select an UPnP device, providing a device name and an optional IP address. This second could be used in a scene for example for BubbleUPnP and solve the problem of the changing port.

I am now extracting required URL associated to services from the description XML file. So my code has now nothing hardcoded relative to a particular DMR.

I tried Text To Speech with XBMC and it is not working perfectly (beginning of the sentence not heard and previous playback context is not restored). I have to investiguate and fix that. Normally TTS should work with any DMR supporting MP3 format + HTTP URI.

As explained in another topic, I could have discovered a bug in the UPnP event proxy. If confirmed, I will have to fix this bug first, even if it is not a blocking issue.


I am making changes in parallel in the DLNA plugin and in the Sonos plugin, with a part of the code being common to the two plugins.

If I find time as expected, I think I could release a new version of the Sonos plugin and a first version of the DLNA plugin in 1 or 2 weeks.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 28, 2013, 07:27:33 pm
My discoveries of the evening relative to TTS:
- TTS is working with BubbleUPnP but when restoring previous playback context, I have to use another option to seek to the previous position (REL_TIME rather than TRACK_NR)
- TTS is working with XBMC but unfortunately the beginning of the MP3 is not heard. It looks like a bug in XBMC, not in my plugin
- TTS is working with Windows Media Player but restoring the previous playback context is impossible as WMP does not provide URI information

Using Winows Media Player, I discovered another problem; Microsoft seems to be not compliant with the DLNA standard (what a surprise ;D ) when producing the SOAP response message. Rather than having something like that in the repsonse: "<s:Body><u:GetMediaInfoResponse ....", Microsoft produces something like: "<SOAP-ENV:Body><m:GetMediaInfoResponse ...". And then each output argument has XML attributes while it is not the case with other DMR.
Edit: I correct myself, the UPnP standard allows using any variable for namespaces. So WMP is compliant with the standard. I have to adjust my code.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 30, 2013, 08:34:39 am
Hi Lolodomo !

Very happy to see you do lot of progress.

Can't wait to test it !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 30, 2013, 06:08:48 pm
Hi Lolodomo !

Very happy to see you do lot of progress.

Can't wait to test it !

"Lot of progress" is not exactly what I would say ;)
I am jumping from one problem to another one.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on October 31, 2013, 05:49:33 am
I am jumping from one problem to another one.

It is what "progress" mean no ? :)

Garde courage !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 31, 2013, 09:39:38 am
macfly, it could be interesting if you could provide the AVTransport and RenderingControl service files for you two Media Renderer.

I have to build two services files (AVTransport and RenderingControl) covering standard DLNA actions + Sonos specific actions. I will include vendor specific actions I could discover for the following renderers:
- XBMC
- Windows Media Player
- BubbleUPnP
I could include specific actions from your two renderers.


When invoking an action, my plugin will check that the action really exists in the service description returned by the UPnP device. For example, you will see in the Vera scene editor an action named BecomeCoordinatorOfStandaloneGroup. But if you use this action for a XBMC device, there will be no request sent to the XBMC device; the plugin will log a message saying that this action is not available for this UPnP device.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 31, 2013, 09:42:36 am
@macfly: for your information, I discovered that sometimes I loose the network setup we did to solve the UPnP discovery issue. I don't know if it means that my Vera rebooted or not.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: garrettwp on October 31, 2013, 01:14:03 pm
Have you checked the uptime when you notice this issue?

- Garrett

Title: Re: Common library and services for UPnP AV / DLNA control
Post by: macfly92 on October 31, 2013, 02:35:29 pm
I had posted the full list with a download link for each of my devices page 2 of this thread, there it is, the download link must still worked (if not let me know)

First is GMrender Resurect. This is a Linux shell apps that listen uPnp Request and play Media. (Actually installed on a Raspberry Pi).

Device Description URL : http://192.168.0.123:49494/description.xml
description.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_description.xml)

Base URL   http://192.168.0.123:49494/
Device icon   Present, 128x128
Device URN   urn:schemas-upnp-org:device:MediaRenderer:1
Embedded devices   0
Expiration timeout   100
Friendly name   SalleDeBain
Has presentation   True
Manufacturer URL   http://github.com/hzeller/gmrender-resurrect
Model description   gmediarender 0.0.7-git
Model name   gmediarender
Model number   2013-09-07_9bcc832
Model URL   http://github.com/hzeller/gmrender-resurrect
Presentation URL   http://192.168.0.123:49494/
Product code   
Proprietary type   
Remote endpoint   192.168.0.123:49494
Serial number   
Services   3
Standard type   
Unique device name   GMediaRender-1_0-000-000-002
Version   1.0

Link to services URL, and xml link :

Methods   12
Parent presentation URL   http://192.168.0.123:49494/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:AVTransport
Service URL   http://192.168.0.123:49494/upnp/rendertransportSCPD.xml
State variables   30
Version   1.0
rendertransportSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_rendertransportSCPD.xml)

Methods   21
Parent presentation URL   http://192.168.0.123:49494/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:RenderingControl
Service URL   http://192.168.0.123:49494/upnp/rendercontrolSCPD.xml
State variables   21
Version   1.0
rendercontrolSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_rendercontrolSCPD.xml)

Methods   4
Parent presentation URL   http://192.168.0.123:49494/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:ConnectionManager
Service URL   http://192.168.0.123:49494/upnp/renderconnmgrSCPD.xml
State variables   10
Version   1.0
renderconnmgrSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/gmrender_renderconnmgrSCPD.xml)


Second is a SONY Blu-ray HomeTheatre :

Device Description URL : http://192.168.0.90:52323/dmr.xml
dmr.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_dmr.xml)

Base URL   http://192.168.0.90:52323/
Device icon   Present, 48x48
Device URN   urn:schemas-upnp-org:device:MediaRenderer:1
Embedded devices   0
Expiration timeout   1800
Friendly name   BLU-RAY HOME THEATRE SYSTEM
Has presentation   True
Interface to host   192.168.0.10
Manufacturer   Sony Corporation
Manufacturer URL   http://www.sony.net/
Model description   
Model name   BDV
Model number   
Presentation URL   http://192.168.0.90:52323/
Product code   
Proprietary type   
Remote endpoint   192.168.0.90:52323
Serial number   
Services   5
Standard type   
Unique device name   00000000-0000-1010-8000-544249199c7c
Version   1.0

Link to services URL, and xml link :

Methods   15
Parent presentation URL   http://192.168.0.90:52323/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:AVTransport
Service URL   http://192.168.0.90:52323/AVTransportSCPD.xml
State variables   33
Version   1.0
AVTransportSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_AVTransportSCPD.xml)

Methods   6
Parent presentation URL   http://192.168.0.90:52323/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:RenderingControl
Service URL   http://192.168.0.90:52323/RenderingControlBdvSCPD.xml
State variables   7
Version   1.0
RenderingControlBdvSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_RenderingControlBdvSCPD.xml)

Methods   3
Parent presentation URL   http://192.168.0.90:52323/
Parent UDN   urn:schemas-upnp-org:device:MediaRenderer:1
Service ID   urn:upnp-org:serviceId:ConnectionManager
Service URL   http://192.168.0.90:52323/ConnectionManagerSCPD.xml
State variables   10
Version   1.0
ConnectionManagerSCPD.xml (https://dl.dropboxusercontent.com/u/12122638/Sony_ConnectionManagerSCPD.xml)

Like @Garrettwp said, you can check if your vera has reboot with the uptime command. For me, 15 days uptime and my tweak still present.

Anyway, this is how you can add the iptables command to Vera startup :

edit the file /etc/rc.local

add the "iptables -t nat -I POSTROUTING -d 224.0.0.0/4 -j SNAT --to-source your_vera_ip"  command just before "exit 0" command line.

write & quit file

do a "chmod 750 /etc/rc.local" to set the script executable and your done.
Title: Re: Common library and services for UPnP AV / DLNA control
Post by: lolodomo on October 31, 2013, 06:44:09 pm
I had posted the full list with a download link for each of my devices page 2 of this thread, there it is, the download link must still worked (if not let me know)

Ok, files are downloaded.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 02, 2013, 08:04:43 am
It is probably obvious to solve but I have a difficulty with default URLs returned by XBMC:
http://192.168.xxx.xxx:1367/thumb?path=image%3A%2F%2FDefaultVideoCover.png%2F
http://192.168.xxx.xxx:1367/thumb?path=image%3A%2F%2FDefaultAlbumCover.png%2F

These URL are not working. Any idea ?

Additional question: what should I do to test a URL without downloading all the result ?
I would like to test if I can get the cover, without downloading the full image.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 03, 2013, 04:23:46 am
with a URL decoder tool your XBMC request look like thumb?path=image://DefaultAlbumCover.png/

Strange to have a / at the end of an picture extension but i'm not familiar with XBMC ...

Don't know if you can use something in LUA like Curl linux tool, but with this thing you can just Test a url and use the http return code to see if the request is good.

Okok, not very helpfull in this case :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 03, 2013, 04:44:06 am

I would like to test if I can get the cover, without downloading the full image.

The HEAD method is just like the GET method, except that you only get the HTTP headers (including 200 OK or 404 Not Found), not the body. Looks like just what you need.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 03, 2013, 05:14:21 am
with a URL decoder tool your XBMC request look like thumb?path=image://DefaultAlbumCover.png/

Strange to have a / at the end of an picture extension but i'm not familiar with XBMC ...

When an album cover exists, I get a similar URL with image%3A%2F and the final %2F and the URL is ok.

After a WEB search, it seems that DefaultAlbumCover.png is the file name. Maybe something is wrong/missing between image and the PNG file name.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 03, 2013, 05:15:20 am

I would like to test if I can get the cover, without downloading the full image.

The HEAD method is just like the GET method, except that you only get the HTTP headers (including 200 OK or 404 Not Found), not the body. Looks like just what you need.

Thank you futzle, I will try that.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 03, 2013, 05:32:44 am
Big progress these last 2 days. Here is my current status.

Windows Media Player

XBMC

BubbleUPnP

Sonos
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 03, 2013, 06:10:48 am
Maybe I can help for Bubble Upnp, I have the paied version.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 04, 2013, 12:57:19 am
windows media connect :

ContentDirectory
 -actions
    Browse  :  ObjectID BrowseFlag Filter StartingIndex RequestedCount SortCriteria
    GetSearchCapabilities
    GetSortCapabilities
    GetSystemUpdateID
    Search   :  ContainerID SearchCriteria Filter StartingIndex RequestedCount SortCriteria
 -variable
    SystemUpdateID: 2
    TransferIDs:

ConnectionManager
   GetCurrentConnectionIDs
   GetCurrentConnectionInfo  : ConnectionID
   GetProtocolInfo
 -Variables:
    CurrentConnectionIDs  0
    SinkProtocolInfo
    SourceProtocolInfo    CurrentConnectionIDs: 0
SinkProtocolInfo:
SourceProtocolInfo:      http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_50_AC3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_60_AC3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HP_HD_AC3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_AAC_MULT5_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_AC3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_MPEG1_L3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_SD_AAC_MULT5_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_SD_AC3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_SD_MPEG1_L3_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_HD_NA_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AC3,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_CIF15_AAC_520,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_CIF30_AAC_940,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_L31_HD_AAC,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_L32_HD_AAC,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_BL_L3L_SD_AAC,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_HP_HD_AAC,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_HD_1080i_AAC,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_HD_720p_AAC,http-get:*:video/mp4:DLNA.ORG_PN=MPEG4_P2_MP4_ASP_AAC,http-get:*:video/mp4:DLNA.ORG_PN=MPEG4_P2_MP4_SP_VGA_AAC,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_50_AC3,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_50_AC3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_60_AC3,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_60_AC3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HP_HD_AC3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_HD_AAC_MULT5,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_HD_AAC_MULT5_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_HD_AC3,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_HD_AC3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_HD_MPEG1_L3,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_HD_MPEG1_L3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_SD_AAC_MULT5,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_SD_AAC_MULT5_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_SD_AC3,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_SD_AC3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_SD_MPEG1_L3,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_MP_SD_MPEG1_L3_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_NA,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_NA_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPLL_BASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_BASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_MP3,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMALSL,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMALSL_MULT5,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320,http-get:*:audio/3gpp:DLNA.ORG_PN=AAC_ISO_320,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_MULT5_ISO,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM,http-get:*:image/jpeg:*,http-get:*:video/avi:*,http-get:*:video/divx:*,http-get:*:video/x-matroska:*,http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/x-msvideo:*,http-get:*:video/x-flv:*,http-get:*:video/x-tivo-mpeg:*,http-get:*:video/quicktime:*,http-get:*:audio/mp4:*,http-get:*:audio/x-wav:*,http-get:*:audio/x-flac:*,http-get:*:application/ogg:*

X_MS_MediaReceiverRegistrar
    IsAuthorized  : DeviceID
    IsValidated    : DeviceID
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 04, 2013, 03:08:14 am
And what ? :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 04, 2013, 11:59:00 am
and u are correct :-)
it does not provide information on what is playing where
you tried Plex with ur plugin ? http://www.plexapp.com/ (http://www.plexapp.com/)
i have also a samsung tv with DLNA options that i can provide info on. whatever you need to help u out.
on XMBC : you tried putting a few "....." in front of the TTS.. might give it enough time to overcome the not hearable part before speaking
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 04, 2013, 06:10:10 pm
you tried Plex with ur plugin ? http://www.plexapp.com/ (http://www.plexapp.com/)

No but I will not test with all existing DMR on the market. Each user will be able to test.

Quote
on XMBC : you tried putting a few "....." in front of the TTS.. might give it enough time to overcome the not hearable part before speaking

Yes, I imagine it could solve the issue with XBMC.

Unfortunately, Google TTS is no more working for me suddenly since two days. I don't know why.
I have to debug to see what's wrong.
I am afraid that my IP could have been blacklisted by the Google service...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 04, 2013, 10:39:43 pm
i heard other users complain about the google TTS so im sure its not ur program.. dont bother debugging if it worked before. there must be other reason like what u say IP blacklisted or something.
im happy to test my samsung DMR and plex with ur program :-)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 06, 2013, 09:11:00 am
My TODO list is decreasing and I still think I should be able to provide a first version for beta testing the comming week-end.

I have done additional tests using the Media Renderer included in the Intel UPnP toolset. It allowed me to fix two bugs, one relative to the SOAP result message that can be formatted (cariage return, blanks, ...) and another relative to the possible valiues of a boolean variable (mute for example) that can be "true", "yes", "false" or "no", in complement to "0" and "1".

The main items in my TODO list are now:
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 08, 2013, 08:50:00 am
I have now only the Javascript conflicts between this plugin and the Sonos plugin to solve and I will be able to release something...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 08, 2013, 08:34:59 pm
Thanks you to keep us up to date.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 09, 2013, 06:57:57 am
I will prepare a first version this night.

I have now even added Media Server discovering and browsing.
Nevertheless, what is missing is in the UI is a way to go back to the parent container when navigating through the media.

To have a full DLNA control point implementation, it remains to implement a clean connection between DMS and DMR.
It is already working when the server provides URI + A/V format supported by the DMR. For example, a media server providing an HTTP URI with a MP3 file will be supported by XBMC or Windows Media Player. But it is not the right way to do it.

I am now closed to a complete DLNA control point.
Title: Re: Common library and services for UPnP control
Post by: lolodomo on November 09, 2013, 08:15:11 am
PS: finally XBMC seems to not be a UPnP Media Server, there is no browse capability exposed to UPnP. It is a Media Player + Media Renderer.

I am really stupid. It is just a setting to enable. Now I see XBMC as a UPnP Media Server too.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 09, 2013, 07:55:41 pm
The very first version of the plugin can be download here (ZIP archive at the bottom of this page): http://code.mios.com/trac/mios_dlna-cntroller/browser/tags/0.1#

It is a classical installation, meaning you have to upload all the files with the Vera UI, except the PNG file that requires to be uploaded using WinSCP in directory /www/cmh/skins/default/icons/
Then create a new device using D_DLNAMediaController1.xml. Don't care about the IP. Restart LUA. When restarted, refresh your browser cache (Ctrl+F5). Then open the Settings tab to select your DMR, either using the UPnP discovery or filling in the UPnP device description URL. Wait few seconds until the setup is done and that's all, you can now open the Player tab.

I hope I can get soon a new project in code.mios.com. It would help to store sources and create a wiki page with few instructions.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 05:19:38 am
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 !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Thiemen on November 10, 2013, 05:22:27 am
Thanks for the effort you put into this!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 06:20:57 am
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).

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

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

 8)

Quote
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.

Quote
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)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 07:39:13 am
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.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 08:04:41 am
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.

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

Quote
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 ?

Quote
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...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 08:40:03 am
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 :) ), 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 :P ;) so I must go...

Be sure I'll post update as soon as I can ! (if I'm already alive)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 08:40:38 am
Bubble Upnp (1.7.4) on a Nexus 7
Edit : Can play MP3 from Plex ML (was a server side problem)

Ok, I prefer ;) because it is working for me from XBMC to BubbleUPnP (including album art and media details).
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 08:49:00 am
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...

So it is clarly the main problem to solve.

Maybe my plugin is not fully UPnP compliant too... :)

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

Quote
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.

Quote
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.

Quote
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)

:) :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 08:52:50 am
Last thing .... OMG I'm writting in secret :)

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

<res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.0.11:57645/shoutcast/H4sIAAAAAAAAAMsoKSmw0tfPLTDWy8ksS9UrKdMtSkzJzNdLzs_VT85ILcpMjU_L1U_MyQHx4g2NTIwNDfSAygEiWdeWOQAAAA==.mp3</res>

When I looked to the source URL, It seem bubble upnp do a shoutcast proxy because .11 is bubble upnp IP address.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 09:15:43 am
Last thing .... OMG I'm writting in secret :)

:)

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

<res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.0.11:57645/shoutcast/H4sIAAAAAAAAAMsoKSmw0tfPLTDWy8ksS9UrKdMtSkzJzNdLzs_VT85ILcpMjU_L1U_MyQHx4g2NTIwNDfSAygEiWdeWOQAAAA==.mp3</res>

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.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 09:17:51 am
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.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 11:36:31 am
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...

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.

Ready to test.

I also tried to put my Vera directly connected to my router, same effect.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 11:57:58 am
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...

No. The second line seems to be ok for a MP3 file.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 11:59:12 am
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.

Ready to test.

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

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

Code: [Select]
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
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 12:23:40 pm
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 ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 12:49:22 pm
A last test. Replace

Code: [Select]
    local devices = UPnP_discover("urn:schemas-upnp-org:device:MediaRenderer:1")
by

Code: [Select]
    local devices = UPnP_discover("upnp:rootdevice")
Be carreful, it will return a lot of devices.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 01:18:28 pm
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 ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 01:30:11 pm
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 ...

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 :(
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 01:32:41 pm
Can we try to debug the last problem that could be a bug on my side: notifications not working with your Linux renderer ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 10, 2013, 01:54:57 pm
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 !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 02:02:03 pm
OK, no problem.
You already provide a big feedback in few hours
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: strangely on November 10, 2013, 02:14:37 pm
Just some quick feedback to say I've tried it out quickly with XBMC (on Raspberry Pi) and it can see and communicate with it. Not really tried much with it yet,  however TTS works :)

I can see my Panasonic TV too.

Will try a bit more later when I have some media hooked up.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fhreid on November 10, 2013, 02:53:13 pm
Hi lolodomo,

I installed new plug and it seemed to work at first.  I can see my renderer (Panasonic KDL-55EX720).  I can mute and send tts to it.

However, the controller (server) fails to discover any control points.  Using Device Spy, I can see a half dozen on my home network.  The Discover button says scanning and is disabled.  It remains in this state.

Looks great so far!! 
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 03:52:28 pm
Hi lolodomo,

I installed new plug and it seemed to work at first.  I can see my renderer (Panasonic KDL-55EX720).  I can mute and send tts to it.

That's really cool if it works with Sony and Panasonic. That's a good start point.

Quote
However, the controller (server) fails to discover any control points.  Using Device Spy, I can see a half dozen on my home network.  The Discover button says scanning and is disabled.  It remains in this state.

Sorry but that is not clear, maybe just due to bad terminology.
The plugin is a control point, meaning it can make a Media Server communicate with a Media Renderer.
The plugin discovers Media Renderers in the Settings tab (button "Discover") and Media Servers in the Player Tab (button "Refresh"). In any case, it will discovers control points.
So what discovery is not working ? Which tab ? Did you wait for enough time (it takes few seconds to discover) ?

Did you setup your Panasonic renderer "manually" ?

If you have problems with discovery, please try the code I provided few posts before, either using "urn:schemas-upnp-org:device:MediaRenderer:1" for Media Renderers or "urn:schemas-upnp-org:device:MediaServer:1" for Media Servers.

And don't forget that UPnP discovery can require a particular setup of your Vera (at least VeraLite): http://forum.micasaverde.com/index.php/topic,16905.msg132502.html#msg132502
Don't hesitate to communicate if you have to do this setup change, and if you have a Vera 3 or a VeraLite.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 10, 2013, 06:27:29 pm
There is one case where the discovery buttons could remain at "scanning". It can happen if a reload is done during a discovery.
I will fix that in the next version. To unlock the buttons, open the advanced tab and clear the value of the variables DMRDiscoveryResult and DMSDiscoveryResult and then reload.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 10, 2013, 07:13:01 pm
This looks very promising - great effort.

Discovery of servers and renders works OK. I can browse through files on a Twonky media server and play them to my Sonos boxes. Mute works and TTS works. The Sonos boxes also come up as servers - I assume that's their aux line inputs?

I also have a Yamaha AV receiver but I can't see any interaction with the AV RX or control it. It may be operator error on my part. So if I directly set up the Yamaha AV receiver (using its IR remote control) to play music from the Twonky media server, that works. But I would have thought at that point the plugin would show that happening - that is display what's being played and also be able to control it?

Have attached the desc file and here is the discovery:

Code: [Select]
50 11/11/13 8:36:00.751 luup_log:0: UPnP device discovered HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
EXT:
LOCATION: http://172.22.22.24:8080/MediaRenderer/desc.xml
SERVER: KnOS/3.2 UPnP/1.0 DMP/3.5
ST: urn:schemas-upnp-org:device:MediaRenderer:1
USN: uuid:5f9ec1b3-ed59-1900-4530-00a0de911f72::urn:schemas-upnp-org:device:MediaRenderer:1

I see this error message when I try and play something on the Yamaha:

Code: [Select]
LuaInterface::CallFunction_Job device 88 function SDLNAMediaController1_DLNAMediaController1_SelectDMRDevice_run failed [string "..."]:739: attempt to index field 'UDN' (a nil value)
Minor request - it would be good if the pull down lists showed what was previously selected. They keep defaulting to the first on the list. The selected="selected" attribute can track this in the list option tags using:

Code: [Select]
pullDownList.options[i].selected = true;
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 10, 2013, 09:25:33 pm
tested on vera 3 lite:
added files (without the sonos as i dont have this) and made device with : D_DLNAMediaController1.xml and I_DLNAMediaController1.xml  rebooted vera.
autodiscovery detects in settings: Samsung TV UE46ES8000 (http://192.168.1.20:7676/smp_16_ (http://192.168.1.20:7676/smp_16_))
                                    in player : asus router (windows media connect compatible) , PLEX mediaserver, Windows Media Player sharing, PC (samsung link)

tested:
           PLAY > select from PLEX library > Bolt 3D movie > play  .. test ok, plays movie on samsung tv
           TTS : on samsung tv> not supported format or something like that as it went to fast to be able to read.. continued playing Bolt 3D movie after this
           URI: put http://broadcast.infomaniak.net/ouifm-high.mp3 (http://broadcast.infomaniak.net/ouifm-high.mp3)  in the box and pressed play.. plays Bolt 3D movie again..

conclusion:
 not needed for vera lite to change IPTables (i have autodetect UPnP devices in net-tab turned off, donno if this matter) , just put in the Implementation file in the device and reboot vera.
 thing is working OK for movies (MKV 4 high bitrate type).
 pressing volume slider on control-tab > invalid service
 seems that URI not working as it parses chosen movie again.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 04:18:14 am
tested on vera 3 lite:
added files (without the sonos as i dont have this) and made device with : D_DLNAMediaController1.xml and I_DLNAMediaController1.xml  rebooted vera.

...

 just put in the Implementation file in the device and reboot vera.

...

 pressing volume slider on control-tab > invalid service
 seems that URI not working as it parses chosen movie again.

The two service files are not for Sonos but are THE services files implemented by the plugin devices. They are required.
I have not yet changed their names because I am not sure that it can not lead to a problem for users using the Sonos plugin too.

Of course, you could create your own AVTransport and RenderingControl service files, but you can have only one instance of these services in the Vera: http://forum.micasaverde.com/index.php/topic,17280.0.html
And furthermore, the files have to be named S_SonosAVTransport1.xml and S_SonosRenderingControl1.xml because it is what is defined in the file D_DLNAMediaController1.xml.

As a conclusion, I will not study your other problems as it could be simply the consequence of the uncomplete installation of the plugin.

But if you provide your AVTransport and RenderingControl service files from your DMR, I will check if they have additional things compared to my current files, and then add them to my files.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 04:21:49 am
autodiscovery detects in settings: Samsung TV UE46ES8000 (http://192.168.1.20:7676/smp_16_ (http://192.168.1.20:7676/smp_16_))
                                    in player : asus router (windows media connect compatible) , PLEX mediaserver, Windows Media Player sharing, PC (samsung link)
...

 not needed for vera lite to change IPTables (i have autodetect UPnP devices in net-tab turned off, donno if this matter)

Interesting.

macfly and me: not working
futzle, a-lurker and you: working

Why ? That's the question...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 04:30:54 am
This looks very promising - great effort.

Discovery of servers and renders works OK. I can browse through files on a Twonky media server and play them to my Sonos boxes. Mute works and TTS works. The Sonos boxes also come up as servers - I assume that's their aux line inputs?

No.
Sonos is a DMR + a DMS. But the Sonos DMS can only be connected to a Sonos DMR. They use vendor specific protocol names.
So you can browse the server ... but that's all.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 04:36:10 am
I also have a Yamaha AV receiver but I can't see any interaction with the AV RX or control it. It may be operator error on my part. So if I directly set up the Yamaha AV receiver (using its IR remote control) to play music from the Twonky media server, that works. But I would have thought at that point the plugin would show that happening - that is display what's being played and also be able to control it?

Have attached the desc file and here is the discovery:

Code: [Select]
50 11/11/13 8:36:00.751 luup_log:0: UPnP device discovered HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
EXT:
LOCATION: http://172.22.22.24:8080/MediaRenderer/desc.xml
SERVER: KnOS/3.2 UPnP/1.0 DMP/3.5
ST: urn:schemas-upnp-org:device:MediaRenderer:1
USN: uuid:5f9ec1b3-ed59-1900-4530-00a0de911f72::urn:schemas-upnp-org:device:MediaRenderer:1

I see this error message when I try and play something on the Yamaha:

Code: [Select]
LuaInterface::CallFunction_Job device 88 function SDLNAMediaController1_DLNAMediaController1_SelectDMRDevice_run failed [string "..."]:739: attempt to index field 'UDN' (a nil value)

Very interesting. I didn't know that AV receivers were DLNA receivers.
The error is due to a parsing error of your file by my code. I will fix that as soon as possible. And I will add a control in case the parsing is not able to retrieve the UDN field.

It could be interesting to provide your AVTransport and RenderingControl files. I could add special actions provided by Yamaha.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 11, 2013, 06:00:23 am
autodiscovery detects in settings: Samsung TV UE46ES8000 (http://192.168.1.20:7676/smp_16_ (http://192.168.1.20:7676/smp_16_))
                                    in player : asus router (windows media connect compatible) , PLEX mediaserver, Windows Media Player sharing, PC (samsung link)
...

 not needed for vera lite to change IPTables (i have autodetect UPnP devices in net-tab turned off, donno if this matter)

Interesting.

macfly and me: not working
futzle, a-lurker and you: working

Why ? That's the question...
perhaps different sub-net ? the DLNA thing uses broadcast on 255.255.255.255 subnet from what i understand. or the difference lies in that we have a vera lite ?
edit:
support for Yamaha would be really great  ;D   > port of yammie avcontroller https://yavc.svn.codeplex.com/svn/ (https://yavc.svn.codeplex.com/svn/)
also a lot of new av-receivers have DLNA onboard nowadays. onkyo has one too. sony and pioneer also. most of them support only audio though
 i wonder what would be possible with the vera and the samsung tv as it gives me 3 devices:
urn:schemas-upnp-org:device:MediaRenderer:1      devicefile: D_FUP_uuid 10b07600-0018-1000-a8eb-4844f7bcb3f7.xml <mediarenderer
urn:samsung.com:device:RemoteControlReceiver:1  devicefile: D_FUP_uuid 0f7f4900-0004-1000-8793-4844f7bcb3f7.xml  <remote control for tv
urn:samsung.com:device:MainTVServer2:1               devicefile: D_FUP_uuid 0bebc200-00c8-1000-93b0-4844f7bcb3f7.xml  <second screen for digital tv output
in UI5>devices>AV-gear it doesn't show my tv
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 06:39:49 am
perhaps different sub-net ? the DLNA thing uses broadcast on 255.255.255.255 subnet from what i understand. or the difference lies in that we have a vera lite ?

We all have a VeraLite (don't know for a-lurker).
Our VeraLite is on the same subnet as the DMRs.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 06:56:47 am
support for Yamaha would be really great  ;D   > port of yammie avcontroller https://yavc.svn.codeplex.com/svn/ (https://yavc.svn.codeplex.com/svn/)
also a lot of new av-receivers have DLNA onboard nowadays. onkyo has one too. sony and pioneer also. most of them support only audio though
 i wonder what would be possible with the vera and the samsung tv as it gives me 3 devices:
urn:schemas-upnp-org:device:MediaRenderer:1      devicefile: D_FUP_uuid 10b07600-0018-1000-a8eb-4844f7bcb3f7.xml <mediarenderer
urn:samsung.com:device:RemoteControlReceiver:1  devicefile: D_FUP_uuid 0f7f4900-0004-1000-8793-4844f7bcb3f7.xml  <remote control for tv
urn:samsung.com:device:MainTVServer2:1               devicefile: D_FUP_uuid 0bebc200-00c8-1000-93b0-4844f7bcb3f7.xml  <second screen for digital tv output
in UI5>devices>AV-gear it doesn't show my tv

The first purpose of my plugin is to be a DLNA Control Point. So I will "work" with devices of type "urn:schemas-upnp-org:device:MediaRenderer:1" and "urn:schemas-upnp-org:device:MediaServer:1", not others.

Your other Samsung device types are certainly specific UPnP devices created by Samsung to control the Samsung through UPnP. For this, you need to develop a specific plugin.
BUT my lua library could certainly be of a great help for this development. It was the second purpose of my plugin: create a common library that provides a high-level access to UPnP (including @futzle's UPnP event proxy). This library is not yet fully commented. That's is in my TODO list. This library can help anybody to create a new plugin based on UPnP even without knowing SOAP messages used by UPnP or even without knowing the HTTP interface to be used with the UPnP event proxy.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 11, 2013, 08:30:17 am
Here is the Logs when I changed Volume Level On my Linux Renderer, didn't found some errors.
When I control It with Bubble Upnp, Feedback are Ok, I see Volume Level status change even if I control It from Vera (just to check if is a gmediarender problem but seem not).

Code: [Select]
08      11/11/13 14:21:44.866   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:1360c372-1dd2-11b2-9336-c95f22385e65 <0x2d5a3680>
04      11/11/13 14:21:44.869   <Job ID="567" Name="" Device="41" Created="2013-11-11 14:21:44" Started="2013-11-11 14:21:44" Completed="2013-11-11 14:21:44" Duration="0.2436000" Runtime="0.1462000" Status="Successful" LastNote=""/> <0x2b470000>
08      11/11/13 14:21:45.399   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:upnp-org:serviceId:RenderingControl action: SetVolume <0x2e5a3680>
08      11/11/13 14:21:45.399   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e5a3680>
08      11/11/13 14:21:45.399   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:RenderingControl <0x2e5a3680>
08      11/11/13 14:21:45.399   JobHandler_LuaUPnP::HandleActionRequest argument action=SetVolume <0x2e5a3680>
08      11/11/13 14:21:45.400   JobHandler_LuaUPnP::HandleActionRequest argument DesiredVolume=80 <0x2e5a3680>
08      11/11/13 14:21:45.400   JobHandler_LuaUPnP::HandleActionRequest argument rand=0.7999017278198153 <0x2e5a3680>
08      11/11/13 14:21:45.465   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyRenderingChange <0x2e5a3680>
08      11/11/13 14:21:45.465   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e5a3680>
08      11/11/13 14:21:45.466   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e5a3680>
08      11/11/13 14:21:45.466   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyRenderingChange <0x2e5a3680>
08      11/11/13 14:21:45.466   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<Volume val="80"></Volume>
<VolumeDB val="-2048"></VolumeDB>
</InstanceID>
</Event>
 <0x2e5a3680>
08      11/11/13 14:21:45.466   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:1360c372-1dd2-11b2-9336-c95f22385e65 <0x2e5a3680>
04      11/11/13 14:21:45.469   <Job ID="568" Name="" Device="41" Created="2013-11-11 14:21:45" Started="2013-11-11 14:21:45" Completed="2013-11-11 14:21:45" Duration="0.2175000" Runtime="0.1242000" Status="Successful" LastNote=""/> <0x2b470000>

As soon as I have some free time, I will change The xml file like you said and post results.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 08:45:52 am
They forgot the channel (master).
I should probably assume a default value of Master.
I will provide a fix.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 09:04:07 am
Can you show the received event for a pause command ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 11, 2013, 11:54:47 am
This is log for a pause command :

Code: [Select]
Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:AVTransport variable: RelativeTimePosition was: 0:00:21 now: 0:00:25 #hooks: 0 upnp: 0 v:0x917888/NONE duplicate:0 <0x2b470000>
06      11/11/13 17:52:26.259   Device_Variable::m_szValue_set device: 41 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1384188740 now: 1384188746 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2b470000>
04      11/11/13 17:52:26.260   <Job ID="1066" Name="" Device="41" Created="2013-11-11 17:52:23" Started="2013-11-11 17:52:23" Completed="2013-11-11 17:52:26" Duration="3.140311000" Runtime="3.138257000" Status="Successful" LastNote=""/> <0x2b470000>
08      11/11/13 17:52:35.181   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:micasaverde-com:serviceId:MediaNavigation1 action: Pause <0x2e5a3680>
08      11/11/13 17:52:35.181   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e5a3680>
08      11/11/13 17:52:35.182   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:MediaNavigation1 <0x2e5a3680>
08      11/11/13 17:52:35.182   JobHandler_LuaUPnP::HandleActionRequest argument action=Pause <0x2e5a3680>
08      11/11/13 17:52:35.182   JobHandler_LuaUPnP::HandleActionRequest argument rand=0.11442834767512977 <0x2e5a3680>
08      11/11/13 17:52:35.281   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2e5a3680>
08      11/11/13 17:52:35.282   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e5a3680>
08      11/11/13 17:52:35.282   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e5a3680>
08      11/11/13 17:52:35.282   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2e5a3680>
08      11/11/13 17:52:35.283   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<TransportState val="PAUSED_PLAYBACK"></TransportState>
<CurrentTransportActions val="PLAY,STOP,SEEK"></CurrentTransportActions>
</InstanceID>
</Event>
 <0x2e5a3680>
08      11/11/13 17:52:35.283   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:70a5b95a-1dd2-11b2-94dd-91666962d395 <0x2e5a3680>
06      11/11/13 17:52:35.404   Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:AVTransport variable: RelativeTimePosition was: 0:00:25 now: 0:00:34 #hooks: 0 upnp: 0 v:0x917888/NONE duplicate:0 <0x2b470000>
06      11/11/13 17:52:35.429   Device_Variable::m_szValue_set device: 41 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1384188746 now: 1384188755 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2b470000>

No update from Vera UI in pause play stop command too.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 11, 2013, 03:31:50 pm
On the Yamaha AV receiver - I have attached the files:

/RenderingControl/desc.xml
/ConnectionManager/desc.xml
/AVTransport/desc.xml

I have a Vera 3. Its LAN switch and its WiFi are not used. I have a separate managed switch.

Out of interest the FritzBox modem/voip boxes also have a DLNA server in them.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 04:12:38 pm
A project has been created in code.mios.com. My sources and my versions will now be available here: http://code.mios.com/trac/mios_dlna-cntroller/browser#
I will create a wiki page ... when I have time.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 05:29:19 pm
@macfly92: I know what is wrong in my code. One time again, it is a problem of XML parsing.
In general, renderers are using this format for the event notification:
Code: [Select]
<Volume val="80"/>while the Linux renderer is using this other format:
Code: [Select]
<Volume val="80"></Volume>
Of course, my code has to accept the two formats.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 11, 2013, 06:06:09 pm
@macfly92: I know what is wrong in my code. One time again, it is a problem of XML parsing.
In general, renderers are using this format for the event notification:
Code: [Select]
<Volume val="80"/>while the Linux renderer is using this other format:
Code: [Select]
<Volume val="80"></Volume>
Of course, my code has to accept the two formats.

Ok, just ask me if you need anything else.
About your repository in Mios System, at this moment is it the same has you have posted before ? (no need to update?)

Thanks you again for this wonderful work.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 11, 2013, 07:22:55 pm
Ok, please find here: http://code.mios.com/trac/mios_dlna-cntroller/browser/trunk#
Only two files changed: I_DLNA...xml and L_DLNA...lua

What's new:
- Fix parsing of event notification (Linux renderer)
- Fix parsing of device description file (Yamaha renderer)
- Fix escaping of XML special characters
- Improve performance of XML parsing
- Variables DMRDiscoveryResult and DMSDiscoveryResult reset at reload if set to "scanning"

Normally, it should solve problems mentionned by macfly92 and a-lurker.
I have done this quickly without doing full tests.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 11, 2013, 08:32:35 pm
The URL:
http://code.mios.com/trac/mios_dlna-cntroller/browser/trunk#

gives:

Repository Hosting Trac Project
This a private project hosted by repositoryhosting.com.
You are currently not logged in. You may want to do so now.


have I, somehow, got an account on this?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 11, 2013, 09:28:29 pm

This a private project hosted by repositoryhosting.com.

I seem to recall that the developer has to enable guest access for the browser. And, for that matter, every other page (e.g., the wiki landing page).
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 12, 2013, 01:10:30 am
Access is now enabled.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 12, 2013, 02:33:26 am
Yamaha AVR now recognised - displays model number as text and an associated icon pops up, so definitely an improvement. Still can't control it though.

I get this during LUUP restart:

Code: [Select]
08 11/12/13 18:04:29.173 JobHandler_LuaUPnP::HandleActionRequest device: 88 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x3113c680>
08 11/12/13 18:04:29.174 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=88 <0x3113c680>
08 11/12/13 18:04:29.174 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x3113c680>
08 11/12/13 18:04:29.174 JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x3113c680>
08 11/12/13 18:04:29.174 JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
  <InstanceID val="0">
    <TransportState val="NO_MEDIA_PRESENT"/>
    <TransportStatus val="OK"/>
    <PlaybackStorageMedium val="NONE"/>
    <RecordStorageMedium val="NOT_IMPLEMENTED"/>
    <PossiblePlaybackStorageMedia val="NONE,NETWORK"/>
    <PossibleRecordStorageMedia val="NOT_IMPLEMENTED"/>
    <CurrentPlayMode val="NORMAL"/>
    <TransportPlaySpeed val="1"/>
    <RecordMediumWriteStatus val="NOT_IMPLEMENTED"/>
    <CurrentRecordQualityMode val="NOT_IMPLEMENTED"/>
    <PossibleRecordQualityModes val="NOT_IMPLEMENTED"/>
    <NumberOfTracks val="0"/>
    <CurrentTrack val="0"/>
    <CurrentTrackDuration val="0:00:00"/>
    <CurrentMediaDuration val="0:00:00"/>
    <CurrentTrackMetaData val=""/>
    <CurrentTrackURI val=""/>
    <AVTransportURI val=""/>
    <AVTransportURIMetaData val=""/>
    <NextAVTransportURI val="NOT_IMPLEMENTED"/>
    <NextAVTransportURIMetaData val="NOT_IMPLEMENTED"/>
    <CurrentTransportActions val=""/>
  </InstanceID>
</Event> <0x3113c680>
08 11/12/13 18:04:29.175 JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:89ad9518-13e8-105b-a75a-a73ae6d77a4f <0x3113c680>
08 11/12/13 18:04:29.197 JobHandler_LuaUPnP::HandleActionRequest device: 88 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyRenderingChange <0x30efb680>
08 11/12/13 18:04:29.197 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=88 <0x30efb680>
08 11/12/13 18:04:29.198 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x30efb680>
08 11/12/13 18:04:29.198 JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyRenderingChange <0x30efb680>
08 11/12/13 18:04:29.198 JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/">
  <InstanceID val="0">
    <PresetNameList val="FactoryDefaults, InstallationDefaults"/>
    <Mute channel="Master" val="0"/>
    <Volume channel="Master" val="90"/>
  </InstanceID>
</Event> <0x30efb680>
08 11/12/13 18:04:29.199 JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:f904b0b6-5980-1269-98dd-413d4822aa1e <0x30efb680>
04 11/12/13 18:04:29.232 <Job ID="21" Name="" Device="88" Created="2013-11-12 18:04:29" Started="2013-11-12 18:04:29" Completed="2013-11-12 18:04:29" Duration="0.55896000" Runtime="0.41010000" Status="Successful" LastNote=""/> <0x2af46000>
04 11/12/13 18:04:29.236 <Job ID="22" Name="" Device="88" Created="2013-11-12 18:04:29" Started="2013-11-12 18:04:29" Completed="2013-11-12 18:04:29" Duration="0.35911000" Runtime="0.2518000" Status="Successful" LastNote=""/> <0x2af46000>

If I dial up a music file using the plugin that works but when I hit the Play button I get this:

Code: [Select]
08 11/12/13 18:05:22.816 JobHandler_LuaUPnP::HandleActionRequest device: 88 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayItem <0x304fb680>
08 11/12/13 18:05:22.816 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=88 <0x304fb680>
08 11/12/13 18:05:22.817 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x304fb680>
08 11/12/13 18:05:22.817 JobHandler_LuaUPnP::HandleActionRequest argument action=PlayItem <0x304fb680>
08 11/12/13 18:05:22.817 JobHandler_LuaUPnP::HandleActionRequest argument ItemID=0$1$11$19091R6960650 <0x304fb680>
01 11/12/13 18:05:23.311 luup_log:88: DLNA: error UPnP_request (Stop, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>701</errorCode>
<errorDescription>Transition not available</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x304fb680>
01 11/12/13 18:05:23.363 luup_log:88: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>501</errorCode>
<errorDescription>Action Failed</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x304fb680>
01 11/12/13 18:05:23.371 luup_log:88: DLNA: error UPnP_request (Play, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>701</errorCode>
<errorDescription>Transition not available</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x304fb680>

I'm not sure how the Yamaha AVR should be set up. It has a Net button on the remote that gives three pages:

Sort of implies that you should select a DLNA Mediaserver ie my Thonky server and then the plugin will see that running and be able to control it?

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 12, 2013, 02:54:46 am
For my part, the Linux Renderer (Gmrender-resurect) status feedback works perfectly in this version !
Volume +/- , Play, Pause, track status, and feedback even If I controlled it from another remote.

I just have to uncheck "Buttons state controlled by Media Renderer" to have command on this page, (but not in command tab).

Thanks for this improvement !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 12, 2013, 06:12:44 am
For my part, the Linux Renderer (Gmrender-resurect) status feedback works perfectly in this version !
Volume +/- , Play, Pause, track status, and feedback even If I controlled it from another remote.

I just have to uncheck "Buttons state controlled by Media Renderer" to have command on this page, (but not in command tab).

Thanks for this improvement !

 8)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 12, 2013, 06:34:47 am
Yamaha AVR now recognised - displays model number as text and an associated icon pops up, so definitely an improvement. Still can't control it though.

I get this during LUUP restart:

That looks good if nothing was being played at this time.

Quote
f I dial up a music file using the plugin that works but when I hit the Play button I get this:

Can you make tests step by step and give a feedback.

1) play with an audio file using your Yamaha remote (play, pause, stop, mute, ...) and check if the state is updated accordingly in the plugin (and if you get media information) ?

2) play an audio file using your Yamaha remote and then use the plugin controls (play, pause, stop, next, mute, ...). Is it working, including feedback state updated in the plugin ?

3) Try with the plugin to browse a media server and play a file from there. Use a media server that you know is working with your Yamaha receiver.

4? Try the manual selection at top, entering for example the URL of a WEB radio and then push button Play.

5) Try TTS; tell us if your listen something and if the previous context is restored.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 12, 2013, 07:38:56 am
And yes, it may require that your A/V receiver to be first switched to a specific mode.

On that point, macfly92 could comment on what happens with his Sony BluRay player. Is the plugin able to control the Sony player whatever it is doing (DVD, BluRay, ...), or is the plugin able to control the Sony player only when the player is in a particular mode (media mode) ?

I will control your Yamaha service files later today to see what actions are provided.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 12, 2013, 02:02:55 pm
And yes, it may require that your A/V receiver to be first switched to a specific mode.

On that point, macfly92 could comment on what happens with his Sony BluRay player. Is the plugin able to control the Sony player whatever it is doing (DVD, BluRay, ...), or is the plugin able to control the Sony player only when the player is in a particular mode (media mode) ?

I will control your Yamaha service files later today to see what actions are provided.

I used my Sony Bluray player mostly as an Audio amplifier but in my case, if i'm listening TV Audio (from a Cable box) or MP3 from My computer (another INPUT) my Player switch input as soon as it received control from Vera to play it.
I didn't test when I watched a Bluray, tell me if you need it !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 12, 2013, 04:15:20 pm
On the Yamaha AV receiver - I have attached the files:

/RenderingControl/desc.xml
/ConnectionManager/desc.xml
/AVTransport/desc.xml


Quick look at your files: they are standard DLNA files, nothing special added by Yamaha.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 13, 2013, 05:07:29 pm
I just fixed a bug preventing playing a server ressource having a & in its URL. It was the case in my RTSP media (TV channels).

I will produce a new version (0.2) this week but I would like first to finish the server media browsing. I already improove it but it does not satisfy me.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 13, 2013, 07:10:00 pm
"Quick look at your files: they are standard DLNA files, nothing special added by Yamaha."

Thanks for looking at this. After more testing it appears that the Yamaha AVR will not respond to AVTransport controls: Play Pause, Stop, etc. It looks like this is the AVR's problem, not your plugin, as I can't control it using "UPnP Inspector" either.

Using the plugin or the inspector results in "701" errors, which translate to:
"Transition not available. The immediate transition from current transport state to desired transport state is not supported by this device."

The Mute and Volume does work but only when the AVR is connected to a media server. I would have thought it would always control the mute and volume no matter what media source/input was selected. I have a set top box and I can control the mute and volume on that, no matter what source/input it's set to.

The media being played by the Yamaha AVR does not appear on the plugin either.

So that's pretty poor on Yamaha's part - I don't think there is a plugin problem in regard to the Yamaha.

One other really strange thing occurs when the Yamaha lists the media servers it can find. It shows one called "Xmaslights [17]"  and I just happen to have a Vera Scene called "Xmas lights", which is scene number 17. If I try and select it - it says "Access Denied". I can rename the scene and the new name appears on the Yamaha!!! All a bit bizarre.


Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 14, 2013, 07:56:54 am
The media being played by the Yamaha AVR does not appear on the plugin either.

Please check in the Help tab that the two metadata variazbles are empty.
If not, it could be a bug.

Quote
One other really strange thing occurs when the Yamaha lists the media servers it can find. It shows one called "Xmaslights [17]"  and I just happen to have a Vera Scene called "Xmas lights", which is scene number 17. If I try and select it - it says "Access Denied". I can rename the scene and the new name appears on the Yamaha!!! All a bit bizarre.

Oh yes, very bizarre.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 14, 2013, 05:30:18 pm
Quote
Please check in the Help tab that the two metadata variazbles are empty.
If not, it could be a bug.

These all show a blank value for the Yamaha AVR:

AVTransportURI   
AVTransportURIMetaData   
CurrentTrackURI   
CurrentTrackMetaData
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 15, 2013, 03:01:59 am
More info on the Yamaha box. I find that I can control it with bubbleupnp (Android app). The interesting thing is once I do that, the plugin can then also control it. The plugin also shows the media information as well at that point. However the plugin cannot play a URI or "Say" anything:

Ignore the "luup_log:67: YamahaReceiver: Un-handled subunit: SERVER" - that's another plugin and is harmless.

URI log - have I entered the correct URI - I note it appears to have a leading space:
Code: [Select]
08 11/15/13 18:40:03.117 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=88 <0x3059f680>
08 11/15/13 18:40:03.117 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x3059f680>
08 11/15/13 18:40:03.118 JobHandler_LuaUPnP::HandleActionRequest argument action=Play <0x3059f680>
08 11/15/13 18:40:03.118 JobHandler_LuaUPnP::HandleActionRequest argument URI= x-rincon-mp3radio://www.live365.com/play/opost57chevy <0x3059f680>
50 11/15/13 18:40:03.359 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.371 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.388 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.400 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.412 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.413 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.414 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.424 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
01 11/15/13 18:40:03.491 luup_log:88: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>600</errorCode>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x3059f680>
06 11/15/13 18:40:03.595 Device_Variable::m_szValue_set device: 88 service: urn:upnp-org:serviceId:AVTransport variable: TransportState was: PLAYING now: TRANSITIONING #hooks: 0 upnp: 0 v:0xb55108/NONE duplicate:0 <0x3059f680>
50 11/15/13 18:40:03.626 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.629 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.630 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.631 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.632 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
50 11/15/13 18:40:03.639 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31622680>
06 11/15/13 18:40:03.646 Device_Variable::m_szValue_set device: 88 service: urn:upnp-org:serviceId:AVTransport variable: CurrentTransportActions was: Pause,Stop,Next,Previous now: Stop #hooks: 0 upnp: 0 v:0xb4fb90/NONE duplicate:0 <0x3059f680>

"Say" log:
Code: [Select]
08 11/15/13 18:24:53.093 JobHandler_LuaUPnP::HandleActionRequest device: 88 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Say <0x317a4680>
08 11/15/13 18:24:53.093 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=88 <0x317a4680>
08 11/15/13 18:24:53.094 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x317a4680>
08 11/15/13 18:24:53.094 JobHandler_LuaUPnP::HandleActionRequest argument action=Say <0x317a4680>
08 11/15/13 18:24:53.094 JobHandler_LuaUPnP::HandleActionRequest argument Text=Hello Test <0x317a4680>
08 11/15/13 18:24:53.094 JobHandler_LuaUPnP::HandleActionRequest argument Language=en <0x317a4680>
06 11/15/13 18:24:53.493 Device_Variable::m_szValue_set device: 88 service: urn:upnp-org:serviceId:AVTransport variable: TransportState was: STOPPED now: PLAYING #hooks: 0 upnp: 0 v:0xaced58/NONE duplicate:0 <0x317a4680>
06 11/15/13 18:24:53.641 Device_Variable::m_szValue_set device: 88 service: urn:upnp-org:serviceId:AVTransport variable: CurrentTransportActions was: Play,Next,Previous,Seek,X_DLNA_SeekTime now: Pause,Stop,Next,Previous #hooks: 0 upnp: 0 v:0xaca5a8/NONE duplicate:0 <0x317a4680>
06 11/15/13 18:24:53.732 Device_Variable::m_szValue_set device: 88 service: urn:upnp-org:serviceId:AVTransport variable: RelativeTimePosition was: 0:00:00 now: 0:01:15 #hooks: 0 upnp: 0 v:0x96f2a0/NONE duplicate:0 <0x317a4680>
06 11/15/13 18:24:53.777 Device_Variable::m_szValue_set device: 88 service: urn:upnp-org:serviceId:RenderingControl variable: Volume was: 90 now: 70 #hooks: 0 upnp: 1 v:0xb7cee8/NONE duplicate:0 <0x317a4680>
06 11/15/13 18:24:53.778 Device_Variable::m_szValue_set device: 88 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1384499685 now: 1384500293 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x317a4680>
01 11/15/13 18:24:54.029 luup_log:88: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>714</errorCode>
<errorDescription>Illegal MIME-type</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x317a4680>
01 11/15/13 18:24:54.038 luup_log:88: DLNA: error UPnP_request (Play, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>714</errorCode>
<errorDescription>Illegal MIME-type</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x317a4680>
50 11/15/13 18:24:54.052 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.069 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.080 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.092 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.104 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.105 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.106 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:54.116 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
01 11/15/13 18:24:58.108 luup_log:88: DLNA: error UPnP_request (Stop, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>501</errorCode>
<errorDescription>Action Failed</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>] <0x2f1b5680>
50 11/15/13 18:24:58.528 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:58.544 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:58.545 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:58.546 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:58.556 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:58.568 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>
50 11/15/13 18:24:58.580 luup_log:67: YamahaReceiver: Un-handled subunit: SERVER <0x31279680>

Adding to the strangeness - I can another Vera Scene listed in bubbleupnp .

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 15, 2013, 09:45:28 am
What URI did you provide ? (you don't have the sent message in the logs ?)

For TTS, maybe http URL is not acepted by the Yamaha renderer ?

You could check what are the accepted protocols by your Yamaha DMR using Device Spy.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fhreid on November 15, 2013, 02:49:23 pm
This plug is developing nicely.  I can play vids and music from my XBMC library.  The "scanning" issue seems to have been resolved.  Haven't had a lot of luck using media player as a control to my Sony KDL as a renderer.  It discovers it but won't play the selected URI.

One thing that is a pain is that the selections in the comboboxes don't seem to persist if the control loses scope.

Also, forgive me for this newb question but what I would like to do is run a scene that pauses playback if my android phone rings.  I use tasker which can initiate a scene in vera but the device and consequently all the command buttons are disabled when I am in scene creation.  Is there a luup command I can uses to implement?

Thanks for your hard work!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 16, 2013, 04:17:48 am
i added the sonos files as u mentioned.. causing some reloads randomly on vera lite.. then i restarted the tv and rebooted vera .. seems ok now and volume up n down works now. settings>discover doesn't work anymore.. (i have samsung tv selected and this is only DMR it found, not sure if this makes a difference.. see it scanning and then nothing comes up) it finds player services though in player tab..
using TTS it seems to do something on tv and no error but i dont hear anything.. goes back to TV broadcast after done.
using play URI : http://mp1.somafm.com:8808 (http://mp1.somafm.com:8808) (/listen.pls)     .. does nothing and plays Bolt 3D movie rightafter.. while it was on TV broadcast
using play URI: http://192.168.1.2/THX-Dolby (http://192.168.1.2/THX-Dolby) DTS-Ultimate Bass Test.mp3 .. nothing.. goes back to bolt 3D movie after
using play URI: 192.168.1.2/THXTest.mp3   still nothing..  after filled in duration.. nothing.. filled in volume.. sets volume, not playing
in help :    http://192.168.1.2:32469/object/50387e6f8da6dea621cd/file.mkv (http://192.168.1.2:32469/object/50387e6f8da6dea621cd/file.mkv)  <- Bolt 3D movie... stil there after reboot and restart tv
used new version of I_DNLA..... and L_DNLA....

logoutput:
Code: [Select]
08   11/16/13 10:43:45.627   JobHandler_LuaUPnP::HandleActionRequest device: 118 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Play<0x2f510680>
08   11/16/13 10:43:45.628   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=118 <0x2f510680>
08   11/16/13 10:43:45.628   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2f510680>
08   11/16/13 10:43:45.628   JobHandler_LuaUPnP::HandleActionRequest argument action=Play <0x2f510680>
08   11/16/13 10:43:45.629   JobHandler_LuaUPnP::HandleActionRequest argument URI=192.168.1.2/THXTest.mp3 <0x2f510680>
10   11/16/13 10:43:45.650   UPnPCallbackEventHandler 4 start PIDLOG2 26715 <0x2f110680>

10   11/16/13 10:43:45.759   UPnPCallbackEventHandler 4 start PIDLOG2 26715 <0x2f310680>

10   11/16/13 10:43:45.789   UPnPCallbackEventHandler 4 start PIDLOG2 26715 <0x2f110680>

10   11/16/13 10:43:45.899   UPnPCallbackEventHandler 4 start PIDLOG2 26715 <0x2f310680>

06   11/16/13 10:43:46.409   Device_Variable::m_szValue_set device: 118 service: urn:upnp-org:serviceId:AVTransport variable: TransportState was: STOPPED now: TRANSITIONING #hooks: 0 upnp: 0 v:0x10f9f88/NONE duplicate:0 <0x2f510680>

Code: [Select]
08   11/16/13 11:06:33.104   JobHandler_LuaUPnP::HandleActionRequest device: 118 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Play <0x2f8e6680>
08   11/16/13 11:06:33.104   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=118 <0x2f8e6680>
08   11/16/13 11:06:33.104   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2f8e6680>
08   11/16/13 11:06:33.105   JobHandler_LuaUPnP::HandleActionRequest argument action=Play <0x2f8e6680>
08   11/16/13 11:06:33.105   JobHandler_LuaUPnP::HandleActionRequest argument URI=http://192.168.1.2/Cest lavie - Robbie Nevil.MP3 <0x2f8e6680>
08   11/16/13 11:06:33.105   JobHandler_LuaUPnP::HandleActionRequest argument Volume=20
01   11/16/13 11:06:33.639   luup_log:118: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>716</errorCode><errorDescription>Resource not found</errorDescription></UPnPError></detail></s:Fault>
</s:Body>
</s:Envelope>] <0x2f8e6680>
06   11/16/13 11:06:34.271   Device_Variable::m_szValue_set device: 118 service: urn:upnp-org:serviceId:AVTransport variable: TransportState was: STOPPED now: TRANSITIONING #hooks: 0 upnp: 0 v:0xbd70a8/NONE duplicate:0 <0
with e with ' on top of it (forum dont like the alt characters it seems) caused vera crash and reboot.. replace with e >error  ..in browser> plays mp3
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 05:28:04 am
Also, forgive me for this newb question but what I would like to do is run a scene that pauses playback if my android phone rings.  I use tasker which can initiate a scene in vera but the device and consequently all the command buttons are disabled when I am in scene creation.  Is there a luup command I can uses to implement?

I can create a scene with the Vera UI5 to control the DLNA device. It works well as expected.

I don't know how tasker is working. When you say you create a scene, it is in tasker or in Vera ?

Did you install all the files I provided ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 16, 2013, 05:38:48 am
same here.. create scene in UI5 > all buttons not responding and cannot be chosen
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 05:53:00 am
i added the sonos files as u mentioned.. causing some reloads randomly on vera lite.. then i restarted the tv and rebooted vera .. seems ok now and volume up n down works now.

I thought again about this, and my feeling (not tested) is that these service files are required only if you want to control your device in Vera scenes. If you don't want this Vera feature, you can probably forget the AVTransport and RenderingControl services with the additional condition that you probably need to update the DLNA device description to suppress the reference to these services.

Quote
settings>discover doesn't work anymore.. (i have samsung tv selected and this is only DMR it found, not sure if this makes a difference.. see it scanning and then nothing comes up) it finds player services though in player tab..

Strange as it is the same function used in the settings tab and in the player tab, used with a different searched taget (DMR vs DMS).
If DMS are found, it means the network setup of your Vera is ok, it is not the problem we encounter macfly and me.
Remember that by default the lists are not refreshed. You need to push discover to start a new discovery.

Quote
using TTS it seems to do something on tv and no error but i dont hear anything.. goes back to TV broadcast after done.
using play URI : http://mp1.somafm.com:8808 (http://mp1.somafm.com:8808) (/listen.pls)     .. does nothing and plays Bolt 3D movie rightafter.. while it was on TV broadcast
using play URI: http://192.168.1.2/THX-Dolby (http://192.168.1.2/THX-Dolby) DTS-Ultimate Bass Test.mp3 .. nothing.. goes back to bolt 3D movie after
using play URI: 192.168.1.2/THXTest.mp3   still nothing..  after filled in duration.. nothing.. filled in volume.. sets volume, not playing

All this finally corresponds to the same test, a MP3 file through HTTP.
What messages do you have in the logs.

This is apparently the same problem as with the Sony BR player. Your Samsung TV may reject this kind of URI.
Remember that MP3 is not a mandatory format for DLNA compatibility. You might first try using a format that is mandatory for a DLNA compatibility.

Regarding your logs, error 716 for SetAVTransportURI means "The specified resource cannot be found in the network".

Something else to try is to use another DLNA control point and check if you can handle these URL. It could help to understand if it is a bad implementation on my side, or simply a reject by your renderer.


Quote
with e with ' on top of it (forum dont like the alt characters it seems) caused vera crash and reboot.. replace with e >error  ..in browser> plays mp3

Sorry, I don't understand this sentence. You mean you found a way to play MP3. What shall I change exactly ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 06:01:14 am
same here.. create scene in UI5 > all buttons not responding and cannot be chosen

What buttons ? You mean the "Add" button in front of "pick a device" in the advanced tab ?

I am using Vera firmware 1.5.622 and tried with IE 9 and Firefox.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 06:09:00 am
For all users having URI compatibility issues with your Yamaha, Sony, Samsung ... renderers, please try first with another known stable DLNA Control Point (on PC or else). If it does not work with other applications, it probably means that you renderer simply rejects this kind of URI and then I am sorry but I can do nothing for you. In the reverse case, that means there is hope and we will continue to search the reason.

In a next version, I will display in the Help tab a new table showing what protocols are accepted by your DMR. It could  help us to understand ... or not !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 16, 2013, 06:13:35 am

Quote
with e with ' on top of it (forum dont like the alt characters it seems) caused vera crash and reboot.. replace with e >error  ..in browser> plays mp3
Sorry, I don't understand this sentence. You mean you found a way to play MP3. What shall I change exactly ?

I think it means: putting non-ASCII characters in filenames (such as e-with-acute-accent U+E9) causes a crash. Usually this comes about when someone sends characters in Latin-1 encoding when the other end was expecting UTF-8.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 06:16:27 am
Another thing is that my code still does not communicate with the connection manager of the DMR. As I understood, the normal way would be to ask the connection manager for a new AVTransport instance ... and then use this instance ID. I systematically use instance ID 0.

I doubt but maybe it could be the reason of your problems.

The missing part of the DLNA implementation will be added in a future version.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 06:22:44 am

Quote
with e with ' on top of it (forum dont like the alt characters it seems) caused vera crash and reboot.. replace with e >error  ..in browser> plays mp3
Sorry, I don't understand this sentence. You mean you found a way to play MP3. What shall I change exactly ?

I think it means: putting non-ASCII characters in filenames (such as e-with-acute-accent U+E9) causes a crash. Usually this comes about when someone sends characters in Latin-1 encoding when the other end was expecting UTF-8.

I have not noticied crash of the Vera but I can confirm that few URI returned by DMS (XBMC) having characters in Latin-1 encoding are currently not working. That's something I have to understand and debug.
Strangely, I can systematically reproduce it with a certain movie file, while other music files with accents are working well...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 07:28:36 am
With a file "sc?ne.mov", playback is not starting but I found no UPnP error. The URI returned by XBMC is ... /sc%25e8ne.mov

Same file content but named "scene.mov" works well. The URI returned by XBMC is .../scene.mov
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 07:46:03 am
With a file "sc?ne.mov", playback is not starting but I found no UPnP error. The URI returned by XBMC is ... /sc%25e8ne.mov

Same file content but named "scene.mov" works well. The URI returned by XBMC is .../scene.mov

%25 seems to be an escape of %.
Even if I first unescape the URL, leading to URI .../sc%e8ne.mov, it does not work.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 07:58:43 am
With a file "sc?ne.mov", playback is not starting but I found no UPnP error. The URI returned by XBMC is ... /sc%25e8ne.mov

Same file content but named "scene.mov" works well. The URI returned by XBMC is .../scene.mov

%25 seems to be an escape of %.
Even if I first unescape the URL, leading to URI .../sc%e8ne.mov, it does not work.

The problem could be that UPnP is waiting for a UTF-8 encoding ?
c3a8 would be the right UTF-8 corresponding code.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 08:43:35 am
With a file "sc?ne.mov", playback is not starting but I found no UPnP error. The URI returned by XBMC is ... /sc%25e8ne.mov

Same file content but named "scene.mov" works well. The URI returned by XBMC is .../scene.mov

%25 seems to be an escape of %.
Even if I first unescape the URL, leading to URI .../sc%e8ne.mov, it does not work.

The problem could be that UPnP is waiting for a UTF-8 encoding ?
c3a8 would be the right UTF-8 corresponding code.

When creating the SOAP message (XML) for SetAVTransportURI, I tried to replace %e8 by &#232;
Still not working.

Of course, this file is working when selected directly using the XBMC application.
I don't understand what expects XBMC and how to handle special characters.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fhreid on November 16, 2013, 08:46:01 am
Hi lolodomo:

Forgive me for being somewhat vague and convoluted about creating a scene before.

The basic scenario is this:  Create a scene that will pause my XBMC.  I tried using advanced tab "SetPlayerStatus" to "Pause" to no avail.

The Upnp control is disabled in the the Selection GUI so I can't simply click the pause button.

I believe I have all the files installed correctly as the plug functions.  I have tried this in Chrome as well as IE.

Hope this clears up my issue somewhat.  Any help would be great as this is one use of this plug that I'm pretty excited about

Thanks again
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 16, 2013, 09:03:46 am
Hi lolodomo:

Forgive me for being somewhat vague and convoluted about creating a scene before.

The basic scenario is this:  Create a scene that will pause my XBMC.  I tried using advanced tab "SetPlayerStatus" to "Pause" to no avail.

I am sorry but I still don't understand where you find something named "SetPlayerStatus" in the scene editor.
No action is named like this in the 3 service files I provide.

Do you have other installed service files of type ...AVTransport:1 or ...RenderingControl:1.
As it was explained by others, it is absolutely a case to avoid with the Vera.
What other plugins have you installed ?

Quote
The Upnp control is disabled in the the Selection GUI so I can't simply click the pause button.

What do you mean by Selection GUI ?

Please provide screenshots because I don't understand where you are, even if we use the same ui :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 16, 2013, 03:38:37 pm
I think what people are saying, is that the buttons of the player, both in the DLNA plugin and Sonos plugin, are grayed out in the Scene Editor and can't be selected for use in a scene - see graphic. In the associated json file(s) immediately below this line:

Code: [Select]
"halloIconsDir": "pics/hallo",
you can enable the buttons to be selected in the Scene Editor using this:

Code: [Select]
"inScene": "1",
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 16, 2013, 04:02:12 pm
Quote
Another thing is that my code still does not communicate with the connection manager of the DMR. As I understood, the normal way would be to ask the connection manager for a new AVTransport instance ... and then use this instance ID. I systematically use instance ID 0.

May be this is why I'm having problems. I can't get the Yamaha AVR to do anything until I use another control point to start it up. Then it works (roughly).

On the mime-types:
I can play this on my Sonos stuff and on the Yamaha I can select this radio station from it own station list and play it. But I get a mime-type error using the plugin. May be because its a stream, rather than a file?

x-rincon-mp3radio://www.live365.com/play/opost57chevy

Last thing - after messing around - the Proxy plugin now says it "Not running" but my WeMo still works. Luup engine restarts make no difference. Get this every 40 seconds or so in the log. May be Futzle can explain what makes this occur and if I can do any further tests on it, before doing a hard reset of Vera.

Code: [Select]
06 11/17/13 7:47:24.135 Device_Variable::m_szValue_set device: 69 service: urn:futzle-com:serviceId:UPnPProxy1 variable: Status was: 0 now: 0 #hooks: 0 upnp: 0 v:0xb64518/NONE duplicate:1 <0x2e6dd680>
06 11/17/13 7:47:24.136 Device_Variable::m_szValue_set device: 69 service: urn:futzle-com:serviceId:UPnPProxy1 variable: StatusText was: Not Running now: Not Running #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e6dd680>

Keep up the good work.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 16, 2013, 08:51:24 pm
URL escaping of non-ASCII characters has to follow a strict order. First the characters must be expressed as a UTF-8 byte sequence. Then each byte is percent-encoded if it needs to be. To put "sc?ne" into a URL you will say "sc%C3%A8ne".

Unfortunately, many implementations get this wrong, because developers don't test it, or because they conflate URL escaping with HTML escaping, or conflate characters with bytes. It's often very hard to tell who is at fault in any given example: the one in this thread is a classic demonstration of it.

My rule of thumb is that when dealing with the web, it is not sufficient to claim that you are OK because you are 8-bit clean. You _must_ respect Unicode.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 16, 2013, 11:53:16 pm
It's a miracle anything gets through the net! Also the Javascript escape() has been deprecated - as seen in DLNA_playUri() and Sonos_playUri():

http://stackoverflow.com/questions/75980/best-practice-escape-or-encodeuri-encodeuricomponent

This begs the question in the plugin UI on the Player tab - what should be typed into the URI entry field. A plain string or a percent escaped string? If it's a plain string then what happens if you plug in a percent escaped string? So far I've seen no difference in the result.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 17, 2013, 05:26:00 am
URL escaping of non-ASCII characters has to follow a strict order. First the characters must be expressed as a UTF-8 byte sequence. Then each byte is percent-encoded if it needs to be. To put "sc?ne" into a URL you will say "sc%C3%A8ne".

I think you're clearly in the right direction because when I select my file in XBMC, then what I see in the Vera in the received metada is a file name with c3a8.

What is this codage (c3a8) ?
Remember that when I browse the server, I got a HTTP URL with %25e8.
What character shall I put in the URL before c3a8 ?
How convert from my URL with %25e8 to the new URL including code c3a8 ?
And when I produce the XML SOAP message (UPnP request), do I have to do another conversion ?

Thanks for your help, I am clearly lost...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 17, 2013, 05:41:21 am
I think what people are saying, is that the buttons of the player, both in the DLNA plugin and Sonos plugin, are grayed out in the Scene Editor and can't be selected for use in a scene - see graphic. In the associated json file(s) immediately below this line:

Code: [Select]
"halloIconsDir": "pics/hallo",
you can enable the buttons to be selected in the Scene Editor using this:

Code: [Select]
"inScene": "1",

Ok, thank you, a drawing is always better, like we said in French.
I will enable it. As you said, it is normally only adding this line.

PS: but it clearly does not explain the mysterious "SetPlayerStatus" which is not present in thsi window too.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 17, 2013, 05:56:33 am
Quote
Another thing is that my code still does not communicate with the connection manager of the DMR. As I understood, the normal way would be to ask the connection manager for a new AVTransport instance ... and then use this instance ID. I systematically use instance ID 0.

May be this is why I'm having problems. I can't get the Yamaha AVR to do anything until I use another control point to start it up. Then it works (roughly).

You have to keep the other control point running ?
Or you just starts it and then kill it, and then it is working in the Vera ?

Quote
On the mime-types:
I can play this on my Sonos stuff and on the Yamaha I can select this radio station from it own station list and play it. But I get a mime-type error using the plugin. May be because its a stream, rather than a file?

x-rincon-mp3radio://www.live365.com/play/opost57chevy

A I explained in another post, you cannot use Sonos as a server because Sonos provides URI that can be played only by Sonos.
But just try this URL: http://www.live365.com/play/opost57chevy and it will work (works with XBMC as DMR).

Quote
Last thing - after messing around - the Proxy plugin now says it "Not running" but my WeMo still works. Luup engine restarts make no difference. Get this every 40 seconds or so in the log. May be Futzle can explain what makes this occur and if I can do any further tests on it, before doing a hard reset of Vera.

Code: [Select]
06 11/17/13 7:47:24.135 Device_Variable::m_szValue_set device: 69 service: urn:futzle-com:serviceId:UPnPProxy1 variable: Status was: 0 now: 0 #hooks: 0 upnp: 0 v:0xb64518/NONE duplicate:1 <0x2e6dd680>
06 11/17/13 7:47:24.136 Device_Variable::m_szValue_set device: 69 service: urn:futzle-com:serviceId:UPnPProxy1 variable: StatusText was: Not Running now: Not Running #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e6dd680>

Keep up the good work.

Unfortunately, I discovered that the proxy is sometimes crashing.
I have not checked if the state on the device is updated when it happens, but you can at least execute this command to check whether the proxy is alive:
Code: [Select]
ps -ef | grep upnpWhen it happens, I run these commands:
Code: [Select]
cd /etc/init.d
./upnp-proxy-daemon start
and then restarts lua.
You have to be sure that the device that is causing the crash has been stopped first. If not, it will probably send the same notification causing the proxy crash, and the proxy will crash again.

I never experiment any proxy crash until I start to debug my current problem with file name with french accents. XBMC was apparently the source of the proxy crash.
Sonos never crashes the proxy.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 17, 2013, 06:09:32 am
It's a miracle anything gets through the net! Also the Javascript escape() has been deprecated - as seen in DLNA_playUri() and Sonos_playUri():

http://stackoverflow.com/questions/75980/best-practice-escape-or-encodeuri-encodeuricomponent

This begs the question in the plugin UI on the Player tab - what should be typed into the URI entry field. A plain string or a percent escaped string? If it's a plain string then what happens if you plug in a percent escaped string? So far I've seen no difference in the result.

Yes, escape is required because if not done, the received URL by the called lua function is truncated at the first &.
Writting this sentence, I suddenly think that it could be a bug in the Javascript function to call a lua action !
Edit: escaping is certainly required because calling a lua action from the Javascript is done building a URL (Ajax.Request).

Normally, you have to use an URL without escaping it. The escape stuff has to be done by the soft.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 17, 2013, 08:00:56 am
URL escaping of non-ASCII characters has to follow a strict order. First the characters must be expressed as a UTF-8 byte sequence. Then each byte is percent-encoded if it needs to be. To put "sc?ne" into a URL you will say "sc%C3%A8ne".

I think you're clearly in the right direction because when I select my file in XBMC, then what I see in the Vera in the received metada is a file name with c3a8.

What is this codage (c3a8) ?
Remember that when I browse the server, I got a HTTP URL with %25e8.
What character shall I put in the URL before c3a8 ?
How convert from my URL with %25e8 to the new URL including code c3a8 ?
And when I produce the XML SOAP message (UPnP request), do I have to do another conversion ?

Thanks for your help, I am clearly lost...

Ok, it is now a little clearer for me.
For egrave, e8 is its ISO-8559-1 code while c3a8 is its UTF-8 code.
So, if I correctly understood, I have first to unescape my URL to convert %25e8 into %e8 and then convert %e8 to its UTF-8 code, that is %c3a8. And nothing to do when putting this URL in a XML message. Correct ?
Is there a lua library to do this conversion from ISO-8559-1 to UTF-8 ?

I will hardcode the conversion for egrave and see if it solves my problem on this particular file.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 17, 2013, 06:37:12 pm
I have written a small function to convert ISO 8859 to UTF8 (I think it works OK). It may be of use. You can run it in the Vera Lua code test area and see the results in the log file.

You can set the variable 'charISO8859number' equal to the character's ISO number eg 232 for ? and it will make it into a UTF8 string: in this case 195, 174 = C3h, A8h and print the character in the log.

In actual usage, you would get each character in your ISO8859 string and pass it through the function; using the result to make a new UTF8 string.
Title: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 17, 2013, 06:56:05 pm
lolodomo,

This is one of those things where you will have to just play with it till it works. In this specific instance, I dispute that "%25e8" is valid input, and that you shouldn't be given a string like that in the first place.

The problem may be upstream from you. One source of encoding problems is that the Vera UI web page doesn't state what encoding it is in, leaving the decision up to the browser. If the browser decides that Vera web pages are Latin-1 then the user can introduce non-UTF-8 sequences into Vera's LuaUPnP data structures, where your plugin inherits them.

Naturally, I pointed out this problem to MCV years ago, but they used the classic Unix non-defence of "8-bit clean" and decided it wasn't their problem. So now it's your problem. Edit: perhaps I was hasty; this appears to have been fixed.

Working around bad input is really hard. Encoding-detection is actually an AI problem. You probably can't make a workaround that works for everyone.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 17, 2013, 08:08:50 pm
Changing the Javascript encoding from the escape() to encodeuri() will produce the correct encoding when using the user interface:  sc%C3%A8ne

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_escape
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_encodeuri

http://meyerweb.com/eric/tools/dencoder/

Any XML you create must be in unicode (generally as UTF8). If not, it will cause a XML parse error at the server or renderer.

It may be useful to write out any URIs to the log.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 18, 2013, 02:35:29 am
I don't think Javascript is involved in my current problem.

I got the URL from a "browse" UPnP request (lua code). The URL is extracted from the returned URI meta data ("res" tag).

PS: The only link I see with Javascript is that the object to browse is coming from Javascript ... with an escape().
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 18, 2013, 04:41:18 am
PS: The only link I see with Javascript is that the object to browse is coming from Javascript ... with an escape().

But I will try with encodeURI when passing the object ID to browse in case the server is clever and see that the id is ISO-8859-1 coded ans then returns data using the same coing.

But with your example below, it looks like & is not escaped by encode URI. As I explained it is a problem when calling a Vera action.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 18, 2013, 04:44:26 am
Any XML you create must be in unicode (generally as UTF8). If not, it will cause a XML parse error at the server or renderer.

It could explain the UPnP event proxy crash we noticed ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 18, 2013, 05:36:05 am
You are conflating XML escaping (&) with URI encoding (%). There is almost no overlap in their uses.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 18, 2013, 08:00:19 am
You are conflating XML escaping (&) with URI encoding (%). There is almost no overlap in their uses.

No.

What I say is just that I cannot call a Vera action from JavaScript UI with a parameter containing a "&", at least with the function I am using. Maybe my function is wrong, I don't know.
That is the reason why I originally escaped URL in Javascript when I need to call a Vera action with this value as parameter.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 18, 2013, 08:26:13 am
To call a Vera action from Javascript, I am using Ajax.Request with a GET methiod and passing arguments (argument can be an URI).
What I have noticed is that without an excape of the "&", a parameter containing a "&" is truncated at this character.
Should I use rather a POST method to pass a URI as parameter ?
Or should I keep a kind of escaping for this specific character ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 18, 2013, 04:54:50 pm
If the URL is being used in an AJAX call - then all you need to do is encode the value of each individual parameter being used. eg

Code: [Select]
var ajaxURI = 'http://www.test.com/vera?parm1='+encodeURIComponent('?ab&d?')+'&parm2='+encodeURIComponent('#?&d');
Gives:

http://www.test.com/vera?parm1=%C3%A9ab%26d%C3%A9&parm2=%23%3F%26d

Note that I put two French e with acute - they show as ? in the code box above but have been correctly encoded as %C3%A9.


The truncation of the last parameter you mentioned, likely indicates that the ampersand is being double encoded.

You can test the results easy enough by calling them from your browser. POST gives you more encoding options but the GET can be made to work.

Currently I'm not clear where this URL is coming from. Is it entered by the user or coming off a web page or are you constructing it in code? The source of the URL may have already altered it in some way and may need to be massaged.

As Futzle says, the xml is a separate issue, which also needs to be encoded correctly.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 18, 2013, 05:18:06 pm
Quote
you cannot use Sonos as a server because Sonos provides URI that can be played only by Sonos.

Thanks for letting me know that: x-file-cifs:,  x-rincon-mp3radio:,  last.fm-radio:  etc are all SONOS specific. I thought they where more general and part of te uPNP spec. That explains why I couldn't find them there.

I have found that you cannot issue a Stop() if NO_MEDIA_PRESENT is true, according to the state diagram in the spec. What commands and or info needs to be executed/supplied to move from the NO_MEDIA_PRESENT state to the STOPPED state?

EDIT: looks like you have to issue a SetAVTransportURI

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 19, 2013, 01:31:50 am
lolodomo

Have been messing around with the Yamaha and Device Spy.

First of all if the AVR is not set to the SERVER input (as opposed to say AV1, AV2,HDMI 1, HDMI 2, etc) any commands return "501 Action Failed ". So that's fair enough.

Once the SERVER input is selected the AVR state machine is in the NO_MEDIA_PRESENT. That's OK as well. So it looks like you need to do a SetAVTransportURI command at the very start. When I do that, I get a "714 Illegal MIME-type".

If I do a GetProtocolInfo on the AVR - I get:
Code: [Select]
http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM,
http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM,
http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM,
http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM,
http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,
http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE,
http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL,
http-wavetunes:*:audio/x-ms-wma:*,
http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS,
http-get:*:image/jpeg:*

You have a function resTable = upnp.getRes(xml) that's called in PlayItem. This is the only thing I can find that seems to mentions protocols. And I can't Play an Item because the state machine is still in the NO_MEDIA_PRESENT state.

I'm just learning - but it looks like when I set SetAVTransportURI I need to also set the CurrentURIMetaData?? I think if this is blank you use a default - can I alter the default to something that may work for me? Any ideas on how I can set up SetAVTransportURI to get to the STOPPED state? I can alter the code easy enough, if you have any ideas.

Maybe the Connection manager is needed to set source and sink allowed mime types.

I saw your code scanned the protocols and I recorded this information but it doesn't mention any protocol.

Code: [Select]
<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/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:dtcp="urn:schemas-dtcp-com:metadata-1-0/" xmlns:pv="http://www.pv.com/pvns/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/">
<item id="0$1$11$26588R7890954" parentID="0$1$11$26588" restricted="1">
<dc:title>Greatest hits</dc:title>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
</item>
</DIDL-Lite> <0x30ad9680>

Hope some of this makes sense to you - It doesn't make a lot of sense to me yet!


Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 06:48:18 am
Currently I'm not clear where this URL is coming from. Is it entered by the user or coming off a web page or are you constructing it in code? The source of the URL may have already altered it in some way and may need to be massaged.

In lua,  I send a browse UPnP request to the server to get all the children. The result (XML) is stored in a variable. This variable is read by the Javascript UI. When you select an item in the UI and push the button, the object ID (coming from the XML) is passed as argument to the action through an AJAX request. The action is run, gets the object ID in parameter and asks for object metadata to the server through a new browse UPnP request. The URL is finally extracted from the value returned by the browse request.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 06:51:31 am
Quote
you cannot use Sonos as a server because Sonos provides URI that can be played only by Sonos.

Thanks for letting me know that: x-file-cifs:,  x-rincon-mp3radio:,  last.fm-radio:  etc are all SONOS specific. I thought they where more general and part of te uPNP spec. That explains why I couldn't find them there.

"x-" is for vendor specific protocol, meaning non standard protocol.

Quote
I have found that you cannot issue a Stop() if NO_MEDIA_PRESENT is true, according to the state diagram in the spec. What commands and or info needs to be executed/supplied to move from the NO_MEDIA_PRESENT state to the STOPPED state?

EDIT: looks like you have to issue a SetAVTransportURI

Yes, you have to load/define the media to play, meaning you have to call SetAVTransportURI.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 07:09:46 am
First of all if the AVR is not set to the SERVER input (as opposed to say AV1, AV2,HDMI 1, HDMI 2, etc) any commands return "501 Action Failed ". So that's fair enough.

OK

Quote
If I do a GetProtocolInfo on the AVR - I get:
Code: [Select]
http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM,
http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM,
http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM,
http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM,
http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,
http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE,
http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL,
http-wavetunes:*:audio/x-ms-wma:*,
http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS,
http-get:*:image/jpeg:*

In theory, my feeling (knowledge at this point) is that this one should be ok for what we want:
http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,

But macfly has a similar issue with its Sony BR player.

Quote
I'm just learning - but it looks like when I set SetAVTransportURI I need to also set the CurrentURIMetaData?? I think if this is blank you use a default - can I alter the default to something that may work for me? Any ideas on how I can set up SetAVTransportURI to get to the STOPPED state? I can alter the code easy enough, if you have any ideas.

Providing metada is not mandatory, I think.
As you previously said, you have to set a media to switch in the STOP state.

Quote
Maybe the Connection manager is needed to set source and sink allowed mime types.

Connection manager will mainly allow checking that the source is compatible with the renderer.
Getting a new AVTRansport ID could be important for certain DMR, I am not sure about that. But using Connection manager is the right way defined in the spec.

Quote
I saw your code scanned the protocols and I recorded this information but it doesn't mention any protocol.

Code: [Select]
<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/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:dtcp="urn:schemas-dtcp-com:metadata-1-0/" xmlns:pv="http://www.pv.com/pvns/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/">
<item id="0$1$11$26588R7890954" parentID="0$1$11$26588" restricted="1">
<dc:title>Greatest hits</dc:title>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
</item>
</DIDL-Lite> <0x30ad9680>

Interesting.
I have to add a control in case there is no res tag provided. I should avoid setting and playing a media in this case, because there is nothing to set !
The SetAVTransportURI is certainly called with "" as URI.

But the question is why no res is provided ?
Could you check whether the value of the variable browseResult, updated when you browse to the container containing your item, contains or not res tags ? You should see the value change of the variable in the logs.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 19, 2013, 07:29:58 am
the sonos files are required for me to be able to use the volume up/down so i keep this as this is a nice addition. it is strange however that my samsung DMR is not found anymore after putting the sonos files in. i dont know how to remove the sonos files from my vera so i can't test it right now if DMR discovery would work without these files. also not sure if samsung DMR should be found as i have set it allready as the default.
inscene:1 would be the thing that makes the scene usage work. shouldn't be to hard to make it work.
like futzle mentioned i meant indeed the "putting non-ASCII characters in filenames (such as e-with-acute-accent U+E9) causes a crash"
i dont know if it would work but perhaps you can set the codepage in java so it forces it to use one particular codepage, preferably utf-8 as this is most common and regionless. however i notice browsers do not often like utf-8 as also being seen with this forum here that puts "?" instead of a e-accent. perhaps this is also a part of the problem, so maybe its better to use the unicode or indian coding. i cannot say much about this as i have no idea which one is being used by vera and dlna. my samsung DMR can play allmost anything i throw at it and i have been testing again and recorded the error message on tv so i could read it as it went to fast to normally read it. i played back the recording step by step and it comes down to the samsung not being able to find the filename parsed to it. so this brings us to the topic of uri encoding again. gotta find out where it goes wrong with the url encoding and why. this seems to be not so simple as it looks :-/
i can try with a uri with just a picture in it and name this pic.jpg when im home. or maybe someone here can try this.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 08:27:31 am
the sonos files are required for me to be able to use the volume up/down so i keep this as this is a nice addition. it is strange however that my samsung DMR is not found anymore after putting the sonos files in. i dont know how to remove the sonos files from my vera so i can't test it right now if DMR discovery would work without these files. also not sure if samsung DMR should be found as i have set it allready as the default.

There is absolutely no link between these two files and the UPnP discovery code I am using.
To convince you, you have to ssh to your Vera, go to the directory containing all the plugin files (lzo extension) and delete the two service files.

Quote
my samsung DMR can play allmost anything i throw at it and i have been testing again and recorded the error message on tv so i could read it as it went to fast to normally read it. i played back the recording step by step and it comes down to the samsung not being able to find the filename parsed to it. so this brings us to the topic of uri encoding again. gotta find out where it goes wrong with the url encoding and why. this seems to be not so simple as it looks :-/

There is no special characters in your URLs ? So no scaped characters ?


We have to avoid mixing up the problems.
We have identified 2 problems:
1 - management of URL having non standard characters
2 - setting a HTTP MP3 URI to certain DMR is not working (Sony, Yamaha, Samsung).

First problem is clearly a plugin issue.
Second problem could be either a plugin issue or simply a DMR incompatibility.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on November 19, 2013, 08:39:39 am
ok so i wont bother then to test the removal of the 2 files. i believe you on your word :-)
nop no special character. i used abc.mp3
could be the DMR or webserver that parses the file.. i have no idea and no means to test it. perhaps someone can provide me the intel pnp prog ?
im using this upnptest64 ( https://houseofyu.nl/UPnPTest64.exe ) now but it does not have all details i need.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 08:46:38 am
For users succeeding in playing MP3 Web Radio with your Sony/Yamaha/Samsung DMR but with no success with my plugin, a way to help me will be to play with Device Spy when the Web Radio is playing.

The information that could help me are provided by the call to GetMediaInfo. It includes CurrentURI and CurrentURIMetaData. You could try with different values for InstanceID, in case of 0 is not working.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 08:48:18 am
ok so i wont bother then to test the removal of the 2 files. i believe you on your word :-)

Try it.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 01:38:43 pm
a-lurker, a big thank you to you. It looks like your idea using encodeURI instead of escape in JavaScript solved my isuue relative to the playback of file containing french accents in its name.
 8)
It is at least ok with XBMC as Media Server and either XBMC or WMP as Media Renderer.
I will check with other media servers and I will see what happens for URL having a & as it was initially the reason of using escape...
Edit: problem with URL containing & is then confirmed (using encodeURI) ... but I will apply my over-encoding when doing the Ajax request.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 19, 2013, 02:06:22 pm
Edit: problem with URL containing & is then confirmed (using encodeURI) ... but I will apply my over-encoding when doing the Ajax request.

Replacing & by %26 in the code that call the Vera action froml Javascript solved this last problem.
 8)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: futzle on November 19, 2013, 02:57:16 pm

problem with URL containing & is then confirmed (using encodeURI) ...

See if the encodeURIComponent() function (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) works for you. It escapes ampersand, plus some other possibly problematic characters like / and #.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 19, 2013, 04:25:44 pm
AS above - if the uri is just a uri that you are just passing as a parameter value in a GET, then use encodeURIcomponent as previously described:

Code: [Select]
var test = '<URI>http://mymusic.com/GreatestHits.mp3</URI>';
var ajaxURI = 'http://www.test.com/vera?parm1='+encodeURIComponent(test);
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 19, 2013, 04:30:31 pm
Quote
check whether the value of the variable browseResult, updated when you browse to the container containing your item, contains or not res tags ? You should see the value change of the variable in the logs.

It looks like there is no "res" tag:
Code: [Select]
50 11/20/13 8:09:10.053 luup_log:88: DLNA: UPnP_request: status=1 statusMsg=200 result=[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<Result>
<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/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:dtcp="urn:schemas-dtcp-com:metadata-1-0/" xmlns:pv="http://www.pv.com/pvns/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/">
<container id="0$1$12$3798" parentID="0$1$12" restricted="1">
<dc:title>Selected Ambient Works Vol 2 (Disc 1)</dc:title>
<upnp:class>object.container.album.musicAlbum</upnp:class>
</container>
<container id="0$1$12$3780" parentID="0$1$12" restricted="1">
<dc:title>Selected Ambient Works, Vol 2 (Disc 2) (IMPORT)</dc:title>
<upnp:class>object.container.album.musicAlbum</upnp:class>
</container>
.... more containers here
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 19, 2013, 05:28:03 pm
Quote
The information that could help me are provided by the call to GetMediaInfo. It includes CurrentURI and CurrentURIMetaData. You could try with different values for InstanceID, in case of 0 is not working.

This has helped me. An example I have from the Twonky media server as shown by Device Spy:

CurrentURI - I can play this URL using FireFox browser
http://172.22.22.2:9000/disk/DLNA-PNMP3-OP01-FLAGS01700000/O0$1$8I6908938.mp3

CurrentURIMetaData
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"

The URI looks like it's constructed from the container/item id(s):

Code: [Select]
<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/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:dtcp="urn:schemas-dtcp-com:metadata-1-0/" xmlns:pv="http://www.pv.com/pvns/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/">

<item id="0$1$11$18943R6908938" parentID="0$1$11$18943" restricted="1">
<dc:title>All Brand New</dc:title>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
</item>

Here's the problem:  If I use this exact same information in Device Spy for SetAVTransportURI, it still returns with "714 Illegal Mime-type".

Also note the dollar characters in the URI - a $ is a reserved URI character like plus and comma.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 19, 2013, 08:19:40 pm
Note - this is not overly clear to me and the following may not be completely correct:

It looks like the mime type problem relates to a requirement when the source URI starts with http or https. In this case when SetAVTransportURI is called you need to use the HEAD method rather than GET or POST. When the call is made this header is added in:

header: "getcontentFeatures.dlna.org=1"

and the server replies with contentFeatures header with info along these lines.
DLNA.ORG_PN=MP3
DLNA.ORG_OP=01
DLNA.ORG_CI=0
and Content-Type with the mime-type

I believe that this information is then used when there is no "res" tag. This code gives a sense of how this works - search for the function "set_av_transport_uri_cb".

https://github.com/jku/rygel/blob/master/src/librygel-renderer/rygel-av-transport.vala

More info from:
http://forum.minimserver.com/showthread.php?tid=102&page=2
as follows here:

Quote
Some DLNA devices (in particular infamous Samsung TVs, but not only), when emitting the HTTP GET request with the stream URL to the Media Server (eg MinimServer), add a custom DLNA HTTP Header:

getcontentFeatures.dlna.org: 1

When this header is set, they expect the HTTP reply header to containing the 4th field of the protocolInfo containing DLNA profile info. For example for MP3:

contentFeatures.dlna.org: DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0

This is an oddity of DLNA but some DLNA devices will *not work* without this reply header being present, and may return an error code to the caller of SetAVTransportURI (the Control Point).

Handling this header is absolutely required to work with most DLNA TVs (Sony, LG, Samsung, ...).


More related forum discussions:
http://www.readynas.com/forum/viewtopic.php?f=76&t=63877
http://www.ps3mediaserver.org/forum/viewtopic.php?f=12&t=6039

These PDF downloads provide detailed information on the subject:
PDF 1 (http://ftp://ftp.im.must.edu.tw/download/wtlin/960906/%5BStandard%5D%20Digital%20Living%20Network%20Alliance/Past%20Document%20&%20Erratas/DLNA_Home_Networked_Device_Interoperability_Guidelines_v1%5B1%5D.0.pdf)
PDF 2 (http://ftp://ftp.im.must.edu.tw/Download/wtlin/UPnP-DLNA/%5BDLNA%5D%20Member%20Download/DLNA__Guideline.pdf)

And this site, see Section 5 starting on page 31, lists virtually every mime-type:
http://www.scribd.com/doc/118566781/DLNA-Networked-Device-Interoperability-Guidelines-Media-Format-Profiles
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 20, 2013, 12:39:45 am
OK - so I tried out the stuff discussed above. Here is the log result showing the header "contentfeatures.dlna.org:":

Code: [Select]
50 11/20/13 16:23:12.305 luup_log:0: TestDLNAgetcontentFeatures debug: Web site replied with status: 200 <0x31dd4680>
50 11/20/13 16:23:12.305 luup_log:0: TestDLNAgetcontentFeatures debug: connection: close <0x31dd4680>
50 11/20/13 16:23:12.305 luup_log:0: TestDLNAgetcontentFeatures debug: ext:  <0x31dd4680>
50 11/20/13 16:23:12.306 luup_log:0: TestDLNAgetcontentFeatures debug: content-length: 4223351 <0x31dd4680>
50 11/20/13 16:23:12.306 luup_log:0: TestDLNAgetcontentFeatures debug: last-modified: Thu, 11 Sep 2008 01:56:08 GMT <0x31dd4680>
50 11/20/13 16:23:12.306 luup_log:0: TestDLNAgetcontentFeatures debug: date: Wed, 20 Nov 2013 05:23:13 GMT <0x31dd4680>
50 11/20/13 16:23:12.307 luup_log:0: TestDLNAgetcontentFeatures debug: cache-control: no-cache <0x31dd4680>
50 11/20/13 16:23:12.307 luup_log:0: TestDLNAgetcontentFeatures debug: contentfeatures.dlna.org: DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000 <0x31dd4680>
50 11/20/13 16:23:12.307 luup_log:0: TestDLNAgetcontentFeatures debug: accept-ranges: bytes <0x31dd4680>
50 11/20/13 16:23:12.308 luup_log:0: TestDLNAgetcontentFeatures debug: transfermode.dlna.org: Streaming <0x31dd4680>
50 11/20/13 16:23:12.308 luup_log:0: TestDLNAgetcontentFeatures debug: pragma: no-cache <0x31dd4680>
50 11/20/13 16:23:12.308 luup_log:0: TestDLNAgetcontentFeatures debug: content-type: audio/mpeg <0x31dd4680>
50 11/20/13 16:23:12.309 luup_log:0: TestDLNAgetcontentFeatures debug: server: Linux/2.x.x, UPnP/1.0, pvConnect UPnP SDK/1.0, TwonkyMedia UPnP SDK/1.1 <0x31dd4680>

You only get this response header by requesting it, using the header "getcontentFeatures.dlna.org" in the GET call. I have attached some test code that can demonstrate this. By commenting out the header request in the test code,you can see the change in the response headers. You need to put in a URI that starts with http or https identified by checking for a URI in GetMediaInfo, using Device Spy, while it is playing.

It looks like the return info:  DLNA.ORG_PN=MP3  and also the value of "content-type" would then have to be feedback into the plugin code, instead of looking at the "Res" tag. Or build the "res" tag from the header info and inject it into the res code parsing.

So  I put this line into DEFAULT_METADATA (just for testing):
Code: [Select]
.. '&lt;res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3">&lt;/res>'and I can now change the Yamaha from the No_Media state to the Stopped state!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 20, 2013, 05:43:21 am
These PDF downloads provide detailed information on the subject:
PDF 1 (http://ftp://ftp.im.must.edu.tw/download/wtlin/960906/%5BStandard%5D%20Digital%20Living%20Network%20Alliance/Past%20Document%20&%20Erratas/DLNA_Home_Networked_Device_Interoperability_Guidelines_v1%5B1%5D.0.pdf)
PDF 2 (http://ftp://ftp.im.must.edu.tw/Download/wtlin/UPnP-DLNA/%5BDLNA%5D%20Member%20Download/DLNA__Guideline.pdf)
Links not working
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 20, 2013, 05:54:22 am
It looks like the return info:  DLNA.ORG_PN=MP3  and also the value of "content-type" would then have to be feedback into the plugin code, instead of looking at the "Res" tag. Or build the "res" tag from the header info and inject it into the res code parsing.

So  I put this line into DEFAULT_METADATA (just for testing):
Code: [Select]
.. '&lt;res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3">&lt;/res>'and I can now change the Yamaha from the No_Media state to the Stopped state!

Can you try with http-get:*:audio/mpeg:* please ?

What it means is that few DMR require to have res tag in the metadata when calling SetAVTransportURI.

It explains why, when using the URL field at the top of the player tab, it does not work (I am not producing a res tag in this case). In this case, I have to do what you explain (send a HEAD HTTP request to get information and then build the res data).

I will implement that.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 20, 2013, 09:08:16 am
For Twonky media server not delivering res tag and so no URI, it is not clear how I can imagine the URI.
Is the object id an nURL in this case ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 20, 2013, 05:32:47 pm
Quote
Can you try with http-get:*:audio/mpeg:* please ?

Yes this alone will allow the transition from NO_MEDIA_PRESENT to STOPPED. So the "DLNA.ORG_PN=MP3" is not required and I can play the URI OK.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 21, 2013, 02:28:05 am
Quote
For Twonky media server not delivering res tag and so no URI, it is not clear how I can imagine the URI.

Spent a lot of time trying to work out why there was no URI to be found for any of the media on the Twonky server. Turns out that in function browseContent in L_DLNAUPnPUtility.lua the filter tag should be set to * rather than blank:

Code: [Select]
          status, tmp = ContentDirectory.Browse({OrderedArgs={
                                 "ObjectID=" .. browseObj,
                                 "BrowseFlag=" .. browseFlag,
                                 "Filter=*",
                                 "StartingIndex=" .. string.format("%d", fetched),
                                 "RequestedCount=100",
                                 "SortCriteria="}})

Everything started to work at that stage. 8)

Great job you have done on the code.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 21, 2013, 02:40:17 am
Quote
For Twonky media server not delivering res tag and so no URI, it is not clear how I can imagine the URI.

Spent a lot of time trying to work out why there was no URI to be found for any of the media on the Twonky server. Turns out that in function browseContent in L_DLNAUPnPUtility.lua the filter tag should be set to * rather than blank:

Code: [Select]
          status, tmp = ContentDirectory.Browse({OrderedArgs={
                                 "ObjectID=" .. browseObj,
                                 "BrowseFlag=" .. browseFlag,
                                 "Filter=*",
                                 "StartingIndex=" .. string.format("%d", fetched),
                                 "RequestedCount=100",
                                 "SortCriteria="}})

Everything started to work at that stage. 8)

 8)
Thank you for the fix and all your help.
Do you mean that now the server delivers a res/URI and that you can browse and play anything from your Twonky server with your Yamaha receiver ? 8)

What is not yet done is filtering the right res/URI when sending the metadata, in case the server provides several alternative res/URI.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 21, 2013, 02:41:26 am
Quote
Can you try with http-get:*:audio/mpeg:* please ?

Yes this alone will allow the transition from NO_MEDIA_PRESENT to STOPPED. So the "DLNA.ORG_PN=MP3" is not required and I can play the URI OK.

That makes sense.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 21, 2013, 03:58:30 am
Quote
Do you mean that now the server delivers a res/URI and that you can browse and play anything from your Twonky server with your Yamaha receiver ?

Yes - it looks that way. But I can't test more at this time because the equipment is in use. Will test further when it's free.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 21, 2013, 05:02:46 am
On my side, I will try to find the time to produce a version 0.2 before the end of the week.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 22, 2013, 08:27:16 am
Hi all,

There is a while I didn't took some news here ! (Trapped with a IR Blaster failure on my side...)

Happy to see lot of progress, can't wait to test  your new version Lolodomo

About My Sony BR I'm pretty sure Bubble Upnp perform a Shoutcast Proxy when I play webradio on it, because I see my device continuously received and send data, and if I kill bubble Upnp, The Radio playback shutdown just after.
But not sure if is a DLNA problem or a Sony limitation... (First would be the best because is tweakable :) )
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 23, 2013, 07:07:29 am
@a-forker: unfortunately, sending a HEAD request to a WEB radio does not work/ It even locks the code in the http.request ... until the Vera finally reloads !

Try your code with for example: http://www.live365.com/play/opost57chevy

That's strange, it looks like timeout is not taken into account.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 23, 2013, 09:49:11 am
If we except the not working timeout problem probably to a MCV bug, is it normal to not have a response to a HTTP HEAD request ?

Is there an alternative using HTTP GET request but without downloading the content or only download the beginning ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 24, 2013, 09:20:25 am
Quote
Can you try with http-get:*:audio/mpeg:* please ?

Yes this alone will allow the transition from NO_MEDIA_PRESENT to STOPPED. So the "DLNA.ORG_PN=MP3" is not required and I can play the URI OK.

And finally, can you please try with http-get:*:*:* ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on November 24, 2013, 06:21:31 pm
Method: Powered up Yamaha AVR - switched to "server" input - it's in the "NO_MEDIA" state. Uploaded modified file to Vera and restarted Lupp engine. Wait for start up to complete. Went directly into player and entered "Hello" for Goggle TTS, set volume to 70 and pushed "Say" button.

This failed with an "701 Illegal mine" type error:
http-get:*:*:*

Repeat the above method with different default for "DEFAULT_METADATA" in plugin code.

This worked:
http-get:*:audio/mpeg:*
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 25, 2013, 05:46:37 am
Method: Powered up Yamaha AVR - switched to "server" input - it's in the "NO_MEDIA" state. Uploaded modified file to Vera and restarted Lupp engine. Wait for start up to complete. Went directly into player and entered "Hello" for Goggle TTS, set volume to 70 and pushed "Say" button.

This failed with an "701 Illegal mine" type error:
http-get:*:*:*

Repeat the above method with different default for "DEFAULT_METADATA" in plugin code.

This worked:
http-get:*:audio/mpeg:*

Ok, that makes sense.

As a temporary and not perfect solution in the coming version 0.2, I will set protocol http-get:*:audio/mpeg:* for all URL starting with http and ending with .mp3.
Later, I will search a solution regarding how to get content type from an URL without a risk of blocking the Vera.
Note that it is something not required when browsing a server because the server provides the protocols.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 25, 2013, 10:09:22 am
Hi Lolodomo !

I'm trying to use your great DLNA plugin working with Openremote but I have a little problem with status feedback. Let me explain :
The first goal of this test is to manage Volume in openremote of my Linux Media Renderer through your Vera DLNA Plugin.
In OR, to set Volume, here is my http web command to Vera :
http://Vera_IP:3480/data_request?id=lu_action&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&DeviceNum=41&InstanceID=0&Channel=Master&DesiredVolume=60 (where 60 is {param} in OR but not important here)
And It work perfectly, But I have no Feedback of the command ( If I changed Volume from your UI, it doesn't change status in OR)
The Openremote / Vera Status feedback work very well with Light Status/Level, or with a Variable Container that memorize my Audio/Video devices status.
Openremote use Polling Status to Vera with the Long Polling Method, as soon as the Vera have a Status update, it will throw it to Openremote.

Maybe I found what's wrong, but I'm not sure, so I need your engineering :)

This is what Openremote get from Vera Status when I push ON a light Switch :
Code: [Select]
<root full="0" loadtime="1385379912" dataversion="380254882" state="-1" comment="">
<devices>
<device altid="35" id="23" subcategory="0" room="4" parent="1" level="100" status="1" state="4" comment="Lumière: La transmission est OK"></device>
</devices>
</root>
you can noticed Vera gave the Status and the Level of the light in the update

This is what Openremote get from Vera Status when I updated the Bluray Status of my Variable Container Plugin to ON :
Code: [Select]
<root full="0" loadtime="1385379912" dataversion="380254864" state="-1" comment="">
<devices>
<device altid="" id="15" subcategory="-1" room="7" parent="0" variablename1="Bluray" variablename2="Box" variable2="off" variablename3="TV" variable3="off" variablename4="Projecteur" variable4="off" variablename5="Ecran Proj." variable5="off" variable1="on"></device>
</devices>
</root>
Here you can noticed the Variables values, especially variable1 just set to "on".

But When I set the Volume with DLNA Control point (or with OR), here is the status feedback :

Code: [Select]
<root full="0" loadtime="1385379912" dataversion="380254949" state="-1" comment="">
<devices>
<device altid="" id="41" subcategory="-1" room="0" parent="0" state="-1" comment=""></device>
</devices>
</root>

And same for Pause command :
Code: [Select]
<root full="0" loadtime="1385379912" dataversion="380255019" state="-1" comment="">
<devices>
<device altid="" id="41" subcategory="-1" room="0" parent="0" state="-1" comment=""></device>
</devices>
</root>

Here I don't see any status updated...

But when I manually retrieved the Full Status Of Vera, everything looks good :

http://Vera_IP:3480/data_request?id=status&output_format=xml

Code: [Select]
<device id="41" status="-1"><states>
[............]
<state id="174" service="urn:upnp-org:serviceId:RenderingControl" variable="Volume" value="27"/>
<state id="175" service="urn:upnp-org:serviceId:RenderingControl" variable="Mute" value="0"/></states>
<Jobs/><tooltip display="0"/></device>

Any Idea ???
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 26, 2013, 04:45:39 pm
Any Idea ???

I am not familiar neither with Openremote nor with the status command.
Maybe because the variables are refreshed with a short delay (event notification) ?




And sorry for the delay regarding release of version 0.2. I have now only one last thing to do. So maybe a release tomorrow evening.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 27, 2013, 12:22:08 pm
I am not familiar neither with Openremote nor with the status command.
Maybe because the variables are refreshed with a short delay (event notification) ?
And sorry for the delay regarding release of version 0.2. I have now only one last thing to do. So maybe a release tomorrow evening.

Forget Openremote (just to put some environment informations) ... this is more Vera Luup http api.
Polling Vera Status with web method is explain here : http://wiki.micasaverde.com/index.php/UI_Notes#Tracking_status_changes
With Dataversion timestamp to pull status, Vera only send Difference between the actual status and the status sent in the last timestamp of Dataversion.

But it is very strange because your device launch an update notification, but without the modified values contents ...
While I'm looking why, my First idea was in S_SonosRenderingControl1.xml, the stateVariable Volume have the sendEvents option set to no. I have modified it with yes value, but unfortunately it doesn't work better ...

I'm keep trying to find what's wrong...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: chixxi on November 29, 2013, 02:52:24 am
Something I really don't get at the moment is which plugin is the current one for sonos?

Does this "DLNA Media Controller plugin" replace the sonos plugin? If I understand this correctly I still need to install the Sonso Plugin to get the complete functionality.

Do I still need the UPnP Proxy (http://apps.mios.com/plugin.php?id=3716) or is this no more neccesarry when using the "DLNA Media Controller plugin"?


Just got my first sonos device today, and I am wondering which plugins I am supposed to use now?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 29, 2013, 06:54:47 am
Something I really don't get at the moment is which plugin is the current one for sonos?

Does this "DLNA Media Controller plugin" replace the sonos plugin? If I understand this correctly I still need to install the Sonso Plugin to get the complete functionality.

Do I still need the UPnP Proxy (http://apps.mios.com/plugin.php?id=3716) or is this no more neccesarry when using the "DLNA Media Controller plugin"?


Just got my first sonos device today, and I am wondering which plugins I am supposed to use now?

The DLNA plugin does not replace the Sonos plugin.
For Sonos, of course it is adviced to use the Sonos plugin.
The DLNA plugin allows to control Sonos too but with less features than with the Sonos plugin.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: chixxi on November 29, 2013, 10:41:23 am
OK, Sonos Plugin up and running. Did not test a lot yet, but so far it seems to work.

Next step is to setup XBMC (OpenElec), so far this is not discovered, even though UPnP control is enabled. But I have to read first what has already been written in this forum...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 05:58:56 am
Next step is to setup XBMC (OpenElec), so far this is not discovered, even though UPnP control is enabled. But I have to read first what has already been written in this forum...

Either the discovery code discovers DMR/DMS but not the OpenElec and we have to debug to understand why.
Either the discovery code discovers no DMR/DMS at all and in this case you could be in the same case as macfly92 and me, you have to update the network setup of your Vera: ​http://forum.micasaverde.com/index.php/topic,16905.msg132502.html#msg132502
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 08:51:18 am
I just released version 0.2.
You can download it here (ZIP archive at the bottom of this page): http://code.mios.com/trac/mios_dlna-cntroller/browser/tags/0.2#


What's new in version 0.2:
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 09:02:12 am
Regarding HTTP URL you enter in the field URI (Player tab), in the new version, I only associate a protocol (http-get:*:audio/mpeg:*) to URL ending with ".mp3". The idea is to confirm that it improoves compatibility with Sony, Samsung, ... renderers.

I am now waiting for your feedback.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 09:32:23 am
I just discovered that browsing BubbleUPnP server is not working well. I will fix that in a next version.
I have mainly worked with XBMC as server, so additional tests are certainly required with other Media Servers.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 10:13:19 am
I just discovered that browsing BubbleUPnP server is not working well. I will fix that in a next version.

Looks like a XML parsing problem in the JavaScript ! The XML looks good so I don't understand...
Edit: I think I found the reason, not yet the solution. Bubble has the fabulous idea to use  <unknown> as value in media metadata ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 30, 2013, 11:22:36 am
Hi Lolodomo !

Here's come the first feedback of the 0.2 version :

Can Browse Plex Media Server Library. Seem no problem in browsing.

Sony Bluray :

Can Discover it : YES

Cannot play song from PlexServer (works in the previous version)
Log with Automatic protocol :
Code: [Select]
08      11/30/13 17:01:21.422   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2ddcd680>
08      11/30/13 17:01:21.422   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2ddcd680>
08      11/30/13 17:01:21.422   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2ddcd680>
08      11/30/13 17:01:21.423   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2ddcd680>
08      11/30/13 17:01:21.423   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=37212eb7b3ed7d3caf52 <0x2ddcd680>
02      11/30/13 17:01:21.427   luup_log:41: DLNA: Media cannot be rendered by the selected renderer. <0x2ddcd680>

Log with protocol selected :
Code: [Select]
08      11/30/13 17:01:28.711   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2ddcd680>
08      11/30/13 17:01:28.712   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2ddcd680>
08      11/30/13 17:01:28.712   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2ddcd680>
08      11/30/13 17:01:28.712   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2ddcd680>
08      11/30/13 17:01:28.712   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=37212eb7b3ed7d3caf52 <0x2ddcd680>
08      11/30/13 17:01:28.713   JobHandler_LuaUPnP::HandleActionRequest argument Protocol=http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000 <0x2ddcd680>
02      11/30/13 17:01:28.717   luup_log:41: DLNA: Media cannot be rendered by the selected renderer. <0x2ddcd680>

Cannot play MP3 Webradio (Doesn't work in the previous version too)
Logs :
Code: [Select]
08      11/30/13 17:09:34.597   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Play <0x2ddcd680>
08      11/30/13 17:09:34.597   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2ddcd680>
08      11/30/13 17:09:34.597   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2ddcd680>
08      11/30/13 17:09:34.597   JobHandler_LuaUPnP::HandleActionRequest argument action=Play <0x2ddcd680>
08      11/30/13 17:09:34.598   JobHandler_LuaUPnP::HandleActionRequest argument URI=http://broadcast.infomaniak.net/ouifm-high.mp3 <0x2ddcd680>
01      11/30/13 17:09:34.662   luup_log:41: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>716</errorCode><errorDescription>Action SetAVTransportURI failed
01      11/30/13 17:09:34.760   luup_log:41: DLNA: error UPnP_request (Play, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>701</errorCode><errorDescription>Action Play failed

Linux GMrenderer :

Can be discovered : NO (while I can with uPnp Device Spy)

Can play Plex Media Sounds from library !
Can play WebRadio !

I must UNCHECK "Buttons state controlled by Media Renderer" to control it.

No news from my side with the lack of updated status data  from vera luup request yet ....
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 03:47:01 pm
Hi Lolodomo !

Here's come the first feedback of the 0.2 version :

Can Browse Plex Media Server Library. Seem no problem in browsing.

Sony Bluray :

Can Discover it : YES

Cannot play song from PlexServer (works in the previous version)

Hi macfly.

Please try again with the attached file.

If it works, I will release immediately a version 0.3 with this fix.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 03:53:03 pm
Sony Bluray :

Cannot play MP3 Webradio (Doesn't work in the previous version too)

As your Sony BR DMR delivers this protocol: http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_FLAGS=9d700000000000000000000000000000
the last try we can do is to replace at line 658 this
Code: [Select]
            data = '&lt;res protocolInfo="http-get:*:audio/mpeg:*">' .. uri
                       .. '&lt;/res>&lt;upnp:class>object.item.audioItem.musicTrack&lt;/upnp:class>'
by this
Code: [Select]
            data = '&lt;res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_FLAGS=9d700000000000000000000000000000">' .. uri
                       .. '&lt;/res>&lt;upnp:class>object.item.audioItem.musicTrack&lt;/upnp:class>'

Let me know if it is better or not.

Maybe, I should search the corresponding protocol from the DMR.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 04:06:32 pm
Linux GMrenderer :

Can be discovered : NO (while I can with uPnp Device Spy)

I have done no change regarding the UPnP discovery.

Did you try to increase the timeout from 5 to 10 (or even more) in the discovery example code I provided in the past ?
I think (but not sure now) that you already checked that the problem is not due to the filtering of the result. The discovery result shows no trace of this renderer ?

You renderer has a IP v4, not a IP v6 ?

If it works with Device Spy, that means that it is doable, but I have no idea what's wrong with my discovey code, or what I have to add to discover this renderer.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 30, 2013, 04:56:14 pm
I just discovered that browsing BubbleUPnP server is not working well. I will fix that in a next version.

Looks like a XML parsing problem in the JavaScript ! The XML looks good so I don't understand...
Edit: I think I found the reason, not yet the solution. Bubble has the fabulous idea to use  <unknown> as value in media metadata ...

It is now fixed. Will be included in version 0.3 that will probably be released very quickly to solve macfly's problem with Sony BR.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on November 30, 2013, 08:16:32 pm
Hi Lolodomo !

Here's come the first feedback of the 0.2 version :

Can Browse Plex Media Server Library. Seem no problem in browsing.

Sony Bluray :

Can Discover it : YES

Cannot play song from PlexServer (works in the previous version)

Hi macfly.

Please try again with the attached file.

If it works, I will release immediately a version 0.3 with this fix.

Ok your file Fix the problem, I can now again play from my plex to my Sony DMR. gratz !

I edited the file to try with MP3 radio but no luck with this ... seem to be a capricious device...
Code: [Select]
08      12/01/13 2:07:08.255    JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Play <0x2dc93680>
08      12/01/13 2:07:08.256    JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2dc93680>
08      12/01/13 2:07:08.256    JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2dc93680>
08      12/01/13 2:07:08.256    JobHandler_LuaUPnP::HandleActionRequest argument action=Play <0x2dc93680>
08      12/01/13 2:07:08.257    JobHandler_LuaUPnP::HandleActionRequest argument URI=http://broadcast.infomaniak.net/ouifm-high.mp3 <0x2dc93680>
01      12/01/13 2:07:08.564    luup_log:41: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>716</errorCode><errorDescription>Action SetAVTransportURI failed

For the discovery part I don't know why too ... I will investigate further.

Anyway thanks for the patch !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 04:21:52 am
I just released version 0.3.
You can download it here (ZIP archive at the bottom of this page): http://code.mios.com/trac/mios_dlna-cntroller/browser/tags/0.3#


What's new in version 0.3:
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 04:27:40 am
I must UNCHECK "Buttons state controlled by Media Renderer" to control it.

Managing transport actions is not mandatory for a Media Renderer. I suppose GMrenderer does not do it.
You can check with Device Spy whether the action GetCurrentTransportActions is implemented, and if it is, what value it returns.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 04:36:27 am
I edited the file to try with MP3 radio but no luck with this ... seem to be a capricious device...

Maybe it is simply not possible with Sony.
I am waiting for a feedback with Samsung TV.
For Yamaha receiver, we already know that it works.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 04:40:04 am
I create a list of known issues:

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 04:47:52 am
Next step is to setup XBMC (OpenElec), so far this is not discovered, even though UPnP control is enabled. But I have to read first what has already been written in this forum...

Either the discovery code discovers DMR/DMS but not the OpenElec and we have to debug to understand why.
Either the discovery code discovers no DMR/DMS at all and in this case you could be in the same case as macfly92 and me, you have to update the network setup of your Vera: ​http://forum.micasaverde.com/index.php/topic,16905.msg132502.html#msg132502

@chixxi: your XBMC is running on a RaspBerry PI ?
That would be interesting that you confirm that your XBMC is discovered by the Device Spy tool.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 05:12:58 am
For the discovery part I don't know why too ... I will investigate further.

The UPnP tools are open source: http://opentools.homeip.net/dev-tools-for-upnp
I just downloaded the sources; I will check how the scan is done.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 06:09:45 am
For the discovery part I don't know why too ... I will investigate further.

The UPnP tools are open source: http://opentools.homeip.net/dev-tools-for-upnp
I just downloaded the sources; I will check how the scan is done.

We have to test with this additional line:
Code: [Select]
    udp:setoption("broadcast", true)@macfly92: could you try to add this line in function UPnP_discover just after this following line:
Code: [Select]
    local udp = socket.udp()
It exists in the lua library another potentially interesting option, "dontroute" you could try.

Except that, the only other difference I see (just reading the code) is that Device Spy handles IP v6 in addition to IP v4, while my plugin only broadcasts the discovery message on IP v4 address.
So please confirm that your Linux box exposes a local IP v4 address.

Other difference is that Device Spy uses target "upnp:rootdevice". Of course as it tries to discover everything. I don't think the problem is here.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 01, 2013, 01:34:24 pm
Hi !

Just tested with udp:setoption("broadcast", true) but this is not working.

Don't loose some time on it because it is maybe a network problem on my side. (Wifi vs LAN, etc.) I have another Wifi access point I must test as soon as I have some times.
I just want to know if you think there is a way to send a discover to a particular IP address ? In the case I set up Static IP, to discover the port used by Bubble Upnp ?

I will investigate now how I can script your Plugin :)

Anyway this is a great work, thanks you !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 01, 2013, 01:41:46 pm
I must UNCHECK "Buttons state controlled by Media Renderer" to control it.

Managing transport actions is not mandatory for a Media Renderer. I suppose GMrenderer does not do it.
You can check with Device Spy whether the action GetCurrentTransportActions is implemented, and if it is, what value it returns.

This is the GetCurrentTransportActions return while I'm playing a webradio :

Code: [Select]
POST /upnp/control/rendertransport1 HTTP/1.1
HOST: 192.168.0.123:49494
SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#GetCurrentTransportActions"
CONTENT-TYPE: text/xml ; charset="utf-8"
Content-Length: 373

<?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:GetCurrentTransportActions xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
         <InstanceID>0</InstanceID>
      </u:GetCurrentTransportActions>
   </s:Body>
</s:Envelope>HTTP/1.1 200 OK
CONTENT-LENGTH: 326
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: Sun, 01 Dec 2013 18:39:02 GMT
EXT:
SERVER: Linux/3.6.11+, UPnP/1.0, Portable SDK for UPnP devices/1.6.17
X-User-Agent: redsonic

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetCurrentTransportActionsResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<Actions>PAUSE,STOP,SEEK</Actions>
</u:GetCurrentTransportActionsResponse>
</s:Body> </s:Envelope>

But maybe this is related with my discovery problem, Wifi, etc ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 01, 2013, 03:56:25 pm
@macfly: the problem is that your actions are in uppercase. I will make a correction to ignore case.
Currently I am considering Play Pause ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on December 01, 2013, 05:30:57 pm
On the web radio: It now appears that any web radio you want to play, must have ".mp3" on the end of the URL. Problem is that none of that stations I play have this in the URL but they will play if the mime type is provided as protocolInfo="http-get:*:audio/mpeg:*" by forcing it in the code. Do any radio stations use any other mime type? Could this mime type always be used for radio stations?

The Yamaha AVR doesn't play "m4a" files (surprisingly?) and the plugin identified this mime type incompatibly correctly in the log file. However the user does not know what went wrong at the user interface. Would it be possible to have an error message variable that is sent back to the UI5 - that reports these sorts of problems?

The new updates are good and I like how you have improved the browsing layout. Would still like to see the list selects implemented:

Quote
Minor request - it would be good if the pull down lists showed what was previously selected. They keep defaulting to the first on the list. The selected="selected" attribute can track this in the list option tags using:

Code: [Select]
pullDownList.options[i].selected = true;

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 03, 2013, 04:30:29 pm
@macfly: the problem is that your actions are in uppercase. I will make a correction to ignore case.
Currently I am considering Play Pause ...

Hi macfly.

Please try again with the updated attached JavaScript file. It should fix your problem.
PS: don't forget to clear your browser cache after uploading the file and reloading lua.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 03, 2013, 04:41:20 pm
On the web radio: It now appears that any web radio you want to play, must have ".mp3" on the end of the URL. Problem is that none of that stations I play have this in the URL but they will play if the mime type is provided as protocolInfo="http-get:*:audio/mpeg:*" by forcing it in the code. Do any radio stations use any other mime type? Could this mime type always be used for radio stations?

Yes, some use aac for example.

As I previously explained, what I have done is only a temporary and partial patch to validate that the idea is good and works for other Media Renderers, not only for Yamaha receivers. If it works for more renderers, I will spend time (probably lots of time needed) to implement a better solution. You provided the way to do it, except that it does not work well with the lua library included in the Vera (problem with timeout on HTTP request).

Quote
The Yamaha AVR doesn't play "m4a" files (surprisingly?) and the plugin identified this mime type incompatibly correctly in the log file. However the user does not know what went wrong at the user interface. Would it be possible to have an error message variable that is sent back to the UI5 - that reports these sorts of problems?

Yes and no.
Yes, it is possible but you have to define when to reset this variable.

Quote
The new updates are good and I like how you have improved the browsing layout. Would still like to see the list selects implemented

It is implemented in versions 0.2/0.3.
What would you like more precisely ?
Is it when going back to the parent ? You would like the previous child selected ? There is no real logic to do that IMHO but I think it is doable.
Is it something else I don't understand ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: a-lurker on December 03, 2013, 06:29:31 pm
Hi lolodomo

On the selections: the first case is on the "Settings" tab. You show "Description URL" for the last selected renderer but the discovery pulldown list shows the first renderer  discovered. It would be nice if the item currently selected on the list was the same as the last used renderer as per the "Description URL", if it's still available on the list.

The other selection is the media server. When you open the upnp device using the wrench and go to the player page the last used media server is not selected. This may not be so easy. Can the last media server selected be saved?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 05, 2013, 03:08:40 am
@macfly: the problem is that your actions are in uppercase. I will make a correction to ignore case.
Currently I am considering Play Pause ...

Hi macfly.

Please try again with the updated attached JavaScript file. It should fix your problem.
PS: don't forget to clear your browser cache after uploading the file and reloading lua.

This fix worked, I don't need to uncheck State Control anymore !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 08, 2013, 08:04:58 am
Hi lolodomo

On the selections: the first case is on the "Settings" tab. You show "Description URL" for the last selected renderer but the discovery pulldown list shows the first renderer  discovered. It would be nice if the item currently selected on the list was the same as the last used renderer as per the "Description URL", if it's still available on the list.

Ok, I can probably fix that easily.

Quote
The other selection is the media server. When you open the upnp device using the wrench and go to the player page the last used media server is not selected. This may not be so easy. Can the last media server selected be saved?

In fact, the last selection is kept while you keep your WEB browser open.
But you loose your selection for example in the following cases:
- you close and reopen your WEB browser
- you reload lua (I can probably fix this case)
- you change the selection with another WEB browser

The problem is that the current selection is saved on client side (browser side). This could be fixed by saving the current selection in a device variable.

Plus the fact that the result of each bowse is kept in one device variable "kills" all possibility of concurrent browsings for the same device. This problem is too much difficult to solve and is more or less due to a limit of MCV interface between JavaScript and lua.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 08, 2013, 02:48:23 pm
@Da_JoJo : any test with version 0.3 ?
I would like to know if MP3 WEB radio (URL ending with .mp3) and TTS are now working well with your Samsung TV.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 10, 2013, 10:21:40 am
hai guys, just finished reading the 21 page thread and see some interesting features. i have installed latest version of plugin in my vera lite. UI5 it runs.
next i added a Device through the Apps - Develop apps - Create device option using the D_DLNAMediaController1.xml file.

I have a working DLNA cabled network with several players and servers.
1: Linux Mint MediaTomb server
2: Linux Mint PS3 Media Server
3: Sony Blu-ray player BDP-S780
4: Sony Blu-ray player BDP-S480
5: Sony STR-DA5600es av-amp
6: Sony KDL-46W905A tv
7: XBMC running on Xbian
8: XBMC running on Raspbian

All is working well, with the Sony network audio remote app. Also when using the players themself, browsing over the mediatomb server or PS3 media server. Even party mode with the two players simultaneously connected to the same server works like a charm.

The AV-receiver is a player ?nd server, but server mode is not enabled for now.

So...let's say, i want to be able to use the vera as a controller to play music from my mediatomb server with my BDP-S780...which devices do i need to add, and through what method as there is also a built-in possibility to add UPnP devices through the vera automatically (which also works for all devices mentioned above).

next, can someone post all the variables in the advanced settings tab cuz right now, i cant get it to work. I am so far right now that my BDP-S780 is sort of recognized by the plugin as it mentions the default name of the player "Blu-ray Disc Player" in the settings tab DMR model field. I have a description URL like so: http://192.168.69.223:52323/. However the state remains OFF (while player is ON).

In the Player tab of the plugin i cannot discover any servers, while the built-in UPnP scanner of the vera finds several. I do not know what URI's i have to submit, or the need of using the UPnP Proxy server (as it is not described in the opening post).

pleeeeeeeeeeease help me?! :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 10, 2013, 12:41:47 pm
For what I know, Yes, Upnp Proxy Plugin is required. I think it is the culprit of your device state's checking problem and also discovery.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 10, 2013, 01:34:28 pm
Do I need to configure the proxy plugin in any way? Or the UPnP plugin to use the proxy?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 10, 2013, 06:27:01 pm
I have a working DLNA cabled network with several players and servers.
1: Linux Mint MediaTomb server
2: Linux Mint PS3 Media Server
3: Sony Blu-ray player BDP-S780
4: Sony Blu-ray player BDP-S480
5: Sony STR-DA5600es av-amp
6: Sony KDL-46W905A tv
7: XBMC running on Xbian
8: XBMC running on Raspbian

Interesting. Potentially a lot of combinations, with several different servers. I am waiting for your feddback.

Except XBMC, are few of them Media Renderers or just Media Players ?

Yes, the UPnP event proxy has to be installed, even if the plugin is probably working more or less without the proxy.
I have not done tests without the proxy and I will probably never do it.

You can forget the UPnP discovery by the Vera and just use the discovery implemented by the plugin.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 11, 2013, 05:14:21 am
well...discovery from the plugin doesnt work then :(

do i need to configure anything in the proxy or the plugin to use the proxy? and how?

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 11, 2013, 07:19:17 am
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.


can you please post all the variables of the plugin so i can copy those in my plugin? maybe the same variables work for all my BDP-players...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 11, 2013, 07:37:11 am
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.


can you please post all the variables of the plugin so i can copy those in my plugin? maybe the same variables work for all my BDP-players...

You must not copy the variables. They are automatically created and updated by the plugin, depending on the current context (what is played).

Just create a new device, go into the Settings tab and select your Media Renderer through the UI.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 11, 2013, 07:47:15 am
well...discovery from the plugin doesnt work then :(

Here is what is written in the first post of this topic:

Quote
Automatic discovery (UPnP discovery) could require an additional setup of your Vera Lite. Please read the explanations in this message if it does not work directly: ​http://forum.micasaverde.com/index.php/topic,16905.msg132502.html#msg132502


In case you don't find a solution for the automatic discovery, you still have the solution to provide the URL of your device description (using the UI - settings tab). To know this URL, a tool like Device Spy is very probably required.

Quote
do i need to configure anything in the proxy or the plugin to use the proxy? and how?

Just follow the installation instructions for the proxy. Then there is absolutely nothing special to do to make it work with the plugins.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 11, 2013, 08:27:56 am
Hello Lolodomo !

Just a little question here ... regarding my problem to play WebRadio on my Sony BR.

Do you know if it is possible to remotely select a Renderer in BubbleUpnp using uPnP ?

Let me explain the Goal :
With BubbleUpnp, I can play webradio on my Sony BR, I think, with all of our tests, it is possible because BubbleUpnp can be a proxy for Shoutcast webradio when the receiver is not compatible to transcode it in a compatible format.

So I want to know if I can, with the help of your plugin, select my sony BR as a renderer for Bubble upnp and play web radio to BR through BubbleUpnp ?

And yes ... I know, it is a Strange Idea ... but I'm trying to find a good way to do this.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 11, 2013, 12:15:19 pm
Hello Lolodomo !

Just a little question here ... regarding my problem to play WebRadio on my Sony BR.

Do you know if it is possible to remotely select a Renderer in BubbleUpnp using uPnP ?

Let me explain the Goal :
With BubbleUpnp, I can play webradio on my Sony BR, I think, with all of our tests, it is possible because BubbleUpnp can be a proxy for Shoutcast webradio when the receiver is not compatible to transcode it in a compatible format.

So I want to know if I can, with the help of your plugin, select my sony BR as a renderer for Bubble upnp and play web radio to BR through BubbleUpnp ?

And yes ... I know, it is a Strange Idea ... but I'm trying to find a good way to do this.

No, sorry, I don't think it is possible. I don't think a UPnP AV control point can control another UPnP AV control point.

I am curious to know how BubbleUPnP determines the compatibility and enable or not the proxy.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 11, 2013, 12:32:53 pm
Hello Lolodomo !

Just a little question here ... regarding my problem to play WebRadio on my Sony BR.

Do you know if it is possible to remotely select a Renderer in BubbleUpnp using uPnP ?

Let me explain the Goal :
With BubbleUpnp, I can play webradio on my Sony BR, I think, with all of our tests, it is possible because BubbleUpnp can be a proxy for Shoutcast webradio when the receiver is not compatible to transcode it in a compatible format.

So I want to know if I can, with the help of your plugin, select my sony BR as a renderer for Bubble upnp and play web radio to BR through BubbleUpnp ?

And yes ... I know, it is a Strange Idea ... but I'm trying to find a good way to do this.

No, sorry, I don't think it is possible. I don't think a UPnP AV control point can control another UPnP AV control point.

I am curious to know how BubbleUPnP determines the compatibility and enable or not the proxy.

I am curious too, but I don't know how to investigate further ... I think it use Shoutcast Proxy because we done a lot of try to play webradio on BR without success, and when I play a webradio via BubbleUpnp and exit the software, BR stop playing after few seconds (buffers I presume) while is not the case when I'm playing simple mp3 from My Plex MediaServer. In Bubble Upnp, you can force using Proxy, but you cannot disable it completely so it is hard to know if it used it or not ...

Just a last question about this other Out Of Subject thing : Do you know if BubbleUpnp provide another way to control it ? an API or http control webservice ?

Thanks you for answers ! Let me boost your Karma xD (What a new Micasaverde Feature !!! or maybe I didn't noticed this before, but I doubt).
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 11, 2013, 01:38:05 pm
Just a last question about this other Out Of Subject thing : Do you know if BubbleUpnp provide another way to control it ? an API or http control webservice ?

I don't know but probably not.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 12, 2013, 04:18:41 am
OK, testing done.

results:
1: Plugin discovers 3 units when clicking on the Discover button on the settings tab. My TV, my amp, and my BR-player (only one is switched on at the moment, so i figure the other one will be discovered too)
2: Plugin discovers 3 servers, MediaTomb on the Linux Mint, XBMC on the xbian raspberry pi, and BubbleUPnP on my phone.
3: Music can only be played from either one of the 3 servers to my TV. Volume and mute control does not work. Play and Stop does. However, when i push an mp3, it only loads that mp3. So next or previous is not possible. Perhaps with playlists.
4: When pushing music to my TV, my amp does change the HDMI input to TV and TV starts playing music, right away.
5: Non of the other renderers work. So nor my BDP-S780, neither my amp plays music. Although browsing and discovering servers ?s possible on these renderers. They also give feedback on what functionality they are on. For example, when playing music through the plugin on my TV, my amp gives feedback that HDMI channel is on TV.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 13, 2013, 02:24:14 am
Thank you for your feedback.

results:
1: Plugin discovers 3 units when clicking on the Discover button on the settings tab. My TV, my amp, and my BR-player (only one is switched on at the moment, so i figure the other one will be discovered too)

You previously said that discovery was not working. Can you explain what you changed ? It could probably help other users.

Regarding your discovery of Media Renderers, what is missing is your 2 XBMC on raspberry. Have you enabled UPnP control in XBMC ?

Quote
2: Plugin discovers 3 servers, MediaTomb on the Linux Mint, XBMC on the xbian raspberry pi, and BubbleUPnP on my phone.

Ok.
Have you enabled the "server" on your second XBMC ? It should have been discovered too.
What is missing too is the PS3 Media Server. As I have a PS3 Media Server installed on my PC, I will test on my side. But it is a Windows version, not a Unix version.

Quote
3: Music can only be played from either one of the 3 servers to my TV. Volume and mute control does not work.

Please extact and provide the Vera logs at the instant you push the Mute button in the UI. An error is certainly generated.

Quote
However, when i push an mp3, it only loads that mp3. So next or previous is not possible. Perhaps with playlists.

In fact, it depends on servers. With XBMC, if you play a track from an album, launching the playback directly from XBMC interface, then Previous and Next are working.
Loading of playlist is not managed by the plugin.
It is something that I have to study.

Quote
5: Non of the other renderers work. So nor my BDP-S780, neither my amp plays music.

Please extact and provide the Vera logs at the instant you try to play something. An error is certainly generated.
Maybe, like with the Yamaha AVR, you need first to swith your BR or AVR to a special mode ?

Quote
They also give feedback on what functionality they are on. For example, when playing music through the plugin on my TV, my amp gives feedback that HDMI channel is on TV.

One interesting test is to use your BR remote (or AVR remote) to select a media (the same as you try with the plugin). When the media is played, return to the plugin and check if buttons state has changed. Please go to the Help tab and provide the value of the metadata variable.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 13, 2013, 04:16:04 am
i'll look into it this afternoon or weekend.

one thing i dont understand though, is it possible to push music from my XBMC to the vera as a controller?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 13, 2013, 05:50:54 am
one thing i dont understand though, is it possible to push music from my XBMC to the vera as a controller?

The Vera, through the plugin, is a DLNA control point and so connect any Media Server (providing media) to any Media Renderer (rendering this media). Once connected, the Vera can control the playback (pause, play, stop, mute, ... etc).
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 13, 2013, 05:53:39 am
Regarding the discovery of Media Servers and Renderers, I am wondering whether we don't have a general problem when the server/renderer relies on a Linux OS.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 13, 2013, 09:00:40 am
Apparently, RPI is not handling correctly UPnP (discovery):
http://stackoverflow.com/questions/13689486/upnp-detection-delay
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 13, 2013, 09:18:47 am
Regarding the discovery of Media Servers and Renderers, I am wondering whether we don't have a general problem when the server/renderer relies on a Linux OS.

My Plex Media Server run on Linux, and was discovered perfectly.
My GMediaRender, who is running on my main Linux server (same as plex), connected in RJ-45, is also discovered.
Also My Sony BR is connected with Ethernet.

This is why I tell you that I must have a Wifi problem for discovery part because neither GMrender on Raspy with Wlan connexion and neither my Android devices with Bubble Upnp (in Wifi too) are discovered. I tried to tweak my Wifi router, but with no luck...

Quote
Apparently, RPI is not handling correctly UPnP (discovery):
http://stackoverflow.com/questions/13689486/upnp-detection-delay

From this Thread I read that is probably a software problem with RaspBMC Distribution, not Hardware related.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 13, 2013, 11:33:10 am
Regarding the discovery of Media Servers and Renderers, I am wondering whether we don't have a general problem when the server/renderer relies on a Linux OS.

My Plex Media Server run on Linux, and was discovered perfectly.
My GMediaRender, who is running on my main Linux server (same as plex), connected in RJ-45, is also discovered.
Also My Sony BR is connected with Ethernet.

Ok, good news, my hypothesis is wrong.

Quote
This is why I tell you that I must have a Wifi problem for discovery part because neither GMrender on Raspy with Wlan connexion and neither my Android devices with Bubble Upnp (in Wifi too) are discovered. I tried to tweak my Wifi router, but with no luck...

But you said too that discovery is working using Device Spy. So there is apparently a clear problem either in the code used to discover UPnP devices or in the LAN setup of the Vera.

Maybe fabstar81can telll us if his undiscovered devices are connected though Wifi like you ?

Quote
Quote
Apparently, RPI is not handling correctly UPnP (discovery):
http://stackoverflow.com/questions/13689486/upnp-detection-delay

From this Thread I read that is probably a software problem with RaspBMC Distribution, not Hardware related.

Ok.

I plan to use in few days a RPI with Openelec. I hope discovery will work.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 13, 2013, 11:43:29 am
Guys, my rpi is discovered perfectly. The reason my second rpi wasn't discovered was because it was switched off. My PMS3 wasn't discovered because I have had multiple problems with that server.

I'll try and switch all things on and then see what happens.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 13, 2013, 11:47:40 am
Yes, when I used Device Spy on my Windows Workstation (plugged with Ethernet cable) I'm able to discover whole of my devices, including the Wifi's ones... It is how I found the Device XML URL to put in your plugin... No problem for GmediaRender, but problematic with Bubble Upnp (for the random port used at app startup...)

You're right, It's very strange ...
Too bad that we can't have a Text based Upnp Device Spy to run on vera directly...

I will try to find another Raspi to install Gmrender and plug it with an ethernet cable.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 16, 2013, 07:27:28 am
Hi Lolodomo !

I was looking for Bubble Upnp Server (http://www.bubblesoftapps.com/bubbleupnpserver/) and I noticed that he can add OpenHome's features over a standard DLNA Renderer in one click if it run on your Home network.

OpenHomeMedia bring very cool functionality to standard Upnp Renderer such as Playlist management, synchronous playing over multiple devices, etc...

Do you know if we have a chance to implement it in your great plugin ?

here you can find more info about this stack : http://www.openhome.org/wiki/OhMedia or http://www.openhome.org/wiki/OhMediaDevelopers

Best regards,

Mac_Fly.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 16, 2013, 07:46:39 am
@fabstar81: any news ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: fabstar81 on December 18, 2013, 03:50:47 am
i'm sorry, had no time to investigate it any further this week. probably next week i will have time to do so.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 18, 2013, 09:53:25 am
Hello, ... it's me again  :-[

I've Installed PS3 Media Server (http://www.ps3mediaserver.org/) because it can play webradio to my crappy Sony Blu-ray (don't know why it can, not sure if it transcode something or not, it is not clear in the software's logs). Tested with another upnp control point.
BTW, it is a new Media Server to test, so here is some feedbacks with your plugin:

- Discovery Server work well, and I can browse the contents.
- But it can't play radio to the Blu-ray ....

Here is a part of the BrowseResult answer for webradios when browsing this MediaServer with DMR plugin :
Code: [Select]
<item id="0$2$1$1" parentID="0$2$1" restricted="true">
<dc:title>La Grosse Radio Rock - [FFmpeg Web Audio]</dc:title>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.0.100:5001/get/0$2$1$1/thumbnail0000La+Grosse+Radio+Rock</res>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
</item>
<item id="0$2$1$2" parentID="0$2$1" restricted="true">
<dc:title>La Grosse Radio Metal - [FFmpeg Web Audio]</dc:title>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$2/La+Grosse+Radio+Metal</res>
[ ................. ]

And this is what Vera's log show when I try to play this Radio with your plugin GUI :
Code: [Select]
08 12/18/13 14:23:22.359 JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=0$2$1$1 <0x2e50b680>
02 12/18/13 14:23:22.363 luup_log:44: DLNA: Media cannot be rendered by the selected renderer. <0x2e50b680>

But, if I manually put this http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock in the URI field of the Player tab, it work !

If I can provide you more info, just tell me.

don't know if it can help, but here is the DLNA profile PS3 MediaServer use when it talk to the Sony BR :
Code: [Select]
#----------------------------------------------------------------------------
# Profile for Sony Blu-ray Players (2010 Bravia Internet Video-enabled models).
# See PS3.conf for a description of all possible configuration options.
#

RendererName=Sony Blu-ray
RendererIcon=sonybluray.png

# ============================================================================
# Sony Bluray uses the following headers:
#
# User-Agent: UPnP/1.0
# X-AV-Client-Info: av=5.0; cn="Sony Corporation"; mn="Blu-ray Disc Player"; mv="2.0";
# X-AV-Physical-Unit-Info: pa="Blu-ray Disc Player";
# ---
# User-Agent: UPnP/1.0 DLNADOC/1.50
# X-AV-Client-Info: av=5.0; cn="Sony Corporation"; mn="Blu-ray Disc Player"; mv="2.0";
# X-AV-Physical-Unit-Info: pa="Blu-ray Disc Player";
# ============================================================================
# The User-Agent strings are too generic to match
#UserAgentSearch=
UserAgentAdditionalHeader=X-AV-Client-Info
UserAgentAdditionalHeaderSearch=(cn="Sony Corporation"; mn="Blu-ray Disc Player")
Video=true
Audio=true
Image=true
SeekByTime=false
TranscodeVideo=MPEGTSAC3
TranscodeAudio=LPCM
DefaultVBVBufSize=true
MuxH264ToMpegTS=false
MuxDTSToMpeg=false
WrapDTSIntoPCM=false
MuxLPCMToMpeg=false
MaxVideoBitrateMbps=0
MaxVideoWidth=0
MaxVideoHeight=0
H264Level41Limited=true
#MimeTypesChanges=
DLNALocalizationRequired=true
#TranscodeExtensions=
#StreamExtensions=
MediaParserV2_ThumbnailGeneration=false

# For Sony Bluray players and Bravia TVs
ForceJPGThumbnails=true
# For Sony Bluray players
ChunkedTransfer=true

# Specs below taken from http://www.sony.co.uk/product/blu-ray-disc-player/bdp-s370#pageType=TechnicalSpecs
# then fine-tuned by lengthy trial and error since so much of that advertised spec is inaccurate.
# US models don't support video/divx mime type but European and Canadian models do.
# Subtitles in mkv files are only displayed if mime type is video/divx.
# Vob subtitles are not supported.
# See also http://forum.serviio.org/viewtopic.php?f=11&t=2004 for more DLNA-related info on these players.

MediaInfo=true

######### ALL MODELS:

# Supported audio formats:
Supported = f:wma    n:2   m:audio/mpeg
Supported = f:mp3    n:2   m:audio/mpeg
Supported = f:lpcm   n:2   m:audio/L16   s:48000

# Supported image formats:
Supported = f:jpg   m:image/jpeg

# Supported video formats:
Supported = f:mpegps|mpegts   v:mpeg1|mpeg2     a:ac3|dts|lpcm|mpa|mp3                    m:video/mpeg
Supported = f:mpegts          v:h264|vc1        a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/vnd.dlna.mpeg-tts

######### Comment/uncomment the sections below according to your region/model-year #########

######### 2010-11 US MODELS (Sony BDP-Sx70/80) ONLY:
Supported = f:mp4|m4v         v:mp4|h264        a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/mpeg
Supported = f:avi|divx        v:divx|mp4        a:ac3|lpcm|mpa|mp3                        m:video/mpeg
Supported = f:mkv             v:mp4|divx|h264   a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/vnd.dlna.mpeg-tts
######### 2012 US MODELS (Sony BDP-Sx90) ONLY:
#Supported = f:mp4|m4v        v:mp4|h264        a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/mp4
#Supported = f:wmv            v:wmv|vc1         a:wma                                     m:video/mp4
#Supported = f:avi            v:mp4             a:ac3|lpcm|mpa|mp3                        m:video/mp4
#Supported = f:mkv            v:mp4|h264        a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/x-matroska
######### NON-US MODELS ONLY:
#Supported = f:mp4|m4v        v:mp4|h264        a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/mpeg
#Supported = f:avi|divx       v:divx|mp4        a:ac3|lpcm|mpa|mp3                        m:video/divx
#Supported = f:mkv            v:mp4|h264        a:ac3|dts|dtshd|truehd|aac|lpcm|mpa|mp3   m:video/divx
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 18, 2013, 10:39:20 am
Erf, It work when I browsing this Media Server to play to my RasPi ....
So it is probably another Sony related thing ><

But when I use Leiads control point, it can Load this Radio from this MediaServer to Sony BR.... but sometime it bug so ... I can't figure how it works...

Sorry to bother you ... I will post updates if I have somes.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 19, 2013, 06:50:23 pm
Hello, ... it's me again  :-[

I've Installed PS3 Media Server (http://www.ps3mediaserver.org/) because it can play webradio to my crappy Sony Blu-ray (don't know why it can, not sure if it transcode something or not, it is not clear in the software's logs). Tested with another upnp control point.
BTW, it is a new Media Server to test, so here is some feedbacks with your plugin:

- Discovery Server work well, and I can browse the contents.
- But it can't play radio to the Blu-ray ....

Here is a part of the BrowseResult answer for webradios when browsing this MediaServer with DMR plugin :
Code: [Select]
<item id="0$2$1$1" parentID="0$2$1" restricted="true">
<dc:title>La Grosse Radio Rock - [FFmpeg Web Audio]</dc:title>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.0.100:5001/get/0$2$1$1/thumbnail0000La+Grosse+Radio+Rock</res>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
</item>
<item id="0$2$1$2" parentID="0$2$1" restricted="true">
<dc:title>La Grosse Radio Metal - [FFmpeg Web Audio]</dc:title>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$2/La+Grosse+Radio+Metal</res>
[ ................. ]

And this is what Vera's log show when I try to play this Radio with your plugin GUI :
Code: [Select]
08 12/18/13 14:23:22.359 JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2e50b680>
08 12/18/13 14:23:22.360 JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=0$2$1$1 <0x2e50b680>
02 12/18/13 14:23:22.363 luup_log:44: DLNA: Media cannot be rendered by the selected renderer. <0x2e50b680>

But, if I manually put this http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock in the URI field of the Player tab, it work !

The server is delivering a media of type audio/L16 because the server is appaarently converting audio to LPCM (confirmed by the profile you provide).
Can you check please if http-get:*:audio/L16:* is present in the allowed protocols by your Sony BR DMR.

But if you say that another UPnP control point succeeds in connecting the same media from the same server to the same renderer (Sony BR), that's weird.

Regarding the fact that it works when you enter directly the URL, that's a good point. As the URL does not end with .mp3, that means the plugin does not provide any protocol info and the Sony BR probably succeeds in identifying the audio type.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 19, 2013, 06:56:54 pm
Erf, It work when I browsing this Media Server to play to my RasPi ....
So it is probably another Sony related thing ><

But when I use Leiads control point, it can Load this Radio from this MediaServer to Sony BR.... but sometime it bug so ... I can't figure how it works...

Sorry to bother you ... I will post updates if I have somes.

Just an hypothesis: Leiads control point does not care about the protocol and just provide the URI to the renderer. Then the renderer tries to identify the media type. Sometimes it works; sometimes not.

I could add such an option: "Don't provide the protocol information to be used to the renderer".

But I am not sure that every DMR has this feature of identifying media type. And as you say, it is not always working. I have noticed the same thing with XBMC as renderer. So it is clearly better (and faster for the renderer) to provide the protocol information.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 19, 2013, 07:10:37 pm
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

Ok, I found an old message that listed the protocol infos from the Sony BR.
So you have clearly an entry http-get:*:audio/L16:...
And so you should not get the message that says "Media cannot be rendered by the selected renderer". Probably a bug in my code... I will provide later a new xml file with additional logs to help me to understand what's wrong.

Maybe the bug is due to the "size" attribute in the res tag.
Strange thing is that PSM provides 3 res tags that are identical. But it should not be a problem with my code.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 19, 2013, 07:44:07 pm
Maybe the bug is due to the "size" attribute in the res tag.

Yes, I think that's the problem. I will fix my code (pattern matching).
As I have a PSM on my PC, I should be able to reproduce the bug.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 20, 2013, 05:39:53 am
Erf, It work when I browsing this Media Server to play to my RasPi ....
So it is probably another Sony related thing ><

But when I use Leiads control point, it can Load this Radio from this MediaServer to Sony BR.... but sometime it bug so ... I can't figure how it works...

Sorry to bother you ... I will post updates if I have somes.

Just an hypothesis: Leiads control point does not care about the protocol and just provide the URI to the renderer. Then the renderer tries to identify the media type. Sometimes it works; sometimes not.

I could add such an option: "Don't provide the protocol information to be used to the renderer".

But I am not sure that every DMR has this feature of identifying media type. And as you say, it is not always working. I have noticed the same thing with XBMC as renderer. So it is clearly better (and faster for the renderer) to provide the protocol information.

Hey Lolodomo, thanks for the reply !

I think you're right about auto-discovery, because it work ... but it take a lot of time (between 40 sec and 1 min) to sony BR to start playing something. Anyway ... it work, it is better than nothing :)

Ready to test what you need !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 05:28:32 am
Hi macfly92.

I found where is the problem.
audio/L16;rate=48000;channels=2 does not match with audio/L16
I don't think it is compliant with the standard. In case it is, I will adapt my code..
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 06:19:50 am
@macfly92: please try with the attached file and tell me if it is better.
It should fix the problem when using PMS as server. The playback of your web radio (through PMS) should now start quickly on your Sony BR.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 07:25:39 am
I really appreciate your hard work Lolodomo ... but this crappy Sony device make me crazy.

So, after uploading this new file and reboot vera, here is the result.

First, now, launch playing with the help of your browser seem to be working well.
You will find in the attached log file what I get when I hit play at the bottom of the "player" tab with automatic selection.
(Forum limited to 20k characters)

I waiting a while without result ... finally I hit the Play Button at the top of the player tab (the Buttons state controlled by Media Renderer), and the webradio start play !!
You will find the logs in the same log file after the split i wrote....

Strange thing ... but the most strange isn't here. After, I tried to switch to another webradio ... and after a moment, the first webradio launch..., Tried another, always the First was play...
Maybe it need to "flush" his playlist or something else.

So the fact is :
1 ) Your plugin seem to be working better (fully ?) with PS3 Media Server
2 ) My Sony renderer is really incomprehensible. (this is weird because I loved the ability to do this...)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 07:48:53 am
It seem this is really a playlist related thing or something.

I load a mp3 from my Plex, it started playing to my BR as usual (another strange thing to have lot of problem with webradio, and absolutely not with mp3)

While I'm playing this mp3, and even if I push the stop button, each time I tried to launch a webradio, it return playing the mp3 at the last stop point...
The mp3 finished playing, so I tried again to launch another webradio, and It worked !

Now, when I try to launch another webradio, the last was played... and the Title Metadata don't update. But switching to a mp3 works and revert back to another webradio doesn't work until the previous mp3 finished.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 08:09:32 am
I really appreciate your hard work Lolodomo ... but this crappy Sony device make me crazy.

So, after uploading this new file and reboot vera, here is the result.

First, now, launch playing with the help of your browser seem to be working well.
You will find in the attached log file what I get when I hit play at the bottom of the "player" tab with automatic selection.
(Forum limited to 20k characters)

I waiting a while without result ... finally I hit the Play Button at the top of the player tab (the Buttons state controlled by Media Renderer), and the webradio start play !!
You will find the logs in the same log file after the split i wrote....

I find in your logs a clear UPnP error when command Play is run. So it looks like the URI is correctly loaded but then starting playback fails. I don't know, maybe a certain delay is required between the two actions ? I will guide you to add a sleep call at the right position.

Quote
Strange thing ... but the most strange isn't here. After, I tried to switch to another webradio ... and after a moment, the first webradio launch..., Tried another, always the First was play...
Maybe it need to "flush" his playlist or something else.

It is something I have already noticed with XBMC. But I think it was when using the URI field and without providing protocol info. It is not your case.

Quote
So the fact is :
1 ) Your plugin seem to be working better (fully ?) with PS3 Media Server
2 ) My Sony renderer is really incomprehensible. (this is weird because I loved the ability to do this...)

No, we cannot say it is working fully.

Can you first confirm that the playback of the same web radio from PMS is working when you select it from your Sony BR interface ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 08:15:38 am
It seem this is really a playlist related thing or something.

I load a mp3 from my Plex, it started playing to my BR as usual (another strange thing to have lot of problem with webradio, and absolutely not with mp3)

While I'm playing this mp3, and even if I push the stop button, each time I tried to launch a webradio, it return playing the mp3 at the last stop point...
The mp3 finished playing, so I tried again to launch another webradio, and It worked !

Now, when I try to launch another webradio, the last was played... and the Title Metadata don't update. But switching to a mp3 works and revert back to another webradio doesn't work until the previous mp3 finished.

My idea would be that we ask for playback too early. Maybe the new URI is not fully loaded and the Sony BR considered that the current URI is still the previous one. That's why I would like to test with an additional delay between loading URI and starting playback.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 08:19:57 am
Your error code is 701 which means for "Play" action:
Quote
The immediate transition from current transport state to desired transport state is not supported by this device.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 08:20:16 am
Quote
Can you first confirm that the playback of the same web radio from PMS is working when you select it from your Sony BR interface ?

Ahahah ... another funny thing I've tried ...

When I go to my BR Interface, I see lot of devices in the music section (plex MS, bubbles upnp devices ...) but no PMS server ...
When I go to setting > Server Setting, I see the PS3 Media Server in a Hidden State, but when I want to switch in a visible state, it say i can't ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 08:26:27 am
Quote
My idea would be that we ask for playback too early. Maybe the new URI is not fully loaded and the Sony BR considered that the current URI is still the previous one. That's why I would like to test with an additional delay between loading URI and starting playback.
Ok with that, but it is strange that right after a finished mp3 playing, it works ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 08:27:48 am
Quote
Can you first confirm that the playback of the same web radio from PMS is working when you select it from your Sony BR interface ?

Ahahah ... another funny thing I've tried ...

When I go to my BR Interface, I see lot of devices in the music section (plex MS, bubbles upnp devices ...) but no PMS server ...
When I go to setting > Server Setting, I see the PS3 Media Server in a Hidden State, but when I want to switch in a visible state, it say i can't ...

I would prefer you already have a working case outside the plugin before trying to make it work with the plugin.
To say that with other words, I would prefer to not find a bug in the plugin if the problem is not relative to the plugin...



By the way, can you try to add this additional line at line 692:
Code: [Select]
luup.sleep(3000)It will wait for 3 seconds before running the Play command.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 08:33:49 am
On my side, I will validate later today that the plugin is working fine with PS3 Media Server.
I have now a Raspberry PI too, so I will validate that everything is ok too with RPI/XBMC, as a server and as a renderer.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 08:40:33 am
Quote
I would prefer you already have a working case outside the plugin before trying to make it work with the plugin.
To say that with other words, I would prefer to not find a bug in the plugin if the problem is not relative to the plugin...

You are right sorry, but I never use the Sony Interface so I figured out this thing only this last night. In my first post for PS3 media server, I tell you that i'm using Bubble upnp or Leiads.
I will try to find why I can't make it visible in sony interface.

I know this Sony device seem to be buggy, the first idea was to provide you some feedback about another Media server (PSM) that seem to be not tested before. (and the fact I have done some test with it)

After that, while you seem to be able to help me to tame this BR, I try as much as I can. But if you want to give it up, I will really understand :)

Anyway I will test your sleep add right now
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 08:48:50 am
On my side, I will validate later today that the plugin is working fine with PS3 Media Server.
I have now a Raspberry PI too, so I will validate that everything is ok too with RPI/XBMC, as a server and as a renderer.

Ok, and just in the case you want to test gmrenderer on a Raspi, this is the link I Followed to install this :
http://blog.scphillips.com/2013/07/playing-music-on-a-raspberry-pi-using-upnp-and-dlna-revisited/
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 22, 2013, 09:12:00 am
Quote
By the way, can you try to add this additional line at line 692:
luup.sleep(3000)
It will wait for 3 seconds before running the Play command.

This do the trick man ! now I can switch between webradio with your plugin from PMS ! This work all the Time, also switching between mp3 and radio.

For the protocol discovery part ... It take always 1.20 minutes aprox between I hit play and the stream start to playing ... but it work. Maybe it just be very slow... but I don't have this behavior with mp3.

I don't want to annoying you more than that with this thing .. you help me to have a working setup, and I'm very grateful to you !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 03:03:50 pm
Result of my tests with a Raspberry PI and an OpenElec distribution (XBMC): plugin is working very well, exactly like with XBMC on my Windows PC.
As expected, few videos are not rendered, only audio is rendered. It concerns all video with these video codecs: MPEG2, MPEG1, VC1, DivX 3. But MPEG1 and WMA audio codecs are correctly handled.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 03:11:42 pm
Quote
By the way, can you try to add this additional line at line 692:
luup.sleep(3000)
It will wait for 3 seconds before running the Play command.

This do the trick man ! now I can switch between webradio with your plugin from PMS ! This work all the Time, also switching between mp3 and radio.

For the protocol discovery part ... It take always 1.20 minutes aprox between I hit play and the stream start to playing ... but it work. Maybe it just be very slow... but I don't have this behavior with mp3.

It is not normal that you have to wait for a so long time. In my opinion, it means that the Sony BR does not understand the provided protocol information. I think we have to test filtering what is coming from PMS in order to just keep audio/L16. I will update the code for the test.

By the way, I would appreciate if you could provide the minimum sleep duration that works well. First try with 1000; then 500...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 03:13:19 pm
I don't want to annoying you more than that with this thing .. you help me to have a working setup, and I'm very grateful to you !

No problem at all.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 22, 2013, 04:19:13 pm
First tests with PS3 Media Server: discovery is working well, media browsing is working well. Playback is working for certain files with Windows Media Player as renderer but no file is working with XBMC as renderer !
Maybe it is due to my PMS setup that is adapted for the PS3.
I will try to understand what's wrong.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 23, 2013, 05:56:49 am
@macfly92: please try to replace at line 898 this line
Code: [Select]
selectedProtocol = protocolby this line
Code: [Select]
selectedProtocol = DMRprotocoland tell me if it is better.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 23, 2013, 06:16:55 am
Ok I will test it as soon as I go home, because I need Audio feedback.

For the sleep value, 1000 seem to short, 1500 work. I will try to fine tune it  with 1200.
But it seem I have a back side effect : it appear since I add this sleep command the Upnp Event Proxy crash lot of time. Reloading LUA do nothing, I must reboot Vera to get it working.
Not sure it is related but I don't have this behaviour before.

I will continue to investigate and report feedbacks.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 23, 2013, 07:01:18 am
Regarding PMS, I finally install the last version 1.90.1. I previously used an old version 1.40.0.
That's now better with XBMC (running on my PC) as renderer.
With default parameters, I can now play MP3 audio files but not FLAC audio filles. Lots of video files are working but not all. By default, it looks like audio is converted into DD and video probably to MPEG2. I noticed a frequent big A/V out of synchro.
If I disable transcoding for files with extensions flac, ts, m2ts, these files are then working with XBMC and are not converted.


@macfly92: when I try to play a FLAC file through PMS, XBMC fails to play it and finally start the playback of my previous MP3 media. So I think that, when we get an old selection playback, it just means that the renderer has rejected the playback iof the new selected media.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 23, 2013, 07:26:15 am
Regarding PMS, I finally install the last version 1.90.1. I previously used an old version 1.40.0.
That's now better with XBMC (running on my PC) as renderer. With default parameters, I can now play MP3 audio files but not FLAC audio filles. Lots of video files are working but not all. By default, it looks like audio is converted into DD. I don't remember what is the used codec to transcode the video. But I noticed a frequent big A/V out of synchro.

With good setup, PMS with its transcoding capabilities could be an interesting server to bypass the lack of MPEG2 / VC1 support (without paying) in the Raspi.


@macfly92: when I try to play a FLAC file through PMS, XBMC fails to play it and finally start the playback of my previous MP3 media. So I think that, when we get an old selection playback, it just means that the renderer has rejected the playback iof the new selected media.

Yes I think PMS is a good way to have a cheap but good transcoder/remux. It can be used as a toolbox to tame some crappy renderer (who say Sony ? :P)

For the fallback of the previous loaded audio when loading failed, I'm agree with you regards all my tests.

And for the sleep time, 1200ms doesn't trigger any error message but with this value Sony BR crash often the Upnp Proxy by sending illegals characters in the CurrentTrackURI field. and radio failed to switching sometimes.

So 1500ms seem to be the best parameter. With this value, I can play, stop, and switch on the Fly webradio.

For the new value of selectedProtocol, I will try to test, but at this time, I'm doing remotely testing and looking feedback with log file only. I report as soon as I get update.

Thanks you !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 23, 2013, 07:33:48 am
I have updated my previous message relative to PMS. Disabling the transcoding has help to play audio and video files that were not working.

Yes I think PMS is a good way to have a cheap but good transcoder/remux. It can be used as a toolbox to tame some crappy renderer (who say Sony ? :P)

It looks like video is transcoded to MPEG2. I don't know if PMS is able to transcode video to another codec. For raspi and its lack of MPEG2/VC1 support by default, it could be interesting to get a transcoding to another codec.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 23, 2013, 08:30:36 am
I have updated my previous message relative to PMS. Disabling the transcoding has help to play audio and video files that were not working.

Yes I think PMS is a good way to have a cheap but good transcoder/remux. It can be used as a toolbox to tame some crappy renderer (who say Sony ? :P)

It looks like video is transcoded to MPEG2. I don't know if PMS is able to transcode video to another codec. For raspi and its lack of MPEG2/VC1 support by default, it could be interesting to get a transcoding to another codec.

When you look in the exemple config file in PMS you can notice the mencoder_custom_options. It override Global setting, so maybe you should be able to set specific codec... you can also use this setting in specific renderer.conf so you should add specific parameter to specific renderer.

links : http://www.ps3mediaserver.org/forum/viewtopic.php?f=11&t=7930
 http://www.mplayerhq.hu/DOCS/HTML/fr/menc-feat-selecting-codec.html
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 23, 2013, 12:18:46 pm
To continue with PMS, I checked what UPnP metadata I got with a FLAC file with or without transcoding, and at my big surprise there is no difference, I got this in all cases: http-get:*:audio/x-flac:DLNA.ORG_OP=01. It probably explains why XBMC fails to render the transcoded media.
When I go into TRANCODE virtual directory and select a transcoded version of the media, i got this protocol: http-get:*:MIMETYPE_AUTO;rate=48000;channels=2:DLNA.ORG_OP=01. This "MIMETYPE_AUTO" is strange. The only match I find is with http-get:*:*:*, meaning that the renderer will try to find the media type, but it does not succeed.

Using PMS with my PS3, I see that my FLAC file cannot be read too (I see something like "incompatible data"). So maybe PMS v1.90.1 is not able to convert FLAC files ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 23, 2013, 02:25:54 pm
There is in previous version of PMS, a problem with transcoding FLAC with FFMPEG, and the workaround is to switch to Mplayer to encode Audio.

http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=15307

Don't know if it is already the case in new version, but it worth to try !

PS : There is apparently a Debug Plugin for PMS, but I don't know anymore ... maybe it can help.

EDIT : And give a look here http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=17246
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 23, 2013, 02:36:33 pm
@macfly92: please try to replace at line 898 this line
Code: [Select]
selectedProtocol = protocolby this line
Code: [Select]
selectedProtocol = DMRprotocoland tell me if it is better.

Same loading time with this modification.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 24, 2013, 06:24:53 am
I have now validated the good behaviour of the plugin with this server: FreeMi UPnP Media Server.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 24, 2013, 07:03:58 am
Come back to WEB radio.

@macfly92: can you try this WEB radio for example: http://mp3.live.tv-radio.com:80/fip/all/fiphautdebit.mp3
I would like to be sure that you have the same behaviour if the URL ends with ".mp3". Is the WEB radio started quickly in this case ?

I played with this URL "http://vipicecast.yacast.net:80/europe1" using FreeMi as server and XBMC as renderer, and I get some surprising results. Lauching this WEB radio through FreeMi, meaning with "http-get:*:audio/mpeg:*" as protocol, fails. If I launch this WEB radio directly from the UI (URI field), meaning without providing a protocol, it succeeds !
All WEB radios with an URL ending with ".mp3" launched through the FreeMi server are working well.
That would mean that providing the protocol information is not always the right solution... Or it is relative to the upnp:class tag that is provided in one case and not in the second case. All this is still not really clear. What it is sure is that it would be easier if all radio broadcasters would use URL ending with ".mp3".
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 24, 2013, 10:14:50 am
I never managed to get direct webradio work on my Sony BR.
The first time a webradio was play trough my Sony BR was with Bubble Upnp and his remux capability of shoutcast stream.
So I was looking for a more server oriented version of this, and I found PS3 Media Server, that can remux/transcode webradio.

URL ended with mp3 or not doesn't change anything.

Anyway, this is what I get in logfile when I tried to load directly a web radio trough the URI field as you ask me to test :

Code: [Select]
08      12/24/13 16:05:58.433   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Play <0x2da6f680>
08      12/24/13 16:05:58.434   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2da6f680>
08      12/24/13 16:05:58.434   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2da6f680>
08      12/24/13 16:05:58.434   JobHandler_LuaUPnP::HandleActionRequest argument action=Play <0x2da6f680>
08      12/24/13 16:05:58.434   JobHandler_LuaUPnP::HandleActionRequest argument URI=http://mp3.live.tv-radio.com:80/fip/all/fiphautdebit.mp3 <0x2da6f680>
08      12/24/13 16:05:58.689   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2e46f680>
08      12/24/13 16:05:58.690   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e46f680>
08      12/24/13 16:05:58.690   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e46f680>
08      12/24/13 16:05:58.690   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2e46f680>
08      12/24/13 16:05:58.690   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
  <InstanceID val="0">
    <TransportState val="TRANSITIONING"/>
  </InstanceID>
</Event>
 <0x2e46f680>
08      12/24/13 16:05:58.690   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:757c1e10-6cac-11e3-8000-544249199c7c <0x2e46f680>
01      12/24/13 16:05:58.871   luup_log:44: DLNA: error UPnP_request (SetAVTransportURI, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>716</errorCode><errorDescription>Action SetAVTransportURI failed
</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>] <0x2da6f680>
08      12/24/13 16:05:59.114   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2e46f680>
08      12/24/13 16:05:59.115   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e46f680>
08      12/24/13 16:05:59.115   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e46f680>
08      12/24/13 16:05:59.115   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2e46f680>
08      12/24/13 16:05:59.115   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
  <InstanceID val="0">
    <TransportState val="NO_MEDIA_PRESENT"/>
  </InstanceID>
</Event>
 <0x2e46f680>
08      12/24/13 16:05:59.116   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:757c1e10-6cac-11e3-8000-544249199c7c <0x2e46f680>
08      12/24/13 16:05:59.244   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2e46f680>
08      12/24/13 16:05:59.244   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e46f680>
08      12/24/13 16:05:59.244   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e46f680>
08      12/24/13 16:05:59.244   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2e46f680>
08      12/24/13 16:05:59.244   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
  <InstanceID val="0">
    <PlaybackStorageMedium val="NONE"/>
    <CurrentTrackURI val=""/>
    <CurrentTrackMetaData val=""/>
    <AVTransportURI val=""/>
    <AVTransportURIMetaData val=""/>
    <NumberOfTracks val="1"/>
    <CurrentTrack val="1"/>
    <CurrentTransportActions val="Play"/>
  </InstanceID>
</Event>
 <0x2e46f680>
08      12/24/13 16:05:59.245   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:757c1e10-6cac-11e3-8000-544249199c7c <0x2e46f680>
01      12/24/13 16:06:00.480   luup_log:44: DLNA: error UPnP_request (Play, urn:schemas-upnp-org:service:AVTransport:1): status=1 statusMsg=500 result=[<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>701</errorCode><errorDescription>Action Play failed
</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>] <0x2da6f680>
06      12/24/13 16:06:00.492   Device_Variable::m_szValue_set device: 44 service: urn:upnp-org:serviceId:AVTransport variable: TransportState was: PLAYING now: TRANSITIONING #hooks: 0 upnp: 0 v:0x8dc940/NONE duplicate:0 <0x2ad3b000>
06      12/24/13 16:06:00.571   Device_Variable::m_szValue_set device: 44 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1387897375 now: 1387897560 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2ad3b000>
04      12/24/13 16:06:00.572   <Job ID="3856" Name="" Device="44" Created="2013-12-24 16:05:58" Started="2013-12-24 16:05:58" Completed="2013-12-24 16:06:00" Duration="1.880621000" Runtime="1.878073000" Status="Successful" LastNote=""/> <0x2ad3b000>
06      12/24/13 16:06:00.573   Device_Variable::m_szValue_set device: 44 service: urn:upnp-org:serviceId:AVTransport variable: TransportState was: TRANSITIONING now: NO_MEDIA_PRESENT #hooks: 0 upnp: 0 v:0x8dc940/NONE duplicate:0 <0x2ad3b000>
06      12/24/13 16:06:00.671   Device_Variable::m_szValue_set device: 44 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1387897560 now: 1387897560 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ad3b000>
04      12/24/13 16:06:00.671   <Job ID="3857" Name="" Device="44" Created="2013-12-24 16:05:59" Started="2013-12-24 16:06:00" Completed="2013-12-24 16:06:00" Duration="1.555107000" Runtime="0.98516000" Status="Successful" LastNote=""/> <0x2ad3b000>
06      12/24/13 16:06:00.673   Device_Variable::m_szValue_set device: 44 service: urn:upnp-org:serviceId:AVTransport variable: CurrentTrackURI was: file://AudioIn now:  #hooks: 0 upnp: 0 v:0x84f6c8/NONE duplicate:0 <0x2ad3b000>
06      12/24/13 16:06:00.674   Device_Variable::m_szValue_set device: 44 service: urn:upnp-org:serviceId:AVTransport variable: CurrentTrackMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:av="urn:schemas-sony-com:av"> <item id="-1" parentID="-1" restricted="1"><dc:title>AudioIn</dc:title><upnp:class>object.item.audioItem</upnp:class><av:liveType>MUSIC_INPUT</av:liveType></item></DIDL-Lite>  now:  #hooks: 0 upnp: 0 v:0x850798/NONE duplicate:0 <0x2ad3b000>
06      12/24/13 16:06:00.675   Device_Variable::m_szValue_set device: 44 service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURI was: file://AudioIn now:  #hooks: 0 upnp: 0 v:0x84fbd8/NONE duplicate:0 <0x2ad3b000>
06      12/24/13 16:06:00.676   Device_Variable::m_szValue_set device: 44 service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURIMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:av="urn:schemas-sony-com:av"> <item id="-1" parentID="-1" restricted="1"><dc:title>AudioIn</dc:title><upnp:class>object.item.audioItem</upnp:class><av:liveType>MUSIC_INPUT</av:liveType></item></DIDL-Lite>  now:  #hooks: 0 upnp: 0 v:0x84fbf8/NONE duplicate:0 <0x2ad3b000>

Error 716 on SetAVTransportURI ....
Sure that if I can load directly webradio to Sony, this help the process a lot ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 24, 2013, 10:50:48 am
Sorry I was not clear, I mean trying this web radio through PMS. I want to check if it makes a difference for the Sony BR whether the URL ends with mp3 or not.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 24, 2013, 11:01:04 am
ah sorry, take a look on my current Webradio list and you will see I have both webradio that end with .mp3 or not and the loading time is the same. (WEB.conf PMS config file)

Code: [Select]
audiostream.Web,Radio=La Grosse Radio Rock,http://hd.lagrosseradio.info:8500,http://192.168.0.100/img/Radio/lgrrock.png
audiostream.Web,Radio=La Grosse Radio Metal,http://hd.lagrosseradio.info:8200,http://192.168.0.100/img/Radio/lgrmetal.png
audiostream.Web,Radio=La Grosse Radio Reggae,http://hd.lagrosseradio.info:8300,http://192.168.0.100/img/Radio/lgrreggae.png
audiostream.Web,Radio=Oui FM,http://broadcast.infomaniak.net/ouifm-high.mp3,http://192.168.0.100/img/Radio/ouifm.png
audiostream.Web,Radio=Latina,http://broadcast.infomaniak.ch/start-latina-high.mp3,http://192.168.0.100/img/Radio/logo.png
audiostream.Web,Radio=Cherie FM,http://mp3.live.tv-radio.com/cherie_fm/all/che_124310.mp3,http://192.168.0.100/img/Radio/cheriefm.png
audiostream.Web,Radio=Le Mouv,http://mp3.live.tv-radio.com/lemouv/all/lemouvhautdebit.mp3,http://192.168.0.100/img/Radio/lemouv.png
audiostream.Web,Radio=Nostalgie,http://mp3.live.tv-radio.com/nostalgie/all/nos_113812.mp3,http://192.168.0.100/img/Radio/nostalgie.png
audiostream.Web,Radio=RFM,http://vipicecast.yacast.net/rfm,http://192.168.0.100/img/Radio/rfm.png
audiostream.Web,Radio=Fun Radio,http://streaming.radio.funradio.fr:80/fun-1-44-96,http://www.radio-en-direct.com/radios/fun-radio/logo_fun_radio.png

But, with the PMS Translation, my Sony BR have this URI in memory when it play music : (PMS URI)

Code: [Select]
>La Grosse Radio Rock : http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock
>La Grosse Radio Metal : http://192.168.0.100:5001/get/0$2$1$2/La+Grosse+Radio+Metal
>La Grosse Radio Reggae : http://192.168.0.100:5001/get/0$2$1$3/La+Grosse+Radio+Reggae
>Oui FM : http://192.168.0.100:5001/get/0$2$1$4/Oui+FM
>Latina : http://192.168.0.100:5001/get/0$2$1$5/Latina
>Cherie FM : http://192.168.0.100:5001/get/0$2$1$6/Cherie+FM
>Le Mouv : http://192.168.0.100:5001/get/0$2$1$7/Le+Mouv
>Nostalgie : http://192.168.0.100:5001/get/0$2$1$8/Nostalgie
>RFM : http://192.168.0.100:5001/get/0$2$1$9/RFM
>Fun Radio : http://192.168.0.100:5001/get/0$2$1$10/Fun+Radio

So ... my Sony BR have never loaded a named .mp3 file ...

Did you see what I mean ? not sure I was clear ...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 24, 2013, 11:27:36 am
Whatever the transcoding applied by PMS, it looks like PMS provides metadata relative to the original file, which is weird. For example, my PS3 dispays a MP3 icon when I play a MP3 file from PMS, while what is exchanged is probably Dolby Digital, not MP3.

Ok, I am now out of new idea for your problem.
By the xay, I will include the 1,5s delay in the code.

What annoyes me is that I have unexplained problems with WEB radio (not rendered) when URL does not end with mp3 when trying to connect FreeMi to either XBMC or Windows Media Player, while it works very well as soon as the URL ends with mp3. That lets me think there is maybe something wrong in my code.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 24, 2013, 11:30:06 am
Quote
What annoyes me is that I have unexplained problems with WEB radio (not rendered) when URL does not end with mp3 when trying to connect FreeMi to either XBMC or Windows Media Player, while it works very well as soon as the URL ends with mp3. That lets me think there is maybe something wrong in my code.

But webradio not ending with .mp3 work with PMS no ? (it is the case for me)

So maybe it is a FreeMi bug ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 24, 2013, 11:47:05 am
Same result between FreeMi and Bubble UPnP as renderer.

Quote
What annoyes me is that I have unexplained problems with WEB radio (not rendered) when URL does not end with mp3 when trying to connect FreeMi to either XBMC or Windows Media Player, while it works very well as soon as the URL ends with mp3. That lets me think there is maybe something wrong in my code.

But webradio not ending with .mp3 work with PMS no ? (it is the case for me)

So maybe it is a FreeMi bug ?

With PMS, finally I don't know. The problem is that I have few radios defined in a m3u playlist and PMS seems to be unable to read the content of a m3u file.
A new problem but apparently not due to my plugin.
You have defined your WEB radio in a PMS config file ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 24, 2013, 11:50:14 am
Quote
You have defined your WEB radio in a PMS config file ?

Yes, I put the lines below into a file named WEB.conf at the same place as the PMS.conf is (depend on your plateform)

Code: [Select]
audiostream.Web,Radio=La Grosse Radio Rock,http://hd.lagrosseradio.info:8500,http://192.168.0.100/img/Radio/lgrrock.png
audiostream.Web,Radio=La Grosse Radio Metal,http://hd.lagrosseradio.info:8200,http://192.168.0.100/img/Radio/lgrmetal.png
audiostream.Web,Radio=La Grosse Radio Reggae,http://hd.lagrosseradio.info:8300,http://192.168.0.100/img/Radio/lgrreggae.png
audiostream.Web,Radio=Oui FM,http://broadcast.infomaniak.net/ouifm-high.mp3,http://192.168.0.100/img/Radio/ouifm.png
audiostream.Web,Radio=Latina,http://broadcast.infomaniak.ch/start-latina-high.mp3,http://192.168.0.100/img/Radio/logo.png
audiostream.Web,Radio=Cherie FM,http://mp3.live.tv-radio.com/cherie_fm/all/che_124310.mp3,http://192.168.0.100/img/Radio/cheriefm.png
audiostream.Web,Radio=Le Mouv,http://mp3.live.tv-radio.com/lemouv/all/lemouvhautdebit.mp3,http://192.168.0.100/img/Radio/lemouv.png
audiostream.Web,Radio=Nostalgie,http://mp3.live.tv-radio.com/nostalgie/all/nos_113812.mp3,http://192.168.0.100/img/Radio/nostalgie.png
audiostream.Web,Radio=RFM,http://vipicecast.yacast.net/rfm,http://192.168.0.100/img/Radio/rfm.png
audiostream.Web,Radio=Fun Radio,http://streaming.radio.funradio.fr:80/fun-1-44-96,http://www.radio-en-direct.com/radios/fun-radio/logo_fun_radio.png
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 24, 2013, 11:56:35 am
So maybe it is a FreeMi bug ?

I don't think there is a bug in FreeMi. The metadata looks good and it is working with my Freebox as a UPnP Media Player.

I just tried to use BubleUPnP as a control point to load the WEB radio from FreeMi in XBMC and same failure. For me, it is more a bug in the renderer (XBMC).
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 26, 2013, 04:48:05 pm
Hi Lolodomo ! Sorry, it's me .. again ...

I have a Strange behavior between PMS and GMrender on Pi with our plugin and maybe you can help me with this if you have some free times.

Problem : Loading a webradio from Ps3 Media Server to GMrender on Raspy.

Your plugin seem to provide the thumbnail of the webradio in AVTransportURI rather than the URI.

This is the log file :
Code: [Select]
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e0b3680>
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e0b3680>
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e0b3680>
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2e0b3680>
08      12/26/13 22:28:46.695   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=0$2$1$3 <0x2e0b3680>
08      12/26/13 22:28:46.818   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<AVTransportURI val="http://192.168.0.100:5001/get/0$2$1$3/thumbnail0000La+Grosse+Radio+Reggae"></AVTransportURI>
<AVTransportURIMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;&gt;&lt;item id=&quot;0$2$1$3&quot; parentID=&quot;0$2$1&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;La Grosse Radio Reggae - [FFmpeg Web Audio]&lt;/dc:title&gt;&lt;res protocolInfo=&quot;^(http%-get:[^:]-:image/jpeg[^:]-:.-)$&quot;&gt;http://192.168.0.100:5001/get/0$2$1$3/thumbnail0000La+Grosse+Radio+Reggae&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></AVTransportURIMetaData>
</InstanceID>
</Event>

While, as we seen before, the same action work (with pain, but work) with my Sony Renderer :
Code: [Select]
08      12/26/13 22:36:59.145   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e0b3680>
08      12/26/13 22:36:59.146   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e0b3680>
08      12/26/13 22:36:59.146   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e0b3680>
08      12/26/13 22:36:59.146   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2e0b3680>
08      12/26/13 22:36:59.146   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=0$2$1$3 <0x2e0b3680>
08      12/26/13 22:37:05.945   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2d8b3680>
08      12/26/13 22:37:05.945   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2d8b3680>
08      12/26/13 22:37:05.946   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2d8b3680>
08      12/26/13 22:37:05.946   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2d8b3680>
08      12/26/13 22:37:05.946   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
  <InstanceID val="0">
    <AVTransportURI val="http://192.168.0.100:5001/get/0$2$1$3/La+Grosse+Radio+Reggae"/>
  </InstanceID>
</Event>

Loading this webradio to Pi GMRender work with Bubble upnp as control point.
Loading this webradio to BubbleUpnp Media Renderer work with Bubble upnp as control point.
But I have the same problem when I try to load this PMS Webradio to BubbleUpnP as Media Renderer with DLNA Vera plugin.

Both of this devices are recognized by PMS as Android Device, so maybe it is related to there profiles in PMS (Android.conf) I will look into this way... but why Bubble Upnp as control point can do this ?

If I can provide you more information, just ask.

Thanks you.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 09:53:22 am
Hi macfly, please try the new version in trunk: http://code.mios.com/trac/mios_dlna-cntroller/browser/trunk#
One of the changes is that I have added in the Help tab the display of the protocols accepted by the Media Renderer.

Problem : Loading a webradio from Ps3 Media Server to GMrender on Raspy.

Your plugin seem to provide the thumbnail of the webradio in AVTransportURI rather than the URI.

This is the log file :
Code: [Select]
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e0b3680>
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e0b3680>
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e0b3680>
08      12/26/13 22:28:46.694   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2e0b3680>
08      12/26/13 22:28:46.695   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=0$2$1$3 <0x2e0b3680>
08      12/26/13 22:28:46.818   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2d8b3680>
08      12/26/13 22:28:46.819   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<AVTransportURI val="http://192.168.0.100:5001/get/0$2$1$3/thumbnail0000La+Grosse+Radio+Reggae"></AVTransportURI>
<AVTransportURIMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;&gt;&lt;item id=&quot;0$2$1$3&quot; parentID=&quot;0$2$1&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;La Grosse Radio Reggae - [FFmpeg Web Audio]&lt;/dc:title&gt;&lt;res protocolInfo=&quot;^(http%-get:[^:]-:image/jpeg[^:]-:.-)$&quot;&gt;http://192.168.0.100:5001/get/0$2$1$3/thumbnail0000La+Grosse+Radio+Reggae&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></AVTransportURIMetaData>
</InstanceID>
</Event>

I suppose that your renderer does not accept audio/L16 media type while your PMS is setup to transcode MP3 to LPCM. Can you check what are the protocols accepted by GMrender. You can now simply check that in the Help page or in the new pick-list I added in the Player tab beneath the URI field.

Quote
Loading this webradio to Pi GMRender work with Bubble upnp as control point.
Loading this webradio to BubbleUpnp Media Renderer work with Bubble upnp as control point.
But I have the same problem when I try to load this PMS Webradio to BubbleUpnP as Media Renderer with DLNA Vera plugin.

So probably BubbleUPnP is doing the work better than me. Unfortunately, I am a little out of new idea.
Please try the new entry "None" for protocol with PMS and tell me if it helps.
I will test PMS and web radio with BubbleUPnP as renderer later to see if I can find where are the problems.

For information, the new entry "None" for protocol did not solve my problem with FreeMi Media Server and Web radio. The problem seems to not be relative to the provided metadata. Maybe the stream delivered by FreeMi is not clean. If I use manually the URI produced by FreeMi, it fails. If I use the original URI of the Web radio, it succeeds.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 09:58:01 am
@macfly: I have discovered that the new 1,5s second added for your Sony BR  is a major problem when using TTS (with XBMC at least). The message is heard two times. Maybe because the file duration is short.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 10:05:05 am
On the web radio: It now appears that any web radio you want to play, must have ".mp3" on the end of the URL. Problem is that none of that stations I play have this in the URL but they will play if the mime type is provided as protocolInfo="http-get:*:audio/mpeg:*" by forcing it in the code. Do any radio stations use any other mime type? Could this mime type always be used for radio stations?

Hi a-lurker.

I have finally solved this problem by adding a new field in the UI to select the protocol (amongst all protocols accepted by the Renderer). And the Play action has now a Protocol parameter to provide this information. So to play one WEB radio, fill its URI in the URI field and select http-get:*:audio/mpeg:* as protocol. You can do the same thing in a scene with the Play action.
"None" in the UI and "" in the action has the same behaviour as before, meaning the protocol information is not provided to the Renderer.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 10:16:34 am
@macfly: I have discovered that the new 1,5s second added for your Sony BR  is a major problem when using TTS (with XBMC at least). The message is heard two times. Maybe because the file duration is short.

Ok, I think I know why. I have probably to consider the additional delay when computing the TTS message duration.

Maybe I should put this delay in a parameter (variable) as it might be a bad idea to force eveyone to work with this delay.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 27, 2013, 10:29:03 am
@macfly: I have discovered that the new 1,5s second added for your Sony BR  is a major problem when using TTS (with XBMC at least). The message is heard two times. Maybe because the file duration is short.

Ok, I think I know why. I have probably to consider the additional delay when computing the TTS message duration.

Maybe I should put this delay in a parameter (variable) as it might be a bad idea to force eveyone to work with this delay.

Yes I think  you should too. Why get all slower when it is just for one crappy device ?

I will test your fresh new version and report back asap, thanks you !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 27, 2013, 10:33:46 am
Quote
I suppose that your renderer does not accept audio/L16 media type while your PMS is setup to transcode MP3 to LPCM. Can you check what are the protocols accepted by GMrender. You can now simply check that in the Help page or in the new pick-list I added in the Player tab beneath the URI field.

And don't think it is the case. GMRender and Bubble upnp are recognized as a Android device by PMS, and my Sony BR is recognized as a Sony Blu-ray.
So two separate profiles are used by PMS to provide sounds.

When it use Android profile, it didn't transcode the stream into LPCM, it keep mp3.

I can see it because when I play to Sony BR, the stream are about 1500kbit/s and while I'm streaming to bubble or gmrender, the stream are about 320kbits/s only.

Anyway, I will report back the protocols info of my devices.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 27, 2013, 10:48:28 am
Ok I've got a problem with Trunk @ 15 :

I powered my gmrender, and when I click on the "Check" Button the state go ON and go OFF after 1 or 2 seconds.

In the log, the result of SinkProtocolInfo seem to not finish properly  :
Code: [Select]
06 12/27/13 16:43:57.544 Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:ConnectionManager variable: SinkProtocolInfo was:  now: http-get:*:application/x-subtitle-avi:*,http-get:*:video/x-msvideo:*,http-get:*:audio/x-iec958:*,http-get:*:audio/x-stm:*,http-get:*:audio/x-s3m:*,http-get:*:audio/x-it:*,http-get:*:audio/x-xm:*,http-get:*:audio/x-mod:*,http-get:*:application/x-gdp:*,http-get:*:audio/x-au:*,http-get:*:application/x-hls:*,http-get:*:audio/x-private1-ac3:*,http-get:*:video/webm:*,http-get:*:video/x-matroska:*,http-get:*:application/x-rdt:*,http-get:*:application/x-pn-realaudio:*,http-get:*:application/vnd.rn-realmedia:*,http-get:*:application/x-bzip:*,http-get:*:application/x-apetag:*,http-get:*:video/x-fli:*,http-get:*:audio/x-private1-lpcm:*,http-get:*:application/x-id3:*,http-get:*:application/x-ogg-avi:*,http-get:*:application/x-ogm-text:*,http-get:*:audio/x-opus:*,http-get:*:application/x-ogm-audio:*,http-get:*:application/x-ogm-video:*,http-get:*:application/x-annodex:*,http-get:*:application/x-gst_ff-wsvqa:*,http-get:*:application/x-gst_ff-wsaud:*,http-get:*:application/x-gst_ff-wc3movie:*,http-get:*:application/x-gst_ff-voc:*,http-get:*:application/x-gst_ff-vmd:*,http-get:*:audio/x-ttafile:*,http-get:*:application/x-shockwave-flash:*,http-get:*:application/x-gst_ff-psxstr:*,http-get:*:application/x-gst_ff-sol:*,http-get:*:application/x-gst_ff-smk:*,http-get:*:application/x-gst_ff-film_cpk:*,http-get:*:application/x-gst_ff-RoQ:*,http-get:*:application/x-gst_ff-nuv:*,http-get:*:application/x-gst_ff-nut:*,http-get:*:video/x-nsv:*,http-get:*:audio/x-musepack:*,http-get:*:application/x-gst_ff-mmf:*,http-get:*:application/x-gst_ff-mm:*,http-get:*:application/x-gst_ff-ipmovie:*,http-get:*:application/x-gst_ff-idcin:*,http-get:*:application/gxf:*,http-get:*:application/x-gst_ff-ffm:*,http-get:*:application/x-gst_ff-ea:*,http-get:*:application/x-gst_ff-daud:*,http-get:*:application/x-gst_ff-avs:*,http-get:*:application/x-ape:*,http-get:*:audio/x-dpcm:*,http-get:*:audio/x-gst_ff-ws_snd1:*,http-get:*:audio/x-wms:*,http-get:*:audio/x-gst_ff-vmdaudio:*,http-get:*:audio/x-twin-vq:*,http-get:*:audio/x-tta:*,http-get:*:audio/x-truespeech:*,http-get:*:audio/x-true-hd:*,http-get:*:audio/x-sipro:*,http-get:*:audio/x-shorten:*,http-get:*:audio/x-qdm2:*,http-get:*:audio/qcelp:*,http-get:*:audio/x-ffmpeg-parsed-musepack:*,http-get:*:audio/x-gst_ff-mp3on4:*,http-get:*:audio/x-gst_ff-mp3adu:*,http-get:*:audio/x-mlp:*,http-get:*:audio/x-mace:*,http-get:*:audio/x-imc:*,http-get:*:audio/x-pn-realaudio:*,http-get:*:audio/x-vnd.sony.atrac3:*,http-get:*:audio/x-vnd.sony.atrac1:*,http-get:*:audio/x-ffmpeg-parsed-ape:*,http-get:*:video/x-zmbv:*,http-get:*:video/x-zlib:*,http-get:*:video/x-gst_ff-xl:*,http-get:*:video/x-xan:*,http-get:*:video/x-gst_ff-wnv1:*,http-get:*:video/x-gst_ff-vqavideo:*,http-get:*:video/x-vp6:*,http-get:*:video/x-vp5:*,http-get:*:video/x-vp3:*,http-get:*:video/x-vmnc:*,http-get:*:video/x-gst_ff-vmdvideo:*,http-get:*:video/x-ati-vcr:*,http-get:*:video/x-ultimotion:*,http-get:*:video/x-camtasia:*,http-get:*:video/x-truemotion:*,http-get:*:video/sp5x:*,http-get:*:video/x-gst_ff-snow:*,http-get:*:video/x-smc:*,http-get:*:image/x-sgi:*,http-get:*:video/x-pn-realvideo:*,http-get:*:video/x-apple-video:*,http-get:*:video/x-gst_ff-roqvideo:*,http-get:*:video/x-gst_ff-qpeg:*,http-get:*:video/x-qdrw:*,http-get:*:image/ppm:*,http-get:*:video/x-gst_ff-pgmyuv:*,http-get:*:image/pbm:*,http-get:*:video/x-mszh:*,http-get:*:video/x-msvideocodec:*,http-get:*:video/x-rle:*,http-get:*:video/x-msmpeg:*,http-get:*:video/x-3ivx:*,http-get:*:video/x-gst_ff-mmvideo:*,http-get:*:video/x-mjpeg-b:*,http-get:*:video/x-mimic:*,http-get:*:video/x-gst_ff-mdec:*,http-get:*:video/x-loco:*,http-get:*:video/x-lagarith:*,http-get:*:video/x-kmvc:*,http-get:*:video/x-gst_ff-interplayvideo:*,http-get:*:video/x-indeo:*,http-get:*:video/x-gst_ff-idcinvideo:*,http-get:*:video/x-huffyuv:*,http-get:*:video/x-intel-h263:*,http-get:*:video/x-h261:*,http-get:*:video/x-fraps:*,http-get:*:video/x-4xm:*,http-get:*:video/x-gst_ff-flic:*,http-get:*:video/x-gst_ff-ffvhuff:*,http-get:*:video/x-ffv:*,http-get:*:video/x-gst_ff-8bps:*,http-get:*:video/x-compressed-yuv:*,http-get:*:video/x-camstudio:*,http-get:*:video/x-cirrus-logic-accupak:*,http-get:*:video/x-cinepak:*,http-get:*:video/x-gst_ff-cavs:*,http-get:*:video/x-gst_ff-avs:*,http-get:*:video/x-asus:*,http-get:*:unknown/unknown:*,http-get:*:video/x-amv:*,http-get:*:video/x-aasc:*,http-get:*:text/x-cmml:*,http-get:*:audio/x-nellymoser:*,http-get:*:video/x-vp6-alpha:*,http-get:*:video/x-vp6-flash:*,http-get:*:video/x-flash-screen:*,http-get:*:video/x-flash-video:*,http-get:*:audio/x-wavpack-correction:*,http-get:*:audio/x-wavpack:*,http-get:*:audio/x-private1-dts:*,http-get:*:video/x-mp4-part:*,http-get:*:video/x-qt-part:*,http-get:*:video/x-svq:*,http-get:*:video/x-divx:*,http-get:*:audio/alac:*,http-get:*:audio/x-alac:*,http-get:*:application/x-3gp:*,http-get:*:audio/mp4:*,http-get:*:audio/m4a:*,http-get:*:audio/x-m4a:*,http-get:*:video/mj2:*,http-get:*:video/quicktime:*,http-get:*:application/ogg:*,http-get:*:hdv/aux-a:*,http-get:*:hdv/aux-v:*,http-get:*:application/x-yuv4mpeg:*,http-get:*:image/x-pcx:*,http-get:*:image/x-tga:*,http-get:*:image/x-bitmap:*,http-get:*:image/vnd.wap.wbmp:*,http-get:*:image/x-MS-bmp:*,http-get:*:image/x-bmp:*,http-get:*:image/bmp:*,http-get:*:image/tiff:*,http-get:*:image/x-pixmap:*,http-get:*:image/x-sun-raster:*,http-get:*:image/x-cmu-raster:*,http-get:*:application/x-navi-animation:*,http-get:*:image/x-icon:*,http-get:*:image/gif:*,http-get:*:video/x-vcd:*,http-get:*:video/x-cdxa:*,http-get:*:image/svg:*,http-get:*:image/svg+xml:*,http-get:*:audio/x-vgm:*,http-get:*:audio/x-spc:*,http-get:*:audio/x-sap:*,http-get:*:audio/x-nsf:*,http-get:*:audio/x-kss:*,http-get:*:audio/x-hes:*,http-get:*:audio/x-gym:*,http-get:*:audio/x-gbs:*,http-get:*:audio/x-ay:*,http-get:*:video/x-dnxhd:*,http-get:*:application/mxf:*,http-get:*:video/x-pwc2:*,http-get:*:video/x-pwc1:*,http-get:*:video/x-sonix:*,http-get:*:video/x-raw-bayer:*,http-get:*:video/x-surface:*,http-get:*:video/x-wmv:*,http-get:*:audio/x-wma:*,http-get:*:audio/x-eac3:*,http-get:*:audio/x-amr-wb-sh:*,http-get:*:audio/x-amr-nb-sh:*,http-get:*:audio/ms-gsm:*,http-get:*:video/x-ms-asf:*,http-get:*:application/sdp:*,http-get:*:subpicture/x-dvb:*,http-get:*:video/x-mve:*,http-get:*:application/x-raw-sdi:*,http-get:*:audio/x-dts:*,http-get:*:video/x-vp8:*,http-get:*:audio/x-lpcm:*,http-get:*:video/x-smoke:*,http-get:*:multipart/x-mixed-replace:*,http-get:*:audio/x-vorbis:*,http-get:*:video/x-theora:*,http-get:*:audio/x-speex:*,http-get:*:video/x-jpeg:*,http-get:*:video/x-h263:*,http-get:*:audio/AMR-WB:*,http-get:*:audio/x-gsm:*,http-get:*:audio/G729:*,http-get:*:audio/G723:*,http-get:*:audio/G722:*,http-get:*:audio/x-iLBC:*,http-get:*:video/x-dv:*,http-get:*:audio/x-celt:*,http-get:*:audio/x-bv:*,http-get:*:audio/x-ac3:*,http-get:*:audio/ac3:*,http-get:*:application/x-rtcp:*,http-get:*:application/x-rtp:*,http-get:*:image/x-portable-anymap:*,http-get:*:image/x-portable-pixmap:*,http-get:*:image/x-portable-graymap:*,http-get:*:image/x-portable-bitmap:*,http-get:*:video/x-nuv:*,http-get:*:audio/x-sid:*,http-get:*:application/x-icy:*,http-get:*:audio/riff-midi:*,http-get:*:audio/midi:*,http-get:*:subpicture/x-pgs:*,http-get:*:video/x-ivf:*,http-get:*:audio/AMR:*,http-get:*:video/x-flv:*,http-get:*:audio/x-wav:*,http-get:*:video/x-h264:*,http-get:*:application/x-kate: <0x2e12f680>

I think the result is not full...

Full log file when I click on the Check button are in the attached file.

And, I don't have this problem with Sony BR, as his protocolSink is a lot shorter :
Code: [Select]
SinkProtocolInfo :
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
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 01:34:38 pm
Ok I've got a problem with Trunk @ 15 :

I powered my gmrender, and when I click on the "Check" Button the state go ON and go OFF after 1 or 2 seconds.

Very interesting because it is a problem that has already been noticed by a user of the Sonos plugin. But I was not able to get more information from the user.
There are really very few cases where I set variable Online to "0". I have added additional traces in the attached file. Can you upload the new file and reload please and then attach the new logs.

And then please check if the UPnP event proxy is alive oor dead.

Quote
In the log, the result of SinkProtocolInfo seem to not finish properly

No, I think it is just truncated in the logs because of too big.
As soon as the other problem is fixed, you will be able to check that it is ok checking the value in the Help tab.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 27, 2013, 02:04:30 pm
Strange ... it works with this file ...state stay ON but you say to me you've just added some additional traces ?

I always checked if upnp proxy run since I have the bug with the transition time before with the Sony BR.

Code: [Select]
08      12/27/13 20:00:45.981   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: SelectDMRDevice <0x2e34f680>
08      12/27/13 20:00:45.981   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2e34f680>
08      12/27/13 20:00:45.981   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e34f680>
08      12/27/13 20:00:45.981   JobHandler_LuaUPnP::HandleActionRequest argument action=SelectDMRDevice <0x2e34f680>
08      12/27/13 20:00:45.981   JobHandler_LuaUPnP::HandleActionRequest argument URL=http://192.168.0.123:49494/description.xml <0x2e34f680>
06      12/27/13 20:00:45.982   Device_Variable::m_szValue_set device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 variable: DescriptionURL was: http://192.168.0.123:49494/description.xml now: http://192.168.0.123:49494/description.xml #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2e34f680>
06      12/27/13 20:00:46.005   Device_Variable::m_szValue_set device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 variable: Online was: 0 now: 1 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2e34f680>
06      12/27/13 20:00:46.006   Device_Variable::m_szValue_set device: 41 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1388170784 now: 1388170845 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2e34f680>
02      12/27/13 20:00:46.100   luup_log:42: TEMPAVG- Automatic data refresh called <0x2d14f680>
02      12/27/13 20:00:46.101   luup_log:42: TEMPAVG- Device [20]:tempEntree = 21 <0x2d14f680>
02      12/27/13 20:00:46.101   luup_log:42: TEMPAVG- Device [7]:tempCuisine = 21 <0x2d14f680>
02      12/27/13 20:00:46.102   luup_log:42: TEMPAVG- Average temperature = 21 <0x2d14f680>
02      12/27/13 20:00:46.102   luup_log:42: TEMPAVG- Refresh interval: 60 <0x2d14f680>
08      12/27/13 20:00:46.115   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyRenderingChange <0x2dd4f680>
08      12/27/13 20:00:46.115   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2dd4f680>
08      12/27/13 20:00:46.116   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2dd4f680>
08      12/27/13 20:00:46.116   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyRenderingChange <0x2dd4f680>
08      12/27/13 20:00:46.116   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/">
<InstanceID val="0">
<GreenVideoGain val="0"></GreenVideoGain>
<BlueVideoBlackLevel val="0"></BlueVideoBlackLevel>
<VerticalKeystone val="0"></VerticalKeystone>
<GreenVideoBlackLevel val="0"></GreenVideoBlackLevel>
<Volume val="75" channel="Master"></Volume>
<Loudness val="0" channel="Master"></Loudness>
<RedVideoGain val="0"></RedVideoGain>
<ColorTemperature val="0"></ColorTemperature>
<Sharpness val="0"></Sharpness>
<RedVideoBlackLevel val="0"></RedVideoBlackLevel>
<BlueVideoGain val="0"></BlueVideoGain>
<Mute val="0" channel="Master"></Mute>
<HorizontalKeystone val="0"></HorizontalKeystone>
<VolumeDB val="-2560" channel="Master"></VolumeDB>
<PresetNameList val=""></PresetNameList>
<Contrast val="0"></Contrast>
<Brightness val="0"></Brightness>
</InstanceID>
</Event>
 <0x2dd4f680>
08      12/27/13 20:00:46.116   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:30f889c0-1dd2-11b2-87f9-a175ec20f3c9 <0x2dd4f680>
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 27, 2013, 02:05:21 pm
And you're right as always, the protocol infos of GMRender seem to be complete in the Help tab :

Code: [Select]
http-get:*:application/x-subtitle-avi:*,http-get:*:video/x-msvideo:*,http-get:*:audio/x-iec958:*,http-get:*:audio/x-stm:*,http-get:*:audio/x-s3m:*,http-get:*:audio/x-it:*,http-get:*:audio/x-xm:*,http-get:*:audio/x-mod:*,http-get:*:application/x-gdp:*,http-get:*:audio/x-au:*,http-get:*:application/x-hls:*,http-get:*:audio/x-private1-ac3:*,http-get:*:video/webm:*,http-get:*:video/x-matroska:*,http-get:*:application/x-rdt:*,http-get:*:application/x-pn-realaudio:*,http-get:*:application/vnd.rn-realmedia:*,http-get:*:application/x-bzip:*,http-get:*:application/x-apetag:*,http-get:*:video/x-fli:*,http-get:*:audio/x-private1-lpcm:*,http-get:*:application/x-id3:*,http-get:*:application/x-ogg-avi:*,http-get:*:application/x-ogm-text:*,http-get:*:audio/x-opus:*,http-get:*:application/x-ogm-audio:*,http-get:*:application/x-ogm-video:*,http-get:*:application/x-annodex:*,http-get:*:application/x-gst_ff-wsvqa:*,http-get:*:application/x-gst_ff-wsaud:*,http-get:*:application/x-gst_ff-wc3movie:*,http-get:*:application/x-gst_ff-voc:*,http-get:*:application/x-gst_ff-vmd:*,http-get:*:audio/x-ttafile:*,http-get:*:application/x-shockwave-flash:*,http-get:*:application/x-gst_ff-psxstr:*,http-get:*:application/x-gst_ff-sol:*,http-get:*:application/x-gst_ff-smk:*,http-get:*:application/x-gst_ff-film_cpk:*,http-get:*:application/x-gst_ff-RoQ:*,http-get:*:application/x-gst_ff-nuv:*,http-get:*:application/x-gst_ff-nut:*,http-get:*:video/x-nsv:*,http-get:*:audio/x-musepack:*,http-get:*:application/x-gst_ff-mmf:*,http-get:*:application/x-gst_ff-mm:*,http-get:*:application/x-gst_ff-ipmovie:*,http-get:*:application/x-gst_ff-idcin:*,http-get:*:application/gxf:*,http-get:*:application/x-gst_ff-ffm:*,http-get:*:application/x-gst_ff-ea:*,http-get:*:application/x-gst_ff-daud:*,http-get:*:application/x-gst_ff-avs:*,http-get:*:application/x-ape:*,http-get:*:audio/x-dpcm:*,http-get:*:audio/x-gst_ff-ws_snd1:*,http-get:*:audio/x-wms:*,http-get:*:audio/x-gst_ff-vmdaudio:*,http-get:*:audio/x-twin-vq:*,http-get:*:audio/x-tta:*,http-get:*:audio/x-truespeech:*,http-get:*:audio/x-true-hd:*,http-get:*:audio/x-sipro:*,http-get:*:audio/x-shorten:*,http-get:*:audio/x-qdm2:*,http-get:*:audio/qcelp:*,http-get:*:audio/x-ffmpeg-parsed-musepack:*,http-get:*:audio/x-gst_ff-mp3on4:*,http-get:*:audio/x-gst_ff-mp3adu:*,http-get:*:audio/x-mlp:*,http-get:*:audio/x-mace:*,http-get:*:audio/x-imc:*,http-get:*:audio/x-pn-realaudio:*,http-get:*:audio/x-vnd.sony.atrac3:*,http-get:*:audio/x-vnd.sony.atrac1:*,http-get:*:audio/x-ffmpeg-parsed-ape:*,http-get:*:video/x-zmbv:*,http-get:*:video/x-zlib:*,http-get:*:video/x-gst_ff-xl:*,http-get:*:video/x-xan:*,http-get:*:video/x-gst_ff-wnv1:*,http-get:*:video/x-gst_ff-vqavideo:*,http-get:*:video/x-vp6:*,http-get:*:video/x-vp5:*,http-get:*:video/x-vp3:*,http-get:*:video/x-vmnc:*,http-get:*:video/x-gst_ff-vmdvideo:*,http-get:*:video/x-ati-vcr:*,http-get:*:video/x-ultimotion:*,http-get:*:video/x-camtasia:*,http-get:*:video/x-truemotion:*,http-get:*:video/sp5x:*,http-get:*:video/x-gst_ff-snow:*,http-get:*:video/x-smc:*,http-get:*:image/x-sgi:*,http-get:*:video/x-pn-realvideo:*,http-get:*:video/x-apple-video:*,http-get:*:video/x-gst_ff-roqvideo:*,http-get:*:video/x-gst_ff-qpeg:*,http-get:*:video/x-qdrw:*,http-get:*:image/ppm:*,http-get:*:video/x-gst_ff-pgmyuv:*,http-get:*:image/pbm:*,http-get:*:video/x-mszh:*,http-get:*:video/x-msvideocodec:*,http-get:*:video/x-rle:*,http-get:*:video/x-msmpeg:*,http-get:*:video/x-3ivx:*,http-get:*:video/x-gst_ff-mmvideo:*,http-get:*:video/x-mjpeg-b:*,http-get:*:video/x-mimic:*,http-get:*:video/x-gst_ff-mdec:*,http-get:*:video/x-loco:*,http-get:*:video/x-lagarith:*,http-get:*:video/x-kmvc:*,http-get:*:video/x-gst_ff-interplayvideo:*,http-get:*:video/x-indeo:*,http-get:*:video/x-gst_ff-idcinvideo:*,http-get:*:video/x-huffyuv:*,http-get:*:video/x-intel-h263:*,http-get:*:video/x-h261:*,http-get:*:video/x-fraps:*,http-get:*:video/x-4xm:*,http-get:*:video/x-gst_ff-flic:*,http-get:*:video/x-gst_ff-ffvhuff:*,http-get:*:video/x-ffv:*,http-get:*:video/x-gst_ff-8bps:*,http-get:*:video/x-compressed-yuv:*,http-get:*:video/x-camstudio:*,http-get:*:video/x-cirrus-logic-accupak:*,http-get:*:video/x-cinepak:*,http-get:*:video/x-gst_ff-cavs:*,http-get:*:video/x-gst_ff-avs:*,http-get:*:video/x-asus:*,http-get:*:unknown/unknown:*,http-get:*:video/x-amv:*,http-get:*:video/x-aasc:*,http-get:*:text/x-cmml:*,http-get:*:audio/x-nellymoser:*,http-get:*:video/x-vp6-alpha:*,http-get:*:video/x-vp6-flash:*,http-get:*:video/x-flash-screen:*,http-get:*:video/x-flash-video:*,http-get:*:audio/x-wavpack-correction:*,http-get:*:audio/x-wavpack:*,http-get:*:audio/x-private1-dts:*,http-get:*:video/x-mp4-part:*,http-get:*:video/x-qt-part:*,http-get:*:video/x-svq:*,http-get:*:video/x-divx:*,http-get:*:audio/alac:*,http-get:*:audio/x-alac:*,http-get:*:application/x-3gp:*,http-get:*:audio/mp4:*,http-get:*:audio/m4a:*,http-get:*:audio/x-m4a:*,http-get:*:video/mj2:*,http-get:*:video/quicktime:*,http-get:*:application/ogg:*,http-get:*:hdv/aux-a:*,http-get:*:hdv/aux-v:*,http-get:*:application/x-yuv4mpeg:*,http-get:*:image/x-pcx:*,http-get:*:image/x-tga:*,http-get:*:image/x-bitmap:*,http-get:*:image/vnd.wap.wbmp:*,http-get:*:image/x-MS-bmp:*,http-get:*:image/x-bmp:*,http-get:*:image/bmp:*,http-get:*:image/tiff:*,http-get:*:image/x-pixmap:*,http-get:*:image/x-sun-raster:*,http-get:*:image/x-cmu-raster:*,http-get:*:application/x-navi-animation:*,http-get:*:image/x-icon:*,http-get:*:image/gif:*,http-get:*:video/x-vcd:*,http-get:*:video/x-cdxa:*,http-get:*:image/svg:*,http-get:*:image/svg+xml:*,http-get:*:audio/x-vgm:*,http-get:*:audio/x-spc:*,http-get:*:audio/x-sap:*,http-get:*:audio/x-nsf:*,http-get:*:audio/x-kss:*,http-get:*:audio/x-hes:*,http-get:*:audio/x-gym:*,http-get:*:audio/x-gbs:*,http-get:*:audio/x-ay:*,http-get:*:video/x-dnxhd:*,http-get:*:application/mxf:*,http-get:*:video/x-pwc2:*,http-get:*:video/x-pwc1:*,http-get:*:video/x-sonix:*,http-get:*:video/x-raw-bayer:*,http-get:*:video/x-surface:*,http-get:*:video/x-wmv:*,http-get:*:audio/x-wma:*,http-get:*:audio/x-eac3:*,http-get:*:audio/x-amr-wb-sh:*,http-get:*:audio/x-amr-nb-sh:*,http-get:*:audio/ms-gsm:*,http-get:*:video/x-ms-asf:*,http-get:*:application/sdp:*,http-get:*:subpicture/x-dvb:*,http-get:*:video/x-mve:*,http-get:*:application/x-raw-sdi:*,http-get:*:audio/x-dts:*,http-get:*:video/x-vp8:*,http-get:*:audio/x-lpcm:*,http-get:*:video/x-smoke:*,http-get:*:multipart/x-mixed-replace:*,http-get:*:audio/x-vorbis:*,http-get:*:video/x-theora:*,http-get:*:audio/x-speex:*,http-get:*:video/x-jpeg:*,http-get:*:video/x-h263:*,http-get:*:audio/AMR-WB:*,http-get:*:audio/x-gsm:*,http-get:*:audio/G729:*,http-get:*:audio/G723:*,http-get:*:audio/G722:*,http-get:*:audio/x-iLBC:*,http-get:*:video/x-dv:*,http-get:*:audio/x-celt:*,http-get:*:audio/x-bv:*,http-get:*:audio/x-ac3:*,http-get:*:audio/ac3:*,http-get:*:application/x-rtcp:*,http-get:*:application/x-rtp:*,http-get:*:image/x-portable-anymap:*,http-get:*:image/x-portable-pixmap:*,http-get:*:image/x-portable-graymap:*,http-get:*:image/x-portable-bitmap:*,http-get:*:video/x-nuv:*,http-get:*:audio/x-sid:*,http-get:*:application/x-icy:*,http-get:*:audio/riff-midi:*,http-get:*:audio/midi:*,http-get:*:subpicture/x-pgs:*,http-get:*:video/x-ivf:*,http-get:*:audio/AMR:*,http-get:*:video/x-flv:*,http-get:*:audio/x-wav:*,http-get:*:video/x-h264:*,http-get:*:application/x-kate:*,http-get:*:video/x-dvd-subpicture:*,http-get:*:text/x-pango-markup:*,http-get:*:text/plain:*,http-get:*:subtitle/x-kate:*,http-get:*:audio/x-adpcm:*,http-get:*:private/teletext:*,http-get:*:audio/x-mulaw:*,http-get:*:audio/x-alaw:*,http-get:*:audio/x-siren:*,http-get:*:audio/L16;rate=44100;channels=2:*,http-get:*:audio/x-scpls:*,http-get:*:audio/x-mpeg:*,http-get:*:audio/mpeg:*,http-get:*:application/x-subtitle-qttext:*,http-get:*:application/x-subtitle-dks:*,http-get:*:application/x-subtitle-mpl2:*,http-get:*:application/x-subtitle-tmplayer:*,http-get:*:application/x-subtitle-sami:*,http-get:*:application/x-subtitle:*,http-get:*:raw/x-pcap:*,http-get:*:audio/x-flac:*,http-get:*:image/png:*,http-get:*:image/jpeg:*,http-get:*:video/x-dirac:*,http-get:*:video/x-raw-grey:*,http-get:*:audio/x-raw-float:*,http-get:*:audio/aiff:*,http-get:*:audio/x-aiff:*,http-get:*:image/jp2:*,http-get:*:image/x-jpc:*,http-get:*:image/x-j2c:*,http-get:*:video/mpegts:*,http-get:*:audio/x-raw-int:*,http-get:*:video/mpeg:*,http-get:*:video/x-xvid:*,http-get:*:application/x-ssa:*,http-get:*:application/x-ass:*,http-get:*:audio/*:*,http-get:*:video/x-raw-gray:*,http-get:*:video/x-raw-rgb:*,http-get:*:video/x-raw-yuv:*
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 02:21:53 pm
And you're right as always, the protocol infos of GMRender seem to be complete in the Help tab :

So I see http-get:*:audio/L16;rate=44100;channels=2:*
It was not what I expected to find. But it might be the proper way to define this media type.
We have to compare with what PMS is proposing. Maybe PMS is proposing 48000 Hz rather than 44100 Hz ?
What is certain is that http-get:*:audio/L16:* will not match with http-get:*:audio/L16;rate=44100;channels=2:* with my current code.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 02:23:59 pm
Strange ... it works with this file ...state stay ON but you say to me you've just added some additional traces ?

Yes, and note that I did not change anything relative to that in the last version.
Please try again with the file in trunk, I don't think it is relative to this code itself.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 02:26:17 pm
Here is a part of the BrowseResult answer for webradios when browsing this MediaServer with DMR plugin :
Code: [Select]
<item id="0$2$1$1" parentID="0$2$1" restricted="true">
<dc:title>La Grosse Radio Rock - [FFmpeg Web Audio]</dc:title>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.0.100:5001/get/0$2$1$1/thumbnail0000La+Grosse+Radio+Rock</res>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
</item>
<item id="0$2$1$2" parentID="0$2$1" restricted="true">
<dc:title>La Grosse Radio Metal - [FFmpeg Web Audio]</dc:title>
<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$2/La+Grosse+Radio+Metal</res>
[ ................. ]

That's confirmed, your PMS is setup to convert to 48000 Hz while GMrender is expecting 44100 Hz.
You have an option in PMS to uncheck this rate conversion.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 02:42:55 pm
Regarding BubbleUPnP, I find all these entries:
http-get:*:audio/L16;rate=11025;channels=1:*
http-get:*:audio/L16;rate=22050;channels=1:*
http-get:*:audio/L16;rate=44100;channels=1:*
http-get:*:audio/L16;rate=48000;channels=1:*
http-get:*:audio/L16;rate=88200;channels=1:*
http-get:*:audio/L16;rate=96000;channels=1:*
http-get:*:audio/L16;rate=176400;channels=1:*
http-get:*:audio/L16;rate=192000;channels=1:*
http-get:*:audio/L16;rate=11025;channels=2:*
http-get:*:audio/L16;rate=22050;channels=2:*
http-get:*:audio/L16;rate=44100;channels=2:*
http-get:*:audio/L16;rate=48000;channels=2:*
http-get:*:audio/L16;rate=88200;channels=2:*
http-get:*:audio/L16;rate=96000;channels=2:*
http-get:*:audio/L16;rate=176400;channels=2:*
http-get:*:audio/L16;rate=192000;channels=2:*

So you have to check what protocol is exposed by PMS in the pick-list to see if there is a matching or not.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 03:17:34 pm
Quote
You have defined your WEB radio in a PMS config file ?

Yes, I put the lines below into a file named WEB.conf at the same place as the PMS.conf is (depend on your plateform)

Code: [Select]
audiostream.Web,Radio=La Grosse Radio Rock,http://hd.lagrosseradio.info:8500,http://192.168.0.100/img/Radio/lgrrock.png
audiostream.Web,Radio=La Grosse Radio Metal,http://hd.lagrosseradio.info:8200,http://192.168.0.100/img/Radio/lgrmetal.png
audiostream.Web,Radio=La Grosse Radio Reggae,http://hd.lagrosseradio.info:8300,http://192.168.0.100/img/Radio/lgrreggae.png
audiostream.Web,Radio=Oui FM,http://broadcast.infomaniak.net/ouifm-high.mp3,http://192.168.0.100/img/Radio/ouifm.png
audiostream.Web,Radio=Latina,http://broadcast.infomaniak.ch/start-latina-high.mp3,http://192.168.0.100/img/Radio/logo.png
audiostream.Web,Radio=Cherie FM,http://mp3.live.tv-radio.com/cherie_fm/all/che_124310.mp3,http://192.168.0.100/img/Radio/cheriefm.png
audiostream.Web,Radio=Le Mouv,http://mp3.live.tv-radio.com/lemouv/all/lemouvhautdebit.mp3,http://192.168.0.100/img/Radio/lemouv.png
audiostream.Web,Radio=Nostalgie,http://mp3.live.tv-radio.com/nostalgie/all/nos_113812.mp3,http://192.168.0.100/img/Radio/nostalgie.png
audiostream.Web,Radio=RFM,http://vipicecast.yacast.net/rfm,http://192.168.0.100/img/Radio/rfm.png
audiostream.Web,Radio=Fun Radio,http://streaming.radio.funradio.fr:80/fun-1-44-96,http://www.radio-en-direct.com/radios/fun-radio/logo_fun_radio.png

It was difficult to find the right WEB.conf on my PC but after several minutes and a Google search, I finally found the right file on my PC !

I understand now what is happening. The MIME type returned by PMS is not audio/L16;rate=48000;channels=2 but MIMETYPE_AUTO;rate=48000;channels=2
So of course the matching fails. I don't know if this is compliant with the DLNA standard. I imagine that MIMETYPE_AUTO has to match with anything...

Can you confirm what protocols are proposed by your PMS for your WEB radio ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 27, 2013, 03:48:04 pm
Note that using BubbleUPnP as a control point to connect PMS (a WEB radio defined in WEB.conf) to XBMC results in a crash of XBMC !
I am not sure that PMS is really reliable for that...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 28, 2013, 05:54:42 am
Strange ... it works with this file ...state stay ON but you say to me you've just added some additional traces ?

Yes, and note that I did not change anything relative to that in the last version.
Please try again with the file in trunk, I don't think it is relative to this code itself.

Ok man, trunk@15's file reuploaded. I didin't reboot vera, just reload LUA.
And I can't reproduce the bug. I was checked upnp proxy daemon.

I will stay with the trunk file, to see if the bug reappear later.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 06:02:13 am
@macfly: regarding PMS, my Windows version does not include MPlayer and so transcoding is done with FFmpeg. I will add code to manage MIMETYPE_AUTO.
But is it what delivers your version of PMS ? One of your previous logs did not show MIMETYPE_AUTO but audio/L16. That's stange we don't have the same thing.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 28, 2013, 06:43:42 am
Quote
Can you confirm what protocols are proposed by your PMS for your WEB radio ?

This is what I get from PMS for a webradio :

Code: [Select]
BrowseResult was: <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/"><item id="0$2$1$1" parentID="0$2$1" restricted="true"><dc:title>La Grosse Radio Rock - [FFmpeg Web Audio]</dc:title><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.0.100:5001/get/0$2$1$1/thumbnail0000La+Grosse+Radio+Rock</res><upnp:class>object.item.audioItem.musicTrack</upnp:class></item><item id="0$2$1$2" parentID="0$2$1" restricted="true">

And when I Manually check protocol (http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01) when I hit play, it works ! ( so it seem that in automatic mode, the plugin use the Jpeg profile)

BTW I don't Understand why PMS didn't propose direct mp3 instead of audio PCM while it can do It to GMrender.
I can force PMS to match device to a profile (renderer's profiles in PMS are stored in PMS_REP\renderers\*.conf) with the PMS config "renderer_force_ip" (ex : renderer_force_ip = Sony Blu-ray@192.168.0.19 ) So I will try to try different profiles to see if it change something.

On my Linux version, PMS used ffmpeg too for transcoding. This is what I see in PMS log file while playing a webradio :
Code: [Select]
INFO  2013-12-28 12:42:09.786 [New I/O server worker #1-4] Starting transcode/remux of La Grosse Radio Reggae
DEBUG 2013-12-28 12:42:09.788 [ffmpeg-13] Starting ffmpeg -y -loglevel fatal -threads 8 -i http://hd.lagrosseradio.info:8300 -threads 8 -f s16be -ar 48000 pipe:
INFO  2013-12-28 12:42:09.909 [ffmpeg-13] Successfully initialized buffer to 50? 000? 000 bytes.
DEBUG 2013-12-28 12:42:09.910 [ffmpeg-13] Attaching thread: ffmpeg-13
DEBUG 2013-12-28 12:42:09.910 [ffmpeg-13] Unix process ID (ffmpeg): 31369
INFO  2013-12-28 12:42:15.788 [StartPlaying Event] Started sending http://hd.lagrosseradio.info:8300 to unknown renderer on 192.168.0.123
DEBUG 2013-12-28 12:42:21.493 [Thread-51] Stream mapping:
DEBUG 2013-12-28 12:42:21.493 [Thread-51]   Stream #0.0 -> #0.0
DEBUG 2013-12-28 12:42:21.493 [Thread-51] Press ctrl-c to stop encoding
DEBUG 2013-12-28 12:42:21.493 [Thread-51] Error while decoding stream #0.0
DEBUG 2013-12-28 12:42:22.063 [Thread-51] size=    4207kB time=22.44 bitrate=1536.0kbits/s
DEBUG 2013-12-28 12:42:22.606 [Thread-51] size=    4315kB time=23.01 bitrate=1536.0kbits/s
DEBUG 2013-12-28 12:42:23.109 [Thread-51] size=    4403kB time=23.48 bitrate=1536.0kbits/s
DEBUG 2013-12-28 12:42:23.668 [Thread-51] size=    4501kB time=24.01 bitrate=1536.0kbits/s
DEBUG 2013-12-28 12:42:24.241 [Thread-51] size=    4614kB time=24.61 bitrate=1536.0kbits/s
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 28, 2013, 06:48:34 am
@macfly: regarding PMS, my Windows version does not include MPlayer and so transcoding is done with FFmpeg. I will add code to manage MIMETYPE_AUTO.
But is it what delivers your version of PMS ? One of your previous logs did not show MIMETYPE_AUTO but audio/L16. That's stange we don't have the same thing.

Not sure how to check this.

This is maybe related to profile binding too !
Gmrender is recognized as an Unknow device by PMS, and Bubble Upnp as an Android device.
I will force GMrender to match to Android profile to see if it change something.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 28, 2013, 07:03:24 am
This is very strange :)

When I bind GMrender to an Android device in PMS config :

- Automatic protocol use the jpeg profile
- It seem I see the same profile infos, I got the same list in protocol field.

Code: [Select]
<InstanceID val="0">
<AVTransportURI val="http://192.168.0.100:5001/get/0$2$1$6/Cherie+FM"></AVTransportURI>
<AVTransportURIMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;&gt;&lt;item id=&quot;0$2$1$6&quot; parentID=&quot;0$2$1&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;Cherie FM - [FFmpeg Web Audio]&lt;/dc:title&gt;&lt;res protocolInfo=&quot;http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01&quot;&gt;http://192.168.0.100:5001/get/0$2$1$6/Cherie+FM&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></AVTransportURIMetaData>
</InstanceID>
</Event>

And when I manually check the First Audio/L16 profile, it work BUT in PMS log file I can see a transcoding output speed at only 320kbits/s instead of 1500kbit/s as you see in my previous post.
Code: [Select]
INFO  2013-12-28 12:54:44.103 [StartPlaying Event] Started sending http://hd.lagrosseradio.info:8300 to Android on 192.168.0.123
INFO  2013-12-28 12:54:44.103 [StartPlaying Event] Started sending http://hd.lagrosseradio.info:8300 to Android on 192.168.0.123
DEBUG 2013-12-28 12:54:49.605 [Thread-22] Stream mapping:
DEBUG 2013-12-28 12:54:49.605 [Thread-22]   Stream #0.0 -> #0.0
DEBUG 2013-12-28 12:54:49.605 [Thread-22] Press ctrl-c to stop encoding
DEBUG 2013-12-28 12:54:49.605 [Thread-22] Error while decoding stream #0.0
DEBUG 2013-12-28 12:54:50.112 [Thread-22] size=     653kB time=16.73 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:50.703 [Thread-22] size=     893kB time=22.87 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:51.229 [Thread-22] size=     915kB time=23.42 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:51.739 [Thread-22] size=     938kB time=24.00 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:52.286 [Thread-22] size=     956kB time=24.48 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:52.895 [Thread-22] size=     969kB time=24.82 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:53.397 [Thread-22] size=     996kB time=25.49 bitrate= 320.0kbits/s
DEBUG 2013-12-28 12:54:53.999 [Thread-22] size=    1022kB time=26.16 bitrate= 320.0kbits/s

Maybe I must try to bind my Sony BR to an Android device :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 07:08:25 am
Quote
Can you confirm what protocols are proposed by your PMS for your WEB radio ?

This is what I get from PMS for a webradio :

Code: [Select]
BrowseResult was: <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/"><item id="0$2$1$1" parentID="0$2$1" restricted="true"><dc:title>La Grosse Radio Rock - [FFmpeg Web Audio]</dc:title><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01" size="9223372034707292159">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN">http://192.168.0.100:5001/get/0$2$1$1/thumbnail0000La+Grosse+Radio+Rock</res><upnp:class>object.item.audioItem.musicTrack</upnp:class></item><item id="0$2$1$2" parentID="0$2$1" restricted="true">

Strange, we don't get the same thing. Maybe something has changed in PMS and we are not using the same version (1.90.1 for me).
One thing weird with your version is that PMS lists 3 times the same res !!

Quote
And when I Manually check protocol (http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01) when I hit play, it works ! ( so it seem that in automatic mode, the plugin use the Jpeg profile)

You are now using GMrender or BubbleUPnP as renderer ?

If GMrender, I don't understand how it can work even with a manual selection because the matching should fail (only 44100 on renderer side while 48000 on server side). That would mean a bug in my matching code because it should be normally rejected.

If BubbleUPnP, automatic should work as well as manual.

Ok, I will add few additional traces again.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 07:18:06 am
This is very strange :)

When I bind GMrender to an Android device in PMS config :

- Automatic protocol use the jpeg profile
- It seem I see the same profile infos, I got the same list in protocol field.

jpeg is used because others are not matching with the renderer (due to 48000 vs 44100).

Quote
And when I manually check the First Audio/L16 profile, it work

Normally, the plugin should reject this case.

Quote
BUT in PMS log file I can see a transcoding output speed at only 320kbits/s instead of 1500kbit/s as you see in my previous post.

What I see in the two cases is a clear decoding error message :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 28, 2013, 07:45:14 am
Quote
What I see in the two cases is a clear decoding error message
In my PMS, I always got this error message, but after you will see the stream started and report his status twice per second and the music play.
And you can notice the stream is at 320kbits/s in the second post rather than 1500kbits/s in the first. But don't bother you with this thing...

Quote
If GMrender, I don't understand how it can work even with a manual selection because the matching should fail (only 44100 on renderer side while 48000 on server side). That would mean a bug in my matching code because it should be normally rejected.
I use PMS for Linux 1.90.1, and my previous test was with GMrender as Renderer.

I don't find the way to transcode to 44100 in PMS, i'll seek further.

Anyway, I will not use PMS to play webradio through GMrenderer because it can play the direct webradio Link. PMS is only used to transcode streams to my Sony BR because it can't handle it directly.
It is more for your testing purpose, so go further if you want, but don't bother if you don't.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 08:47:29 am
For the image selected when in AUTO mode, I found the "error". I was not stopping when a matching was ok. So the last one was considered. I have changed to stop as soon one is ok. Please try with the new attached file.
I have added few traces, I would be curious to see in these traces what matching is ok with GMrender as renderer.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 08:56:44 am
I don't find the way to transcode to 44100 in PMS, i'll seek further.

Go in "R?glages transcodage" and click on FFmpeg Audio. Then you see an option "Automatic audio resampling to 44,1 or 48 kHz".  It is not exactly an option to force 44,1 KHz.
But you say that it works well even with 48 KHz, so don't loose your time with this option. I just want to understand what protocol matching is ok, as I would expect a matching failure.

Quote
Anyway, I will not use PMS to play webradio through GMrenderer because it can play the direct webradio Link. PMS is only used to transcode streams to my Sony BR because it can't handle it directly.
It is more for your testing purpose, so go further if you want, but don't bother if you don't.

Thank you, any help to debug the plugin with different DMS and DMR is appreciated. So I would like to get something working well with PMS and any renderer.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 09:39:15 am
I propose we create a table listing all DMS and DMR compatibility tested with the plugin. When the plugin is not able to render a media, we will signal it only in case the same DMS/DMR combination is working well with the same media and another control point.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 10:24:09 am
Few additional notes.

Regarding FreeMi Media Server and WEB radio not ending with .mp3, it is working well with BubbleUPnP as renderer. BubbleUPnP as control point fails to render the same radio on XBMC. So I will stop searching a solution for that case, because it looks like a problem on XBMC side, not something specific to my plugin.

Regarding PMS, you're right macfly, the server is using different profiles depending on the connected renderer. We can see that in PMS logs. With BubbleUPnP as renderer, it uses Android profile and I am able to render a MP3 and a FLAC file, apparently without any decoding (if what BubbleUPnP is displaying at screen is correct). With XBMC as renderer, it uses XBMC profile and I am able to render a MP3 file but not a FLAC file. That could be a bug in FFmpeg. I will play with XBMC profile in PMS to understand how this server is working.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 28, 2013, 11:00:12 am
This is maybe related to profile binding too !
Gmrender is recognized as an Unknow device by PMS, and Bubble Upnp as an Android device.
I will force GMrender to match to Android profile to see if it change something.

I now understand the concept of PMS profiles.
When no profile is found, what setup is used ? The setup defined in the PMS UI ?

PS: I see an existing profile for XBMC
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 28, 2013, 07:18:59 pm
This is maybe related to profile binding too !
Gmrender is recognized as an Unknow device by PMS, and Bubble Upnp as an Android device.
I will force GMrender to match to Android profile to see if it change something.

I now understand the concept of PMS profiles.
When no profile is found, what setup is used ? The setup defined in the PMS UI ?

PS: I see an existing profile for XBMC

Yes profiles just override default configuration.

I can't make noise a this time, so I'll try your new file tomorrow morning, I promise.

Your idea to create a compatibility and tested list is a great idea. I think you must add it the first post of this Thread .

I've see another free DLNA Server named Serviio, it seem to be much popular. I'll test it if I have some spare time.

Keep going man, this is a great job !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 29, 2013, 05:54:55 am
For the image selected when in AUTO mode, I found the "error". I was not stopping when a matching was ok. So the last one was considered. I have changed to stop as soon one is ok. Please try with the new attached file.
I have added few traces, I would be curious to see in these traces what matching is ok with GMrender as renderer.

Ok, automatic selection works ! Here is the log file when used with GMrender :

Code: [Select]
08      12/29/13 11:54:12.840   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia __LEAK__ this:28672 start:1921024 to 0x1088000 <0x2dda5680>
08      12/29/13 11:54:12.840   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2dda5680>
08      12/29/13 11:54:12.840   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2dda5680>
08      12/29/13 11:54:12.841   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2dda5680>
08      12/29/13 11:54:12.841   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=0$2$1$1 <0x2dda5680>
08      12/29/13 11:54:12.841   JobHandler_LuaUPnP::HandleActionRequest argument Protocol=AUTO <0x2dda5680>
50      12/29/13 11:54:12.981   luup_log:41: DLNA: selected protocol AUTO <0x2dda5680>
50      12/29/13 11:54:12.982   luup_log:41: DLNA: server protocol http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01 <0x2dda5680>
50      12/29/13 11:54:12.982   luup_log:41: DLNA: server protocol considered <0x2dda5680>
50      12/29/13 11:54:13.004   luup_log:41: DLNA: Matching with DMR protocol ^(http%-get:[^:]-:audio/[^:]-[^:]-:.-)$ <0x2dda5680>
08      12/29/13 11:54:13.109   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2d5a5680>
08      12/29/13 11:54:13.109   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2d5a5680>
08      12/29/13 11:54:13.109   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2d5a5680>
08      12/29/13 11:54:13.110   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2d5a5680>
08      12/29/13 11:54:13.110   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<AVTransportURI val="http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock"></AVTransportURI>
<AVTransportURIMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;&gt;&lt;item id=&quot;0$2$1$1&quot; parentID=&quot;0$2$1&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;La Grosse Radio Rock - [FFmpeg Web Audio]&lt;/dc:title&gt;&lt;res protocolInfo=&quot;http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01&quot;&gt;http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></AVTransportURIMetaData>
</InstanceID>
</Event>
 <0x2d5a5680>
08      12/29/13 11:54:13.110   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:9a84da82-1dd1-11b2-be10-f50b6f916c52 <0x2d5a5680>
06      12/29/13 11:54:14.667   Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURI was: http://192.168.0.100:8895/resource/1000000010001621/MEDIA_ITEM/MP3-0/ORIGINAL now: http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock #hooks: 0 upnp: 0 v:0xacad30/NONE duplicate:0 <0x2b072000>
06      12/29/13 11:54:14.697   Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURIMetaData was: <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item id="A_OF^FOL_$OI1000000010001621" parentID="A_OF" restricted="1"><dc:title>Oui FM</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:date>2013-12-27</dc:date><res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=8D500000000000000000000000000000">http://192.168.0.100:8895/resource/1000000010001621/MEDIA_ITEM/MP3-0/ORIGINAL</res></item></DIDL-Lite> now: <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/"><item id="0$2$1$1" parentID="0$2$1" restricted="true"><dc:title>La Grosse Radio Rock - [FFmpeg Web Audio]</dc:title><res protocolInfo="http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01">http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock</res><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> #hooks: 0 upnp: 0 v:0xacad50/NONE duplicate:0 <0x2b072000>
06      12/29/13 11:54:14.701   Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:AVTransport variable: CurrentRadio was: Oui FM now: La Grosse Radio Rock - [FFmpeg Web Audio] #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2b072000>
06      12/29/13 11:54:14.702   Device_Variable::m_szValue_set device: 41 service: urn:upnp-org:serviceId:AVTransport variable: CurrentStatus was: Oui FM now: La Grosse Radio Rock - [FFmpeg Web Audio]: Oui FM #hooks: 0 upnp: 0 v:0xb26ce0/NONE duplicate:0 <0x2b072000>
08      12/29/13 11:54:14.705   JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2d5a5680>
08      12/29/13 11:54:14.705   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=41 <0x2d5a5680>
08      12/29/13 11:54:14.705   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2d5a5680>
08      12/29/13 11:54:14.705   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2d5a5680>
08      12/29/13 11:54:14.706   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<TransportState val="PLAYING"></TransportState>
<CurrentTransportActions val="PAUSE,STOP,SEEK"></CurrentTransportActions>
<CurrentTrackURI val="http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock"></CurrentTrackURI>
<CurrentTrackMetaData val="&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot;&gt;&lt;item id=&quot;0$2$1$1&quot; parentID=&quot;0$2$1&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;La Grosse Radio Rock - [FFmpeg Web Audio]&lt;/dc:title&gt;&lt;res protocolInfo=&quot;http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01&quot;&gt;http://192.168.0.100:5001/get/0$2$1$1/La+Grosse+Radio+Rock&lt;/res&gt;&lt;upnp:class&gt;object.item.audioItem.musicTrack&lt;/upnp:class&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;"></CurrentTrackMetaData>
</InstanceID>
</Event>
 <0x2d5a5680>

I added in PMS Config the audio_resample = false to disable the re-sampling, but not sure if it done something.

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 29, 2013, 07:11:11 am
I've installed Serviio Media Server 1.4.

It is a pretty cool DMS, more settings than PMS and more customization. More faster to start multiple transcoding and switching between stream.

There are a Paid version but the free version doing the jobs fine (Paid is for remote uses I saw)

On the Serviio console, It can discover my whole rendering devices (including the Wifi's ones).

With your plugin, it seem it work like a charm :

Serviio --> Sony DMR  - Ok (Auto mode)
Serviio --> GMrender  - Ok (Auto mode)
Serviio --> BubbleUpnp  - Ok (Auto mode)

The cool thing for my case is with my Blu-Ray. Serviio seem to transcode Webradio to a compatible mp3 profile to my Sony BR !
Here is the AVTransportURIMetaData while playing :

Code: [Select]
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item id="A_OF^FOL_$OI1000000020001969" parentID="A_OF" restricted="1">
<dc:title>LGR - Rock</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class>
<dc:date>2013-12-29</dc:date>
<res protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=8D500000000000000000000000000000">http://192.168.0.100:8895/resource/1000000020001969/MEDIA_ITEM/MP3-0/ORIGINAL</res>
</item>
</DIDL-Lite>

I think i will migrate from PMS to Serviio for my Webradio distribution in my HAN.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 29, 2013, 08:42:19 am
For the image selected when in AUTO mode, I found the "error". I was not stopping when a matching was ok. So the last one was considered. I have changed to stop as soon one is ok. Please try with the new attached file.
I have added few traces, I would be curious to see in these traces what matching is ok with GMrender as renderer.

Ok, automatic selection works ! Here is the log file when used with GMrender :

Ok, I see now why it works. I did not see this entry in GMrender: http-get:*:audio/*:*
With that protocol included, any control point should accept to connect more or less any audio stream to GMrender.
Note that in XBMC, we even have this protocol included: http-get:*:*:* meaning everything is accepted ;)

Finally, explanation found and problem solved with PMS in your case.

But still remains to handle MIMETYPE_AUTO in my case.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 29, 2013, 11:13:53 am
I've installed Serviio Media Server 1.4.

...

With your plugin, it seem it work like a charm :

Serviio --> Sony DMR  - Ok (Auto mode)
Serviio --> GMrender  - Ok (Auto mode)
Serviio --> BubbleUpnp  - Ok (Auto mode)

The cool thing for my case is with my Blu-Ray. Serviio seem to transcode Webradio to a compatible mp3 profile to my Sony BR !
Here is the AVTransportURIMetaData while playing :

Interesting. Have you a fast starting playback ?
So you think that the original MP3 stream is simply not compatible with your Sony BR. It would have no link with the protocol info we provide ? But what could be wrong in this MP3 stream ?
To validate your hypothesis, and now that you have a working case with Serviio Media Server, I would be curious to validate that it still works even if the plugin forces that protocol: http-get:*:audio/mpeg:*, that is without the final part DLNA.ORG_PN=MP3;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=8D500000000000000000000000000000
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 29, 2013, 12:43:12 pm
I've installed Serviio Media Server 1.4.

...

With your plugin, it seem it work like a charm :

Serviio --> Sony DMR  - Ok (Auto mode)
Serviio --> GMrender  - Ok (Auto mode)
Serviio --> BubbleUpnp  - Ok (Auto mode)

The cool thing for my case is with my Blu-Ray. Serviio seem to transcode Webradio to a compatible mp3 profile to my Sony BR !
Here is the AVTransportURIMetaData while playing :

Interesting. Have you a fast starting playback ?
So you think that the original MP3 stream is simply not compatible with your Sony BR. It would have no link with the protocol info we provide ? But what could be wrong in this MP3 stream ?
To validate your hypothesis, and now that you have a working case with Serviio Media Server, I would be curious to validate that it still works even if the plugin forces that protocol: http-get:*:audio/mpeg:*, that is without the final part DLNA.ORG_PN=MP3;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=8D500000000000000000000000000000

No fast starting, Sony BR continu to take aprox 1 min in Transitioning State before playing, but with MP3 I saved some IP flow.

I've tested to play with forced protocol selection and it work.
Code: [Select]
08      12/29/13 18:39:11.015   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e047680>
08      12/29/13 18:39:11.015   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=44 <0x2e047680>
08      12/29/13 18:39:11.015   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e047680>
08      12/29/13 18:39:11.015   JobHandler_LuaUPnP::HandleActionRequest argument action=PlayDMSMedia <0x2e047680>
08      12/29/13 18:39:11.016   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=A_OF^FOL_$OI1000000040001408 <0x2e047680>
08      12/29/13 18:39:11.016   JobHandler_LuaUPnP::HandleActionRequest argument Protocol=AUTO <0x2e047680>
50      12/29/13 18:39:11.025   luup_log:44: DLNA: selected protocol AUTO <0x2e047680>
50      12/29/13 18:39:11.025   luup_log:44: DLNA: server protocol http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=8D500000000000000000000000000000 <0x2e047680>
50      12/29/13 18:39:11.026   luup_log:44: DLNA: server protocol considered <0x2e047680>
50      12/29/13 18:39:11.026   luup_log:44: DLNA: Matching with DMR protocol ^(http%-get:[^:]-:audio/mpeg[^:]-:.-)$ <0x2e047680>

Provide me a code without the final part and I will test it. If I can test it in "Test LUA Code" it will be better but if not don't care.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 29, 2013, 01:12:12 pm
Based on the script I used to load Webradio, I try this code :

Code: [Select]
local descriptionURL =  luup.variable_get("urn:dlna-org:serviceId:DLNAMediaController1", "DescriptionURL", 44)
local lul_arguments = {}
lul_arguments["URL"] = descriptionURL
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "SelectDMRDevice", lul_arguments, 44)
local lul_arguments = {}
lul_arguments["DescriptionURL"] = "http://192.168.0.100:8895/deviceDescription/26f23a08-b29c-32cb-9e8e-478dc9a82680"
lul_arguments["ObjectID"] = "A_OF"
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "BrowseDMS", lul_arguments, 44)
local lul_arguments = {}
lul_arguments["ObjectID"] = "A_OF^FOL_$OI1000000040001408"
lul_arguments["Protocol"] = "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3"
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "PlayDMSMedia", lul_arguments, 44)

... Without the end of the protocol info, but it is not enough, the plugin skip the protocol matching ...

Code: [Select]
08      12/29/13 19:08:16.688   JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:dlna-org:serviceId:DLNAMediaController1 action: PlayDMSMedia <0x2e047680>
08      12/29/13 19:08:16.688   JobHandler_LuaUPnP::HandleActionRequest argument ObjectID=A_OF^FOL_$OI1000000040001408 <0x2e047680>
08      12/29/13 19:08:16.689   JobHandler_LuaUPnP::HandleActionRequest argument Protocol=http-get:*:audio/mpeg:DLNA.ORG_PN=MP3 <0x2e047680>
50      12/29/13 19:08:16.692   luup_log:44: DLNA: selected protocol http-get:*:audio/mpeg:DLNA.ORG_PN=MP3 <0x2e047680>
50      12/29/13 19:08:16.693   luup_log:44: DLNA: server protocol http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=8D500000000000000000000000000000 <0x2e047680>
50      12/29/13 19:08:16.693   luup_log:44: DLNA: server protocol bypassed <0x2e047680>
50      12/29/13 19:08:16.693   luup_log:44: DLNA: server protocol http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=00D00000000000000000000000000000 <0x2e047680>
50      12/29/13 19:08:16.694   luup_log:44: DLNA: server protocol bypassed <0x2e047680>
02      12/29/13 19:08:16.694   luup_log:44: DLNA: Media cannot be rendered by the selected renderer. <0x2e047680>
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 29, 2013, 04:29:40 pm
Based on the script I used to load Webradio, I try this code :

Code: [Select]
local descriptionURL =  luup.variable_get("urn:dlna-org:serviceId:DLNAMediaController1", "DescriptionURL", 44)
local lul_arguments = {}
lul_arguments["URL"] = descriptionURL
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "SelectDMRDevice", lul_arguments, 44)
local lul_arguments = {}
lul_arguments["DescriptionURL"] = "http://192.168.0.100:8895/deviceDescription/26f23a08-b29c-32cb-9e8e-478dc9a82680"
lul_arguments["ObjectID"] = "A_OF"
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "BrowseDMS", lul_arguments, 44)
local lul_arguments = {}
lul_arguments["ObjectID"] = "A_OF^FOL_$OI1000000040001408"
lul_arguments["Protocol"] = "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3"
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "PlayDMSMedia", lul_arguments, 44)

... Without the end of the protocol info, but it is not enough, the plugin skip the protocol matching ...

Yes, normal.

Note that in the next version, you will be able to do that thing with a unique call to PlayDMSMedia. I have added a DescriptionURL parameter for that.

But for the test I would like to do, it requires a temporary patch in the code. I will give you or even provide the file.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 30, 2013, 06:55:32 am

Note that in the next version, you will be able to do that thing with a unique call to PlayDMSMedia. I have added a DescriptionURL parameter for that.
This is a great news, much more simple to script !

Quote
But for the test I would like to do, it requires a temporary patch in the code. I will give you or even provide the file.
No problem, happy to help !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 30, 2013, 07:51:48 am

Note that in the next version, you will be able to do that thing with a unique call to PlayDMSMedia. I have added a DescriptionURL parameter for that.
This is a great news, much more simple to script !

But probably too much difficult for a normal user to find the server description URL and the server object ID.
I could display these information but place is missing ... a scrollbar will appear if I add these information at the bottom of the window.

Quote
Quote
But for the test I would like to do, it requires a temporary patch in the code. I will give you or even provide the file.
No problem, happy to help !

Merci beaucoup pour ton aide et tous tes tests. Gr?ce ? toi, on a, je pense, fait un ?norme pas en avant.

I think we have now something that should work with almost every DMS and DMR.
I will release a new version 0.4 soon.
I hope we can have soon a feedback from users that were here at the beginning. I am curious to know for example if it works with Panasonic TV.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 30, 2013, 08:17:49 am

Note that in the next version, you will be able to do that thing with a unique call to PlayDMSMedia. I have added a DescriptionURL parameter for that.

This is a great news, much more simple to script !

But probably too much difficult for a normal user to find the server description URL and the server object ID.
I could display these information but place is missing ... a scrollbar will appear if I add these information at the bottom of the window.
[/quote]
I know that ...I must parse the Vera log to catch infos. but how to do a simplest way to script this thing ? Maybe a separate DMS Browser plugin to help to grab desired data ?

Quote
But for the test I would like to do, it requires a temporary patch in the code. I will give you or even provide the file.
No problem, happy to help !

Merci beaucoup pour ton aide et tous tes tests. Gr?ce ? toi, on a, je pense, fait un ?norme pas en avant.

I think we have now something that should work with almost every DMS and DMR.
I will release a new version 0.4 soon.
I hope we can have soon a feedback from users that were here at the beginning. I am curious to know for example if it works with Panasonic TV.

Merci beaucoup a toi, c'est toi qui fait tout le boulot ! :) je trouve que ce plugin est un gros ajout a la Vera, et je trouve dommage de ne pas avoir plus d'implication de la part de l'equipe Micasaverde. (il n'aime pas les accents ce forum :))

And yes, we need more users to test more devices, and Lolodomo is tired to read only me ! :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 30, 2013, 09:40:42 am
And yes, we need more users to test more devices, and Lolodomo is tired to read only me ! :)

 ;D
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 30, 2013, 09:48:54 am
I know that ...I must parse the Vera log to catch infos. but how to do a simplest way to script this thing ? Maybe a separate DMS Browser plugin to help to grab desired data ?

I see the following options:
1 - put informations in the Player tab and accepting to have a scrollbar and scroll in the window to see all the information
2 - moving stuff relative to the server in a new tab, separated from the Player tab. We could have one DMS + one DMR tab.
3 - using a new variable to store information corresponding to the last played server media and displaying these information in the Help tab.

What solution would be the best in your opinion ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 30, 2013, 10:56:04 am
And yes, we need more users to test more devices, and Lolodomo is tired to read only me ! :)

 ;D

In addition, we are two French people that trying to discuss in English between us to permit people to follow our (his) work ! So come help us ! :)

I know that ...I must parse the Vera log to catch infos. but how to do a simplest way to script this thing ? Maybe a separate DMS Browser plugin to help to grab desired data ?

I see the following options:
1 - put informations in the Player tab and accepting to have a scrollbar and scroll in the window to see all the information
2 - moving stuff relative to the server in a new tab, separated from the Player tab. We could have one DMS + one DMR tab.
3 - using a new variable to store information corresponding to the last played server media and displaying these information in the Help tab.

What solution would be the best in your opinion ?

IMO, we could ban the first option... we must keep a clean UI as much as we can, especially the player tab, and those informations are needed only few times for scripting purpose...

The Third option seem to be ok for me, the Help tab is here to provide additional data, so It might be the good place to put in it ... until ...

... until maybe you plan to add more features to the server part, maybe a playlist system or something like that. If it is the plan, we must think about a separated server tab.
Not sure what is the goal you gave to you, but I think a playlist system (and the standard abilities to shuffle, edit, save or import/export them, with or without openhome functions) would be an awesome feature to have a fully complete DLNA Control Point.

Okok, I know it will give you 6 more month of work... sorry about that :) but it would be cool !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 30, 2013, 03:04:52 pm
Quote

I see the following options:
1 - put informations in the Player tab and accepting to have a scrollbar and scroll in the window to see all the information
2 - moving stuff relative to the server in a new tab, separated from the Player tab. We could have one DMS + one DMR tab.
3 - using a new variable to store information corresponding to the last played server media and displaying these information in the Help tab.

What solution would be the best in your opinion ?

IMO, we could ban the first option... we must keep a clean UI as much as we can, especially the player tab, and those informations are needed only few times for scripting purpose...

The Third option seem to be ok for me, the Help tab is here to provide additional data, so It might be the good place to put in it ... until ...

... until maybe you plan to add more features to the server part, maybe a playlist system or something like that. If it is the plan, we must think about a separated server tab.
Not sure what is the goal you gave to you, but I think a playlist system (and the standard abilities to shuffle, edit, save or import/export them, with or without openhome functions) would be an awesome feature to have a fully complete DLNA Control Point.

I will probably not add a lot of new features simply because we have already almost everything ;D but I will certainly implement playlists as defined by UPnP AV, hoping most of DMS and DMR implement this feature.
I just read the UPnP AV spec relative to playlists and it seems that I have simply to get the playlist URI from the container object representing for example the music album. So it should be easy to implement.
But I have to imagine how to adjust the UI for that, maybe just add an additional entry in the media pick list starting with "Playlist " and followed by the name of the playlist.

Ok, so option 3 looks good to me too. That's better to have everything in one place, while it is possible, even if now place is missing. I still have the option to move TTS fileds elsewehre if I need a new line.

Quote
Okok, I know it will give you 6 more month of work... sorry about that :) but it would be cool !

Maybe, it is less than one hour to add playlist ;)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 30, 2013, 04:54:44 pm
I just read the UPnP AV spec relative to playlists and it seems that I have simply to get the playlist URI from the container object representing for example the music album. So it should be easy to implement.

Unfortunately, this playlist feature is not implemented by the Media Servers I checked (XBMC, FreeMi, ...), except Sonos server.

Bad chance.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 30, 2013, 06:34:13 pm
The playlist feature seem to be pretty rare in upnp devices. That is why Bubble upnp server can handle an openhome feature over every renderer on a LAN to manage the playlist.
When you do a discover, you will see two device for each renderer, one with openhome feature.

Anyway, Is it not possible to do a playlist system managed by the Vera plugin ?
In my mind, I thought a DMS Tab that help us to browse content and create a playlist, but the playlist is managed by the Plugin itself!
When the first item was played and reach the end, it receive the stop notification and it automatically play the next item from his generated playlist, etc... Or maybe one or 2 second before the end of the track ? (don't know if we can get this data)

And after, the ability to store them, edit, play shuffled, as I wrote.

Because in our daily lives, loading each song one by one will be pretty annoying. isn't it?

this is why i wrote ... 6 months :P
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 31, 2013, 06:11:03 am
The playlist feature seem to be pretty rare in upnp devices. That is why Bubble upnp server can handle an openhome feature over every renderer on a LAN to manage the playlist.
When you do a discover, you will see two device for each renderer, one with openhome feature.

I take a quick look to OpenHome Media. It seems to be based on UPnP standards with specific services. Support could be not too much difficult as we already have all the UPnP basis (low level stuff). But of course, work is required to use the new services. I am not yet sure if a new plugin should be created or if the current plugin could be enhanced to manage at the same time the DLNA standard and the OhMedia standard.
The problem is the lack of products supporting this standard. With this standard, the playlists are managed on the renderer side.

Regarding BubbleUPnP Server ( http://www.bubblesoftapps.com/bubbleupnpserver/ ) converting a DLNA Media Renderer into a OpenHome Media renderer, that's interesting. I see a version exists for Windows, I will test it.
It is even possible to install it on a Raspi: http://blog.scphillips.com/2013/07/playing-music-on-a-raspberry-pi-using-upnp-and-dlna-revisited/
If I correctly understand, BubbleUPnP Server has to be installed on the computer running the Media Renderer ?
That would be an interesting solution, except that it is not included in a OpenELEC or raspBMC distribution, and of course not in your Sony BR. ;)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 31, 2013, 06:55:53 am
Nop, Bubble upnp server can be installed anywhere on your LAN.

It will scan the network to seek renderer, and then you can add OpenHome feature over each one in the web config GUI.
After added that, you will see two renderer for each with the same name except an "(openhome)" addition to one.
If I understood right, It is the goal of bubble upnp server, add openhome feature to a not compatible renderer.
You can load a playlist to it, and it convert it to basic upnp command (pretty in the same way than I wrote before with the playlist part of your plugin)

I think this is the easiest way to implement playlist feature, but it will require a third party software.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 31, 2013, 07:31:04 am
Anyway, Is it not possible to do a playlist system managed by the Vera plugin ?
In my mind, I thought a DMS Tab that help us to browse content and create a playlist, but the playlist is managed by the Plugin itself!
When the first item was played and reach the end, it receive the stop notification and it automatically play the next item from his generated playlist, etc... Or maybe one or 2 second before the end of the track ? (don't know if we can get this data)

And after, the ability to store them, edit, play shuffled, as I wrote.

Your solution consists in a full control of the playlist by the control point itself. But the Media Renderer will not see the playlist at all. A special playlist mode should be created in which Prev and Next actions have a different behaviour. That's doable but not a real satisfying solution.

A better solution could be to simulate in the Vera the missing playlist feature in DMS. All items contained in a container object (for example an album) would become a playlist associated to this container object, a playlist handled by the Vera itself in place of the Media server. But it requires to provide a WEB URL to the renderer. This URL should return the playlist, a m3u file containing the Media server URLs of each item.
The plugin could create the m3u files in /www and delivers the corresponding URL to the renderer. The problem I see is that the memory space is limited in the Vera and I will have to manage the files removing.

First I will create a m3u file in the Vera with URLs provided by a Media Server and check if it works when I provide this URL to a renderer.

XBMC server shows all m3u file as a container so this solution will in principle handle them correctly.

Quote
Because in our daily lives, loading each song one by one will be pretty annoying. isn't it?

this is why i wrote ... 6 months :P

 :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 31, 2013, 07:44:17 am
Nop, Bubble upnp server can be installed anywhere on your LAN.

It will scan the network to seek renderer, and then you can add OpenHome feature over each one in the web config GUI.
After added that, you will see two renderer for each with the same name except an "(openhome)" addition to one.
If I understood right, It is the goal of bubble upnp server, add openhome feature to a not compatible renderer.
You can load a playlist to it, and it convert it to basic upnp command (pretty in the same way than I wrote before with the playlist part of your plugin)

I think this is the easiest way to implement playlist feature, but it will require a third party software.

So it could work even with an OpenELEC running on a raspi or even with your Sony BR. Interesting.
Playlist creation and selection has to be controled by the control point itself, including storage ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 31, 2013, 07:48:55 am
I doesn't know that renderers can received a playlist of playable items. yes, that will be cool in that way ! we will see if it work in most of devices.

Quote
The problem I see is that the memory space is limited in the Vera and I will have to manage the files removing.

Those files will contain only a URL list right ? so the files might not be so big, but your right, we need a way to manage the files removing.

Quote
So it could work even with an OpenELEC running on a raspi or even with your Sony BR. Interesting.
Playlist creation and selection has to be controled by the control point itself, including storage ?

Yes, in theory, it can be attached to any renderers to add those features.
and Yes, as far as I know, the playlist creations as to be managed by the control point, you can send only a playlist to it, it doesn't store anything except the running playlist in memory.

For what I read, I think the purpose of OpenHome is to add to UPNP/DLNA the lack of playlist feature, so I'm surprised that you say it can be handle with a m3u file in upnp standard.

Bubble upnp client on android implement openhome feature, I've done only some very speed test, I'll investigate further on my side.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 31, 2013, 08:40:30 am
I doesn't know that renderers can received a playlist of playable items. yes, that will be cool in that way ! we will see if it work in most of devices.

I just tested and it works with XBMC as renderer.
Unfortunately, it does not work with BubbleUPnP for example.

Quote
Quote
The problem I see is that the memory space is limited in the Vera and I will have to manage the files removing.

Those files will contain only a URL list right ? so the files might not be so big, but your right, we need a way to manage the files removing.

After thinking a little more, only one file per renderer is required. So that should not be a problem.

Quote
For what I read, I think the purpose of OpenHome is to add to UPNP/DLNA the lack of playlist feature, so I'm surprised that you say it can be handle with a m3u file in upnp standard.

But it requires that the server supports this feature and that the renderer supports the playlist format used by the server.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on December 31, 2013, 08:54:50 am
Quote
But it requires that the server supports this feature and that the renderer supports the playlist format used by the server.

If I understood right, in fact, no. That is the goal of upnp server openhome part.
we will take my Gmrender in exemple. I create a virtual renderer with openhome feature over my gmrender in the Bubble server GUI.
So now, when I launch device spy, I see two renderers avaiable : Gmrender, and Gmrender(OpenHome)

Each one have a unique UUID, and the description URL of Gmrender(OpenHome) point to my server IP (with BBupnp server inside) rather than the real IP of my Gmrender.

When I load, through Bubbleupnp Client (on a tablet), a playlist in openhome format to Gmrender(OpenHome) the server get the playlist, and do the work :
It load the first song from the DMS to the DMR and play it all with the standard upnp.
It Look at the notification of the DMR to seek the end of the track.
Load the second track on the DMR, etc.
If you hit next song, the server just load the next track on is playlist, but the DMR is never aware of a playlist system.

So both of DMR and DMS are just to be upnp compliant, and bubble upnp server handle the Playlist feature and translate it to direct orders.

I hope I was clear enough :)

It is the same concept as I tell you when I talked about the possibly evolution of the DMR tab of your plugin.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 31, 2013, 09:10:19 am
Regarding BubbleUPnP renderer, I see the protocol audio/x-scpls, meaning it is probably compatible with PLS playlists. To be checked.
I could create a format of playlist accepted by the renderer.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 31, 2013, 09:20:56 am
Quote
But it requires that the server supports this feature and that the renderer supports the playlist format used by the server.

If I understood right, in fact, no. That is the goal of upnp server openhome part.
we will take my Gmrender in exemple. I create a virtual renderer with openhome feature over my gmrender in the Bubble server GUI.
So now, when I launch device spy, I see two renderers avaiable : Gmrender, and Gmrender(OpenHome)

Each one have a unique UUID, and the description URL of Gmrender(OpenHome) point to my server IP (with BBupnp server inside) rather than the real IP of my Gmrender.

When I load, through Bubbleupnp Client (on a tablet), a playlist in openhome format to Gmrender(OpenHome) the server get the playlist, and do the work :
It load the first song from the DMS to the DMR and play it all with the standard upnp.
It Look at the notification of the DMR to seek the end of the track.
Load the second track on the DMR, etc.
If you hit next song, the server just load the next track on is playlist, but the DMR is never aware of a playlist system.

Ok, I understand.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: haavard on January 08, 2014, 06:52:34 am
Just a basic question.
Can this plugin be used to control mye boxee box or  ADB Satelite receiver?

regards
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on January 09, 2014, 06:57:34 am
Just a basic question.
Can this plugin be used to control mye boxee box or  ADB Satelite receiver?

regards

I took a quick look to the boxee box on the net. It looks like it supports UPnP. But maybe it would be only a Digital Media Player, like the PS3 for example, in which case you will not be able to drive it through the plugin. But maybe I am wrong.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on January 09, 2014, 06:59:48 am
Foobar2000 seems to be another interesting candidate to test with the plugin.
http://www.foobar2000.org/components/view/foo_upnp
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on January 11, 2014, 09:05:13 am
I have now added a feedback message in the Player UI to inform when the playback of a server media is rejected by the plugin.

I am not so far from a new version 0.4.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on January 12, 2014, 12:48:41 pm
Plugin version 0.4 has been released.
You can download it here (ZIP archive at the bottom of this page): http://code.mios.com/trac/mios_dlna-cntroller/browser/tags/0.4#


What's new in version 0.4:
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on January 13, 2014, 04:55:19 am
Hi Lolodomo, happy new year ;)

Great news, I'll test it ASAP !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: alteum on January 18, 2014, 12:03:36 pm
Hi

Just tested on Linn Majik DS player

Works !

Would be nice to have the possibility to change from playlist to radio
Also to put if off (Power off/Standby)

Merci c'est super !!!!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on January 22, 2014, 09:53:42 pm
tried the latest version 0.4 on UI6 1.6.641 overwriting the former version (second one) but it doesn't seem to react anymore. i think they redone the networkstuff in UI6. anyone tried ?
old UI5 look interface is now on http://vera-ip/cmh_ui6/ (http://vera-ip/cmh_ui6/)
Code: [Select]
06 01/23/14 4:06:25.268 Device_Variable::m_szValue_set device: 118 service: urn:dlna-org:serviceId:DLNAMediaController1 variable: DMRDiscoveryResult was: scanning now: <devices></devices> #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2ae79000>
10 01/23/14 4:06:25.269 UserData::m_iDataVersion_Variables_incr DMRDiscoveryResult user data 445767001 variables 445767777 <0x2ae79000>
10 01/23/14 4:06:25.269 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 445767001 variables 445767777 <0x2ae79000>
01 01/23/14 4:06:25.269 LuaInterface::CallFunction_Job device 118 function SDLNAMediaController1_DLNAMediaController1_StartDMRDiscovery_job took 5 seconds <0x2ae79000>
25 01/23/14 4:06:25.270 LuaInterface::CallFunction_Job device 118 function SDLNAMediaController1_DLNAMediaController1_StartDMRDiscovery_job didn't return a value <0x2ae79000>
10 01/23/14 4:06:25.270 UserData::m_iDataVersion_Variables_incr jobst user data 445767001 variables 445767778 <0x2ae79000>
10 01/23/14 4:06:25.271 Job::m_eJobStatus job job#46 : dev:118 (0xde82b0) P:50 S:4 dataversion 445767778 <0xde82b0> m_eJobStatus Successful after 5.22780000 seconds callback:0 <0x2ae79000>
04 01/23/14 4:06:25.272 <Job ID="46" Name="" Device="118" Created="2014-01-23 4:06:20" Started="2014-01-23 4:06:20" Completed="2014-01-23 4:06:25" Duration="5.22780000" Runtime="5.19923000" Status="Successful" LastNote=""/> <0x2ae79000>
10 01/23/14 4:06:25.272 JobHandler::Run finished single job job#46 : dev:118 (0xde82b0) P:50 S:0 <0xde82b0> <0x2ae79000>
10 01/23/14 4:06:25.273 JobHandler::PurgeCompletedJobs force 0 purge job size: 1 blocking 0 delete 0 <0x2ae79000>
10 01/23/14 4:06:25.273 JobHandler::PurgeCompletedJobs purge job#46 : dev:118 (0xde82b0) P:50 S:4  status 4 autodelete 1 <0x2ae79000>
10 01/23/14 4:06:25.274 ThreadedClass::m_bQuit_set now 1 for 0xde82b0 ThreadedClass::StopThread ptr 0xde82b0 thread (nil) <
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on February 06, 2014, 07:03:35 am
Hi

Just tested on Linn Majik DS player

Works !

I simply missed your messages !

You controlled the Linn Majik DS player as a renderer or as a server ?

Quote
Would be nice to have the possibility to change from playlist to radio
Also to put if off (Power off/Standby)

Power off and Standby is not a feature provided by DLNA.

Quote
Merci c'est super !!!!

Encore un fran?ais :) Tu peux nous retrouver sur le forum toute la domotique. On pourra ?changer en fran?ais et il y a plus d'int?ret pour mon plugin l?-bas...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on February 06, 2014, 01:04:28 pm
sans compter la segregation des accents sur ce forum :)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on February 23, 2014, 04:17:21 am
Hi Lolodomo !

I'm trying to use your great DLNA plugin working with Openremote but I have a little problem with status feedback. Let me explain :
The first goal of this test is to manage Volume in openremote of my Linux Media Renderer through your Vera DLNA Plugin.
In OR, to set Volume, here is my http web command to Vera :
http://Vera_IP:3480/data_request?id=lu_action&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&DeviceNum=41&InstanceID=0&Channel=Master&DesiredVolume=60 (where 60 is {param} in OR but not important here)
And It work perfectly, But I have no Feedback of the command ( If I changed Volume from your UI, it doesn't change status in OR)
The Openremote / Vera Status feedback work very well with Light Status/Level, or with a Variable Container that memorize my Audio/Video devices status.
Openremote use Polling Status to Vera with the Long Polling Method, as soon as the Vera have a Status update, it will throw it to Openremote.

Hi @macfly92.

After reading an exchange of messages in another place of the forum, I think that OpenRemote requires the definition of shortcodes in the service files.
Can you explain what data you will expect ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on February 24, 2014, 07:38:14 am
Hi Lolodomo !

I'm trying to use your great DLNA plugin working with Openremote but I have a little problem with status feedback. Let me explain :
The first goal of this test is to manage Volume in openremote of my Linux Media Renderer through your Vera DLNA Plugin.
In OR, to set Volume, here is my http web command to Vera :
http://Vera_IP:3480/data_request?id=lu_action&serviceId=urn:upnp-org:serviceId:RenderingControl&action=SetVolume&DeviceNum=41&InstanceID=0&Channel=Master&DesiredVolume=60 (where 60 is {param} in OR but not important here)
And It work perfectly, But I have no Feedback of the command ( If I changed Volume from your UI, it doesn't change status in OR)
The Openremote / Vera Status feedback work very well with Light Status/Level, or with a Variable Container that memorize my Audio/Video devices status.
Openremote use Polling Status to Vera with the Long Polling Method, as soon as the Vera have a Status update, it will throw it to Openremote.

Hi @macfly92.

After reading an exchange of messages in another place of the forum, I think that OpenRemote requires the definition of shortcodes in the service files.
Can you explain what data you will expect ?

Hi my friend,

Thanks to take care of this problem, but after several tests, status of the upnp plugin works correctly.

I have now, for exemple, the Volume status of the upnp device on a slider in Openremote, and the status updates perfectly. Or What is actually playing on a device.

But I'm not sure what I changed exactly to make it working ... Maybe I needed a Vera or Openremote restart to clean the status table.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on March 02, 2014, 09:26:09 am
Just a little correction, it seem that Only some services states are correctly showed.

For exemple, the status list of urn:upnp-org:serviceId:AVTransport and urn:upnp-org:serviceId:RenderingControl can be catched by openremote but not the urn:dlna-org:serviceId:DLNAMediaController1 services.

I can get the Volume state of urn:upnp-org:serviceId:RenderingControl service, but now I try to get the Online status of urn:dlna-org:serviceId:DLNAMediaController1 and I can't.

Doesn't know if it makes sense ...

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on March 05, 2014, 05:51:59 pm
Just a little correction, it seem that Only some services states are correctly showed.

For exemple, the status list of urn:upnp-org:serviceId:AVTransport and urn:upnp-org:serviceId:RenderingControl can be catched by openremote but not the urn:dlna-org:serviceId:DLNAMediaController1 services.

I can get the Volume state of urn:upnp-org:serviceId:RenderingControl service, but now I try to get the Online status of urn:dlna-org:serviceId:DLNAMediaController1 and I can't.

Doesn't know if it makes sense ...

Yes, it makes sense. Volume has a short code, status too, while no short code defined for the online state variable.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on March 11, 2014, 01:05:51 pm
Just a little correction, it seem that Only some services states are correctly showed.

For exemple, the status list of urn:upnp-org:serviceId:AVTransport and urn:upnp-org:serviceId:RenderingControl can be catched by openremote but not the urn:dlna-org:serviceId:DLNAMediaController1 services.

I can get the Volume state of urn:upnp-org:serviceId:RenderingControl service, but now I try to get the Online status of urn:dlna-org:serviceId:DLNAMediaController1 and I can't.

Doesn't know if it makes sense ...

So do you think it is possible to add them to your plugin ?

Yes, it makes sense. Volume has a short code, status too, while no short code defined for the online state variable.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on March 11, 2014, 03:33:35 pm
There may be another reason. online variable is not defined as a state variable in the service file.
There are few variables like this one that I set while they are not delcared in the service file. I am not sure if it is a proper way to do it.
What happens for example with the variable CurrentPlayMode or TransportStatus (AVTransport) that are declared in the service file without a shortcode ?

Edit: I just tried a "sdata" command and it looks clear that only state variables with a shortcode are retrieved.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on March 15, 2014, 06:42:26 am
I would use the "Online" status just because I want to check the status of my device and it the state that make more sense but maybe I can use a trick to check another variable that will be already defined.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on March 15, 2014, 08:43:03 am
I would use the "Online" status just because I want to check the status of my device and it the state that make more sense but maybe I can use a trick to check another variable that will be already defined.

I will make change soon.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: macfly92 on March 15, 2014, 09:04:38 am
Glad to read it !

Take your time I'm pretty busy on my side. But a good motivation  to test last updates. thanks
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: tommysharp on March 16, 2014, 05:16:26 am
Would this plugin be able to send audio and notifications to the Rocki device? http://www.myrocki.com/

Mine just arrived but my Vera Lite has not yet arrived. The Rocki seems to support a lot of protocols including things like Airplay....

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 01, 2014, 05:34:37 am
@macfly92: I have now added few shortcodes, including a shortcode for the state variable "Online".
You can try my development version: http://code.mios.com/trac/mios_dlna-cntroller/browser/trunk
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on May 02, 2014, 09:28:55 am
i tried plugin in UI7.. it seems to work but the UI part is showing nothing. care to look at this ? somehow there should be a possibility to open a new browser window or popup to have an UI for the plugin.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 04, 2014, 01:17:47 pm
i tried plugin in UI7.. it seems to work but the UI part is showing nothing. care to look at this ? somehow there should be a possibility to open a new browser window or popup to have an UI for the plugin.

All my plugins with JavaScript are no more working since UI6.

As I am still running only UI5, I can do anything for the moment.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Da_JoJo on May 04, 2014, 01:27:40 pm
oh thats ok .. u did a tremendous amount of work allready and i don't want to rush u. i heard new UI6/7 uses jquery and have some options for a custom interface, haven't looked into it as i have way to much privatelife stuff to do :-(
i hope you continu ur work for the new UI7 when it finally gets to a final build.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: empenoso on May 13, 2014, 01:24:53 am
Hi!
How can you call the voice of the text in the code?
For example, to 7 am was said "Good morning" :)

Code: [Select]
local TransportState = luup.variable_get("urn:upnp-org:serviceId:AVTransport", "TransportState", 56) or "0"
luup.variable_set("urn:dlna-org:serviceId:DLNAMediaController1", "DefaultLanguageTTS", "en", 56)
luup.variable_set("urn:upnp-org:serviceId:RenderingControl", "Volume", "80", 56)

--How to send text to the plugin using the code?

luup.variable_set("urn:upnp-org:serviceId:RenderingControl", "Volume", "20", 56)

 ???

Thanks for your answer!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 16, 2014, 07:14:00 am
You have to call the action "Say" using luup.call_action.
That should be something like that:
Code: [Select]
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "Say", {Text="Good morning", Language="en", Engine="GOOGLE", Volume=50}, 56)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: martinf79 on May 18, 2014, 11:45:44 pm
Hi All ...

Super Newbie here.... just need a hand w/ the Sonos plugin wiki via my VeraLite.  I'm stuck on the step below.  It states that "Automatic discovery (UPnP discovery) could require an additional setup of your Vera Lite".  The link directs me to this thread, but I have ABSOLUTELY no idea what I'm supposed to do (as I currently am unable to select the IP address of my Sonos player in the step below, nor am I able to save it.  Can someone PLEASE PLEASE PLEASE help.  Many thanks.

Select your Sonos?
This step will allow to link a Vera device to a physical Sonos unit. It is required for the device automatically created when installing the plugin from the Marketplace or for the additional devices you created without specifying a IP address. Note it can be used to assign the Vera device to a different Sonos. It can be useful in case your Sonos has been assigned a new IP address. Please note that you must avoid having several Vera devices linked to the same physical Sonos (same IP).

Find your new device in the UI,
Click on its wrench button,
Open the Settings tab,
Push the Discover button and wait for few seconds until the selection box is filled and the Select button is enabled again,
Select your Sonos in the selection box and then push the Select button,
If the automatic discovery is not working (the selection box remains empty), you can enter the IP address of your Sonos zone in the field New IPand then push the Select button,
Wait for few seconds for a complete initialiazation
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Brientim on May 19, 2014, 12:24:59 am
Instal UPnP proxy server from the App Store.
 http://apps.mios.com/plugin.php?id=3716
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: martinf79 on May 19, 2014, 08:49:53 am
Instal UPnP proxy server from the App Store.
 http://apps.mios.com/plugin.php?id=3716

Thanks... I did that already... still have the issue.... Thoughts?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 19, 2014, 11:43:52 am
UPnP auto discovery is not dependent on UPnP event proxy.
I answered to the question in the Sonos section.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: blingal on May 22, 2014, 05:37:53 pm
Hi all,

I have installed the Upnp event proxy, as well as the DLNA media controller plugin, the discovery in the media controller just doesnt do anything, cant even add the URL manually, it feels like its completely dead.

I have also done workaround: iptables -t nat -I POSTROUTING -d 224.0.0.0/4 -j SNAT --to-source 192.168.1.32

Still to no avail.... what needs to happen so I can control DLNA renderers from the Vera lite?

Any tips and tricks are highly appreciated
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 23, 2014, 02:13:11 pm
Are you running UI5 ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: blingal on May 23, 2014, 03:53:15 pm
Are you running UI5 ?

Im running FW 1.6.641..... I guess that makes it UI6? Its a Vera Lite
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 23, 2014, 04:48:02 pm
The plugin UI is not compatible with UI6, only UI5.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: blingal on May 23, 2014, 07:07:34 pm
i was afraid you were going to say that.... :( are there any plans to make it compatible?

I dont seem to get my hands on an older FW to downgrade
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on May 24, 2014, 04:36:53 am
i was afraid you were going to say that.... :( are there any plans to make it compatible?

Plans exist but don't expect something in a short delay.
If Micasaverde finally releases UI7 and UI7 > UI5, I will certainly switch to UI7 and at this time migrating my plugins will become my higher priority.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: naveen on June 05, 2014, 05:18:35 pm
Is it possible to downgrade to UI5 while keeping settings? Is there any benefit to UI6??

Thanks!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: empenoso on June 07, 2014, 06:23:21 am
Hi!
Great plugin!
How to use the code to change the current volume level?
I write:
Code: [Select]
luup.variable_set("urn:upnp-org:serviceId:RenderingControl", "Volume", "30", 56)
luup.variable_set("urn:dlna-org:serviceId:DLNAMediaController1", "Volume", "30", 56)

But actually it does not change the volume level.
What should be added to the volume changed  ???

Thanks for your plugin and help!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 07, 2014, 06:32:53 am
Hi!
Great plugin!
How to use the code to change the current volume level?
I write:
Code: [Select]
luup.variable_set("urn:upnp-org:serviceId:RenderingControl", "Volume", "30", 56)
luup.variable_set("urn:dlna-org:serviceId:DLNAMediaController1", "Volume", "30", 56)

But actually it does not change the volume level.
What should be added to the volume changed  ???

Thanks for your plugin and help!

You have to call the action SetVolume.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: empenoso on June 07, 2014, 10:23:48 am
Excellent work, lolodomo!  :)
Volume changes its value through the code:
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", "8", 56)
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "SetVolume", "8", 56)

Something like that has a better chance to work:
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume=8}, 56)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: mda on June 08, 2014, 05:23:46 pm
@lolodomo - what is the proper way to play an mp3 file followed by a TTS? (for example, to have an alert chime mp3 followed by a tts announcement -- like you would hear in an airport where the chime e gets your attention, followed by the important announcement).

When i try putting the play call followed by the say call, the mp3 is not played (I assume the say call starts a moment after the mp3 play is started so it cuts off the mp3), and since the mp3 is 8 seconds long i risk causing vera to restart luup if i use a luup.sleep

Thanks.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 13, 2014, 01:39:28 am
First call Alert for your MP3 file setting a duration.
Then call Say.
Your TTS message will be queued and will start after the delay defined in your first call expires.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: mda on June 15, 2014, 04:46:59 pm
First call Alert for your MP3 file setting a duration.
Then call Say.
Your TTS message will be queued and will start after the delay defined in your first call expires.

thanks, using Play with Duration= parameter for the alert works perfectly.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: flaquito on June 16, 2014, 05:27:18 pm
I never was able to get my Sony Blu-Ray player (BDP-S590) to work properly with the DLNA plugin in the past. Since you released 1.0, I decided to give it another shot. When I try to discover it as a renderer, it can't find it. So if I add the description URL manually (http://ipaddr:52323/dmr.xml), it finds it, detects it as a "Blu-ray Disc Player", detects the event proxy in use, and shows it as Off. If I check the status, it briefly changes to On, and then back to Off after about a second. Any ideas? Any other information I can provide to help diagnose?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: empenoso on June 17, 2014, 04:37:27 am
Excellent work, lolodomo!  :)
Volume changes its value through the code:
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", "8", 56)
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "SetVolume", "8", 56)

Something like that has a better chance to work:
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume=8}, 56)

Thanks for your answer, lolodomo!
Code makes the value of the volume is always 30 points, and does not change to that number 2 or 60.
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume = "2"}, 56) --XBMC OpenELEC
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume="60"}, 58) -- LG TV
What could be wrong?
Quotes "" do not change the situation.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 20, 2014, 06:03:23 am
I never was able to get my Sony Blu-Ray player (BDP-S590) to work properly with the DLNA plugin in the past. Since you released 1.0, I decided to give it another shot. When I try to discover it as a renderer, it can't find it. So if I add the description URL manually (http://ipaddr:52323/dmr.xml), it finds it, detects it as a "Blu-ray Disc Player", detects the event proxy in use, and shows it as Off. If I check the status, it briefly changes to On, and then back to Off after about a second. Any ideas? Any other information I can provide to help diagnose?

It could be a problem in parsing XML files.
Do you find errors in logs ?
Could you provide the main description file (http://ipaddr:52323/dmr.xml) + the AVTransport and RenderingControl description files (you can find the URLs in the previous file) ? Then I could check if my XML parsing is ok or not.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 20, 2014, 06:05:37 am
Thanks for your answer, lolodomo!
Code makes the value of the volume is always 30 points, and does not change to that number 2 or 60.
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume = "2"}, 56) --XBMC OpenELEC
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume="60"}, 58) -- LG TV
What could be wrong?
Quotes "" do not change the situation.

No idea.
Do you have errors in logs (enable temporally the debug logs first) ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Neos1234 on June 23, 2014, 06:11:31 am
Hello is it possible to make automatic play the last movie downloaded from the server DLNA?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: flaquito on June 27, 2014, 11:43:04 pm
I never was able to get my Sony Blu-Ray player (BDP-S590) to work properly with the DLNA plugin in the past. Since you released 1.0, I decided to give it another shot. When I try to discover it as a renderer, it can't find it. So if I add the description URL manually (http://ipaddr:52323/dmr.xml), it finds it, detects it as a "Blu-ray Disc Player", detects the event proxy in use, and shows it as Off. If I check the status, it briefly changes to On, and then back to Off after about a second. Any ideas? Any other information I can provide to help diagnose?

It could be a problem in parsing XML files.
Do you find errors in logs ?
Could you provide the main description file (http://ipaddr:52323/dmr.xml) + the AVTransport and RenderingControl description files (you can find the URLs in the previous file) ? Then I could check if my XML parsing is ok or not.

It put massive blocks of stuff in the logs, but I hadn't been able to find any errors until just now when I went to copy the log output of doing a state check. Log shows:
Code: [Select]
02      06/27/14 23:34:15.131   luup_log:7: DLNA: warning: Call to NotifyAVTransportChange with bad SID uuid:12bf4300-fe75-11e3-8000-3c07711ae1c3 __LEAK__ this:4096 start:1257472 to 0xf42000 <0x2b840000>
04      06/27/14 23:34:15.133   <Job ID="47" Name="" Device="7" Created="2014-06-27 23:34:14" Started="2014-06-27 23:34:14" Completed="2014-06-27 23:34:15" Duration="0.217061000" Runtime="0.216395000" Status="Successful" LastNote=""/> <0x2b840000>
02      06/27/14 23:34:15.134   luup_log:7: DLNA: warning: Call to NotifyRenderingChange with bad SID uuid:12c49a30-fe75-11e3-8000-3c07711ae1c3 <0x2b840000>
There's a lot more in the logs, so I'm attaching the log output of a single "check state" click, as well as the xml files you requested.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 28, 2014, 04:31:04 am
Hello is it possible to make automatic play the last movie downloaded from the server DLNA?

What do you mean exactly by "last downloaded" ? Do you mean last media added in the server ? In this case, no, it is not possible, it is not a DLNA feature.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 28, 2014, 04:55:07 am
It put massive blocks of stuff in the logs, but I hadn't been able to find any errors until just now when I went to copy the log output of doing a state check. Log shows:

Unfortunately, you have not enabled debug logs in the plugin. I just see that the "Online" variable is suddenly reset to 0 but without the debug logs I cannot have any idea what could be the reason.
I have not looked at your XML files but they are probably correct as I can see in your logs that few variables are first set ... before the problem occurs causing everything being reset.
The warning you mention is in fact a good thing, it confirms that the plugin was able to register to your renderer. It can happen after you reload your Vera. It is not a problem.

So what I need is that you enable ddebug logs for the plugin, that is you open the advanced tab, you set the variable DebugLogs to 1, and finally you push the red button "Save" at top right in the browser, causing a lua reload.
Then provide the logs from youur reload start point until the last line looking like:
Code: [Select]
06      06/27/14 23:36:05.408   Device_Variable::m_szValue_set device: 7 service: urn:dlna-org:serviceId:DLNAMediaController1 variable: Online was: 1 now: 0 #hooks: 0 upnp: 0 v:0xaf5db0/NONE duplicate:0 <0x2e98d680>Just before this line, you will have another log line helping me to understand. It could be:
Code: [Select]
commsFailure: Device offline? status=xxxor
Code: [Select]
Switching to a new DMR: setting variable Online to 0or
Code: [Select]
upnp.setup failed: going offline
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 28, 2014, 05:05:24 am
@flaquito: even with your incomplete logs, I can suppose that the problem occurs at the end of the init stage when I force a full refresh of data. Few UPnP calls are run at this stage to interrogate your renderer. Calls to the AVTransport service are apparently running well as state variables are set, and I suppose that the first call to the RenderingControl service fails.
If my hypothesis is good, you should have a line like this in the logs:
Code: [Select]
commsFailure: Device offline? status=xxxSo I will now take a look to your RenderingControl service file...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 28, 2014, 05:31:00 am
So I will now take a look to your RenderingControl service file...

Ok I understand where is your problem. Your player does not handle volume through DLNA.
After enabling the debug logs, you should see this line:
Code: [Select]
commsFailure: Device offline? status=action not available
Nevertheless, your player is DLNA compliant because these actions/states are optional in the standard.
I had just not anticipated this use case in the plugin.

I just fixed the issue. Please upload in the Vera the updated file I_DLNAMediaController1.xml  from the ZIP file at the bottom of this page: http://code.mios.com/trac/mios_dlna-cntroller/browser/trunk#
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: flaquito on June 28, 2014, 01:20:49 pm
So I will now take a look to your RenderingControl service file...

Ok I understand where is your problem. Your player does not handle volume through DLNA.
After enabling the debug logs, you should see this line:
Code: [Select]
commsFailure: Device offline? status=action not available
Nevertheless, your player is DLNA compliant because these actions/states are optional in the standard.
I had just not anticipated this use case in the plugin.

I just fixed the issue. Please upload in the Vera the updated file I_DLNAMediaController1.xml  from the ZIP file at the bottom of this page: http://code.mios.com/trac/mios_dlna-cntroller/browser/trunk#

Thanks! That was quick. It's working much better now. The plugin is detecting the player's status properly, getting real-time updates on play/pause/stop status, and has some control over the player. One issue that I'm still having is that pausing from Vera doesn't work, but stopping does. But I remember having that same issue with DeviceSpy, so I suspect it's the player not honoring the request. Do you still need debug logs from me? Thanks again for all the work that you've done on this.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 28, 2014, 02:01:28 pm
Thanks! That was quick. It's working much better now. The plugin is detecting the player's status properly, getting real-time updates on play/pause/stop status, and has some control over the player. One issue that I'm still having is that pausing from Vera doesn't work, but stopping does. But I remember having that same issue with DeviceSpy, so I suspect it's the player not honoring the request. Do you still need debug logs from me? Thanks again for all the work that you've done on this.

I just checked your AVTransport service file and Pause action is present. I did the check because Pause is optional in the DLNA standard.

If you noticed an error with Device Spy, that could be a bug in the BR player. What was the error message in Device Spy ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: flaquito on June 28, 2014, 02:20:39 pm
Thanks! That was quick. It's working much better now. The plugin is detecting the player's status properly, getting real-time updates on play/pause/stop status, and has some control over the player. One issue that I'm still having is that pausing from Vera doesn't work, but stopping does. But I remember having that same issue with DeviceSpy, so I suspect it's the player not honoring the request. Do you still need debug logs from me? Thanks again for all the work that you've done on this.

I just checked your AVTransport service file and Pause action is present. I did the check because Pause is optional in the DLNA standard.

If you noticed an error with Device Spy, that could be a bug in the BR player. What was the error message in Device Spy ?

"Invocation Error Code 705: Action Pause failed"

I suspect that it's just limitations of the UPNP implementation on the player.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on June 29, 2014, 05:35:57 am
"Invocation Error Code 705: Action Pause failed"

I suspect that it's just limitations of the UPNP implementation on the player.

705 in normally for "Transport is locked".

Quote
The transport is ?hold locked?. (Some portable mobile devices
have a small mechanical toggle switch called a ?hold lock
switch?. While this switch is ON, i.e., the transport is hold
locked, the device is guarded against operations such as
accidental power on when not in use, or interruption of play or
record from accidental pressing of a front panel button or a GUI
button.)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: empenoso on July 02, 2014, 07:28:04 am
Thanks for your answer, lolodomo!
Code makes the value of the volume is always 30 points, and does not change to that number 2 or 60.
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume = "2"}, 56) --XBMC OpenELEC
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume="60"}, 58) -- LG TV
What could be wrong?
Quotes "" do not change the situation.

No idea.
Do you have errors in logs (enable temporally the debug logs first) ?

Run scene, which sets the sound to "1". Sets the value of "30". How can I change it? How to change the "Master"?
Thank you, lolodomo!

Scene 56:
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {Volume = 1}, 56)
Log file:
Code: [Select]
08      07/02/14 17:10:16.721   Scene::RunScene running 56 Будильник - понижение громкости с утра <0x2e5e7680>
08      07/02/14 17:10:16.722   JobHandler_LuaUPnP::HandleActionRequest device: 56 service: urn:upnp-org:serviceId:RenderingControl action: SetVolume <0x2e5e7680>
08      07/02/14 17:10:16.722   JobHandler_LuaUPnP::HandleActionRequest argument Volume=1 <0x2e5e7680>
08      07/02/14 17:10:16.810   JobHandler_LuaUPnP::HandleActionRequest device: 56 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyRenderingChange <0x2e9e7680>
08      07/02/14 17:10:16.810   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=56 <0x2e9e7680>
08      07/02/14 17:10:16.810   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2e9e7680>
08      07/02/14 17:10:16.811   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyRenderingChange <0x2e9e7680>
08      07/02/14 17:10:16.811   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/"><InstanceID val="0"><Volume Channel="Master" val="30"/><VolumeDB Channel="Master" val="4454"/></InstanceID></Event> <0x2e9e7680>
08      07/02/14 17:10:16.811   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:e3055a69-b95b-6c60-b599-2fb83de36834 <0x2e9e7680>
06      07/02/14 17:10:16.814   Device_Variable::m_szValue_set device: 56 service: urn:upnp-org:serviceId:RenderingControl variable: Volume was: 92 now: 30 #hooks: 0 upnp: 0 v:0x9fbb18/NONE duplicate:0 <0x2aeb3000>
06      07/02/14 17:10:16.815   Device_Variable::m_szValue_set device: 56 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1404299416 now: 1404299416 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2aeb3000>
04      07/02/14 17:10:16.816   <Job ID="4989" Name="" Device="56" Created="2014-07-02 17:10:16" Started="2014-07-02 17:10:16" Completed="2014-07-02 17:10:16" Duration="0.4234000" Runtime="0.2818000" Status="Successful" LastNote=""/> <0x2aeb3000>
08      07/02/14 17:10:17.054   JobHandler_LuaUPnP::HandleActionRequest device: 56 service: urn:dlna-org:serviceId:DLNAMediaController1 action: NotifyAVTransportChange <0x2ee2a680>
08      07/02/14 17:10:17.054   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=56 <0x2ee2a680>
08      07/02/14 17:10:17.054   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:dlna-org:serviceId:DLNAMediaController1 <0x2ee2a680>
08      07/02/14 17:10:17.055   JobHandler_LuaUPnP::HandleActionRequest argument action=NotifyAVTransportChange <0x2ee2a680>
08      07/02/14 17:10:17.055   JobHandler_LuaUPnP::HandleActionRequest argument LastChange=<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/"><InstanceID val="0"><CurrentTrackDuration val="00:21:44"/><CurrentMediaDuration val="00:21:44"/></InstanceID></Event> <0x2ee2a680>
08      07/02/14 17:10:17.055   JobHandler_LuaUPnP::HandleActionRequest argument sid=uuid:5adad173-c9a2-1c1f-86cc-9ae87f99fd04 <0x2ee2a680>
06      07/02/14 17:10:17.059   Device_Variable::m_szValue_set device: 56 service: urn:upnp-org:serviceId:AVTransport variable: CurrentTrackDuration was: 00:21:43 now: 00:21:44 #hooks: 0 upnp: 0 v:0x8d8278/NONE duplicate:0 <0x2aeb3000>
06      07/02/14 17:10:17.060   Device_Variable::m_szValue_set device: 56 service: urn:upnp-org:serviceId:AVTransport variable: CurrentMediaDuration was: 00:21:43 now: 00:21:44 #hooks: 0 upnp: 0 v:0x8b05c8/NONE duplicate:0 <0x2aeb3000>
06      07/02/14 17:10:17.078   Device_Variable::m_szValue_set device: 56 service: urn:upnp-org:serviceId:AVTransport variable: RelativeTimePosition was: 00:21:37 now: 00:21:38 #hooks: 0 upnp: 0 v:0x9a2a60/NONE duplicate:0 <0x2aeb3000>
06      07/02/14 17:10:17.079   Device_Variable::m_szValue_set device: 56 service: urn:micasaverde-com:serviceId:HaDevice1 variable: LastUpdate was: 1404299416 now: 1404299417 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2aeb3000>
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on July 02, 2014, 12:43:19 pm
The parameter name is not "Volume" but "DesiredVolume".
30 is the default value used when this parameter is not set.

Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RenderingControl", "SetVolume", {DesiredVolume="50"}, 56)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: derrij on July 10, 2014, 01:31:34 pm
please, help, how to add link to plugin and start playing it.
this code does not work.
PluginVersion 0.8

Based on the script I used to load Webradio, I try this code :

Code: [Select]
local descriptionURL =  luup.variable_get("urn:dlna-org:serviceId:DLNAMediaController1", "DescriptionURL", 44)
local lul_arguments = {}
lul_arguments["URL"] = descriptionURL
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "SelectDMRDevice", lul_arguments, 44)
local lul_arguments = {}
lul_arguments["DescriptionURL"] = "http://192.168.0.100:8895/deviceDescription/26f23a08-b29c-32cb-9e8e-478dc9a82680"
lul_arguments["ObjectID"] = "A_OF"
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "BrowseDMS", lul_arguments, 44)
local lul_arguments = {}
lul_arguments["ObjectID"] = "A_OF^FOL_$OI1000000040001408"
lul_arguments["Protocol"] = "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3"
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "PlayDMSMedia", lul_arguments, 44)

... Without the end of the protocol info, but it is not enough, the plugin skip the protocol matching ...

Yes, normal.

Note that in the next version, you will be able to do that thing with a unique call to PlayDMSMedia. I have added a DescriptionURL parameter for that.

But for the test I would like to do, it requires a temporary patch in the code. I will give you or even provide the file.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: derrij on July 15, 2014, 05:58:21 am
well, figured out it
Code: [Select]
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "Play", {URI="http://radio.sunradio.ru/childtales64?25", Protocol="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3", Volume=10, Duration=20 }, 20)
Code: [Select]
luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "Play", {URI="http://radio.sunradio.ru/childtales64?25", Protocol="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3", Volume=10 }, 20)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on August 02, 2014, 07:06:03 am
Message for macfly92 (and others): I discovered that your routing workaround to have UPnP discoveriy working in the Vera is now not more required. Maybe the problem was relative to our ADSL router. During this time, I have updated the firmware of my router. Are you using a Freebox Revolution as router ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: dmo17 on October 29, 2014, 11:29:37 pm
First of all, I am very new to this.  I did spend a lot of time reading but on the forum but it doesn't appear many people have an issue with TTS working. I have a Vera2 with UI5 with DLNA 1.2, I can't seem to get the TTS to work with my Yamaha RXV-675 receiver.  In fact I have noticed I can't get Google translate to work if I use google.com (although the url's I have been trying may be old), but if I go to translate.google.ca (I am located in Canada) then it appears to work.  Does google expect the user to use the appropriate regional google site for this type of service, and if so, is there a need to change this somewhere in the DLNAtts.lua file?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 30, 2014, 07:00:30 am
First of all, I am very new to this.  I did spend a lot of time reading but on the forum but it doesn't appear many people have an issue with TTS working. I have a Vera2 with UI5 with DLNA 1.2, I can't seem to get the TTS to work with my Yamaha RXV-675 receiver.  In fact I have noticed I can't get Google translate to work if I use google.com (although the url's I have been trying may be old), but if I go to translate.google.ca (I am located in Canada) then it appears to work.  Does google expect the user to use the appropriate regional google site for this type of service, and if so, is there a need to change this somewhere in the DLNAtts.lua file?

I would be surprised that is the reason of your problem, but I explained how to change the Google URL for the Sonos plugin. You can try exactly the same change in the DLNA plugin. File name is L_DLNATTS.lua at line 54.
http://forum.micasaverde.com/index.php/topic,27542.msg198076.html#msg198076
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: dmo17 on October 30, 2014, 09:57:29 am
Hi lolodomo,

you are right, I don't think that is the issue, as I was able to use the address from line 54 in my browser with an appropriate string and language set and it worked fine.  What I see from my media renderer (Yamaha RVX675) is it switches the output to the server and shows Google TTS on the screen, but then the message "Access Error" comes up at the buttom,  It then proceeds to show Mute Off and then resume what it was doing.  Any idea why I would get the access error?

When I use the DLNA DNC player to select MP3's it has no problem playing them, so I am trying to understand the differentiation between what the Google call does vs what the standard MP3 from some server is.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on October 31, 2014, 01:25:45 am
http://forum.micasaverde.com/index.php/topic,24890.msg182362.html#msg182362
The general things to check.


It may be the low bitrate used by Google too ?
You could try to save the MP3 file in your server and then try to play it through the server. If it work that way, we could investigate more.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: dmo17 on October 31, 2014, 08:29:11 pm
Hi lolodomo,

Thanks so much for sending this link.  It turned out to be #4.  My Vera was secured on the local network.  After turning off the security for that, and a hard reset, TTS now works properly.  Thanks again for the support.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 01, 2014, 05:36:09 am
That is the most frequent error. I should add something in the wiki.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on November 05, 2014, 08:00:39 am
That is the most frequent error. I should add something in the wiki.

Volumio is using upmpdcli to expose the player as a UPnP renderer and is also compatible with OpenHome Media.
Making the DLNA media controller plugin compatible with OpenHome Media could be the way to go, in particular for playlist management.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: hellovn on November 23, 2014, 02:45:36 pm
Hi Lolodomo,

I could play a mp3 file from my vera to my samsung notes using BubbleUpNP. However, When trying to play text to speech, the samsung receives the message (the volume is changed) but there is no sound. Here is my vera log:

] <0x30d71680>
50   11/23/14 15:41:26.578   luup_log:83: DLNA: debug: UPnP_request: status=1 statusMsg=200 result=[100:00:00http://192.168.0.3:80/Say.83.mp3<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/"><item id="VERA_TTS" parentID="-1" restricted="1"><dc:title>Google TTS</dc:title><res protocolInfo="http-get:*:audio/mpeg:*">http://192.168.0.3:80/Say.83.mp3</res><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite>NOT_IMPLEMENTEDNOT_IMPLEMENTEDNETWORKNOT_IMPLEMENTEDNOT_IMPLEMENTED] <0x30d71680>
50   11/23/14 15:41:26.582   luup_log:83: DLNA: debug: GetPositionInfo('http://192.168.0.26:58645/dev/5f0d28a1-5971-84d8-ffff-ffffa4cf3814/svc/upnp-org/AVTransport/action', 'urn:schemas-upnp-org:service:AVTransport:1') Called with parameter count=1 <0x30d71680>
50   11/23/14 15:41:26.583   luup_log:83: DLNA: debug: UPnP_request: url=[http://192.168.0.26:58645/dev/5f0d28a1-5971-84d8-ffff-ffffa4cf3814/svc/upnp-org/AVTransport/action], body=[


0

] <0x30d71680>
50   11/23/14 15:41:26.700   luup_log:83: DLNA: debug: UPnP_request: status=1 statusMsg=200 result=[100:00:00<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/"><item id="VERA_TTS" parentID="-1" restricted="1"><dc:title>Google TTS</dc:title><res protocolInfo="http-get:*:audio/mpeg:*">http://192.168.0.3:80/Say.83.mp3</res><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite>http://192.168.0.3:80/Say.83.mp300:00:0000:00:0021474836472147483647] <0x30d71680>
50   11/23/14 15:41:26.722   luup_log:83: DLNA: debug: GetMute('http://192.168.0.26:58645/dev/5f0d28a1-5971-84d8-ffff-ffffa4cf3814/svc/upnp-org/RenderingControl/action', 'urn:schemas-upnp-org:service:RenderingControl:1') Called with parameter count=1 <0x30d71680>
50   11/23/14 15:41:26.723   luup_log:83: DLNA: debug: UPnP_request: url=[http://192.168.0.26:58645/dev/5f0d28a1-5971-84d8-ffff-ffffa4cf3814/svc/upnp-org/RenderingControl/action], body=[


0Master

] <0x30d71680>
50   11/23/14 15:41:26.940   luup_log:83: DLNA: debug: UPnP_request: status=1 statusMsg=200 result=[0] <0x30d71680>
50   11/23/14 15:41:26.941   luup_log:83: DLNA: debug: GetVolume('http://192.168.0.26:58645/dev/5f0d28a1-5971-84d8-ffff-ffffa4cf3814/svc/upnp-org/RenderingControl/action', 'urn:schemas-upnp-org:service:RenderingControl:1') Called with parameter count=1 <0x30d71680>
50   11/23/14 15:41:26.942   luup_log:83: DLNA: debug: UPnP_request: url=[http://192.168.0.26:58645/dev/5f0d28a1-5971-84d8-ffff-ffffa4cf3814/svc/upnp-org/RenderingControl/action], body=[

Please advise :)

Thanks,
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: hellovn on November 23, 2014, 02:52:36 pm
1. I have unchecked "secure my vera" and rebooted it.

2. My vera and my android are in the same subnet.

3. I could play an mp3, volume up/down but not TTS.

4. My device RouterIp set to empty and RouterPort set to 80

5. I am using ui7 & veralite (fireware 1.7.439)

6. DLNA plugin version 1.2
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Neos1234 on April 14, 2015, 10:24:36 am
Is it possible to start the movie from a certain point of time, for example (00:04:33) ?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: cw-kid on April 16, 2015, 06:23:02 am
Hello

I have been using the DLNA plug-in 1.0 for a while and I wrote a blog article here (http://windowsmediacenter.blogspot.co.uk/2015/04/vera-dlna-plug-in-yet-more-integration.html) with screen shots, about how I was using it with Kodi / XBMC Media Center.
I have just updated the DLNA plug-in to the latest version 1.3

However for both versions when playing videos (TV Shows / Movies) in Kodi the DLNA plug-in in Vera does not display which movie is being currently played. It does however on the Help and Advanced tabs eventually show the correct video file that is being currently played.

It seems to work much better when playing a music album from the Kodi music library, as then it displays the album cover and also displays metadata like the currently playing albums name, artist name and track information etc.

Any ideas why the DLNA plug-in is not displaying movie cover images? Should it do this? and why it does not show the metadata of the currently playing movie?

I am using a VeraLite UI5

Thanks
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on April 17, 2015, 07:26:23 am
Is it possible to start the movie from a certain point of time, for example (00:04:33) ?

There is the "Seek" action that should help. But no unique action to start and seek at the same time.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on April 17, 2015, 07:30:08 am
However for both versions when playing videos (TV Shows / Movies) in Kodi the DLNA plug-in in Vera does not display which movie is being currently played. It does however on the Help and Advanced tabs eventually show the correct video file that is being currently played.

It seems to work much better when playing a music album from the Kodi music library, as then it displays the album cover and also displays metadata like the currently playing albums name, artist name and track information etc.

Any ideas why the DLNA plug-in is not displaying movie cover images? Should it do this? and why it does not show the metadata of the currently playing movie?

I am using a VeraLite UI5

Thanks

Probably because the DLNA server included in Kodi does not not provide the information (or do it in an unexpected way).
I used the plugin with XBMC and if I correctly remembered I only get the file name as title and one random image of the movie as cover.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: cw-kid on April 17, 2015, 08:52:33 am
OK thanks!

When playing music in Kodi the DLNA plug-in instantly pretty much, displays what is playing and shows the album cover.

When playing a movie in Kodi the DLNA plug-in doesn't seem to display the video title and it does not display any artwork or a random image. It seems very slow at updating and eventually in the help or advanced tab you will see the correct video title / file name that is currently being played. But on the DLNA devices control tab where is says playing.. this is often blank with no title showing.

I have just discovered KodiRemote which might now be better for use with Kodi. I wrote a setup guide here (http://windowsmediacenter.blogspot.co.uk/2015/04/kodiremote-for-micasaverde-vera-home.html).

However for both versions when playing videos (TV Shows / Movies) in Kodi the DLNA plug-in in Vera does not display which movie is being currently played. It does however on the Help and Advanced tabs eventually show the correct video file that is being currently played.

It seems to work much better when playing a music album from the Kodi music library, as then it displays the album cover and also displays metadata like the currently playing albums name, artist name and track information etc.

Any ideas why the DLNA plug-in is not displaying movie cover images? Should it do this? and why it does not show the metadata of the currently playing movie?

I am using a VeraLite UI5

Thanks

Probably because the DLNA server included in Kodi does not not provide the information (or do it in an unexpected way).
I used the plugin with XBMC and if I correctly remembered I only get the file name as title and one random image of the movie as cover.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Neos1234 on April 17, 2015, 11:39:10 am
luup.call_action("urn:dlna-org:serviceId:AVTransport", "Seek", {InstanceID="", Unit=""  , Target= "00:11:22" }, 246 )

It does not work! Could you give an example?


Is it possible to start the movie from a certain point of time, for example (00:04:33) ?

There is the "Seek" action that should help. But no unique action to start and seek at the same time.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: mda on April 18, 2015, 11:01:58 pm
Hi @lolodomo - my renderers keep going offline several times a day. in the log i see

Code: [Select]
LuaUPnP.log:50 04/18/15 10:30:34.908 luup_log:157: DLNA: debug: AVTransport.GetTransportInfo failed: going offline <0x2c197680>
LuaUPnP.log:50 04/18/15 10:30:34.909 luup_log:157: DLNA: debug: commsFailure: Device offline? status=connection refused <0x2c197680>

The only way i get them back online is to click "Discover" again and select the renderer from the list and click "Select" (then i notice the port changes). I think it might be a problem with the device, not with the plugin.

As a work-around is there a way to select a rendered by name via luup? I could have a scene on a timer do that whenever the renderer is offline and it would solve my problem. Thanks!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on April 21, 2015, 05:17:48 pm
The only way i get them back online is to click "Discover" again and select the renderer from the list and click "Select" (then i notice the port changes). I think it might be a problem with the device, not with the plugin.

As a work-around is there a way to select a rendered by name via luup? I could have a scene on a timer do that whenever the renderer is offline and it would solve my problem. Thanks!

Yes, you have the action named "SearchAndSelectDMRDevice" (urn:dlna-org:serviceId:DLNAMediaController1). Use the parameter "Name" and "IP". IP parameter is optional. Name has to be set to the modelName entry in the description file.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: watek2k on May 09, 2015, 11:21:07 am
Ok, I'm a noob to this so don't shoot me down.

Hardware: Vera 3 with UI 7, firmware 1.7.569

Problem: Trying to add Jongo S3 render device via DLNA and uPNP

Plugins: DLNA plugin and Universal PNP plugin

Condition: No upnp devices will discover via discovery or upnp device add (upnp not working)

Workaround: Add device manually by specifying DMR URL

This was fine but the damn URL had a manual port specified after the address (proceeding":" then a random port number so 192.168.81.100:3999) which caused device to go offline.

Temp fix was to telnet in and run command: route add -net 224.0.0.0 netmask 240.0.0.0 dev br-lan

Yay now the discovery works, seems all upnp traffic was being dumped or worse router to wan, only problem was every time I rebooted it had to be done all over again.  Not being a Linux guy this was now a learning exercise.

Fix:  found the Holy Grail for windows UI guys :-) Openwrt!!!! Factory installed!

Went to:
http://192.168.81.1/cgi-bin/webif/info.sh

Navigate to the System then startup tab, go all the way to the bottom and drop the route add command.

Quick reboot and I now have functioning DLNA and upnp!

Took me hours so sharing in hope this helps someone else, i am not saying this is right or even repeatable but its working as desired now and i can see all devices on the wifi when i click discover.

Last tip, username is root and password is under the device on a label which is the same as default wifi password
, good luck and hope this helps other noobs :-)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: mda on August 02, 2015, 11:10:25 pm
Hi @lolodomo - Would you be able to update this plugin with the Google TTS fix that you did for the Sonos plugin? Thanks!
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: watek2k on August 05, 2015, 08:11:36 am
+1 on the TTS Fix!  Please :-)
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: cw-kid on August 05, 2015, 10:16:51 am
+1 on the TTS Fix!  Please :-)

Did it break just recently?

I noticed Google have added a Captcha recently and my TTS URLs stopped working with the Squeezebox plug-in as well.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: n0ir on September 15, 2015, 04:52:47 pm
With 1.4 TTS seems to work again... I can get both Google and Microsoft to speak both English and Swedish (which isn't in the settings, but works using "sv" for language)!

Maybe someone could help with I assume is a easy question?

I have never used the app to play .mp3-files from my NAS before. I would like to play a file as part of a scene in UI7, but I can't get it to work... ;)

I use the PlayDMSMedia action for the created DLNA device, under Advanced Editor in the scene creator. Not comfortable with luup so I try to avoid it.

I understand you need to add "x-file-cifs://" before the URL to the network device? I have put a .mp3-file on the Vera itself for checking, so I used "x-file-cifs://VERAIP/test.mp3".

When I run the scene my DLNA device (KODI on a HTPC) seems to respond (the screensaver is turned off) but no .mp3 is played. TTS works! If I try to play the .mp3 from a browser (using the URL http://VERAIP/chime.mp3) it works.

Should I put something in the ObjectID and Protocol fields?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: cw-kid on September 15, 2015, 05:05:20 pm
Hi

My DLNA plug-in is still version 1.3 and I have auto updates enabled. Just looked on the mIOS App store and its not offering an update. How did you get version 1.4?

Thanks

Never mind I see its in the forum

http://forum.micasaverde.com/index.php/topic,33817.0.html

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: n0ir on September 30, 2015, 09:50:24 am
With 1.4 TTS seems to work again... I can get both Google and Microsoft to speak both English and Swedish (which isn't in the settings, but works using "sv" for language)!

Maybe someone could help with I assume is a easy question?

I have never used the app to play .mp3-files from my NAS before. I would like to play a file as part of a scene in UI7, but I can't get it to work... ;)

I use the PlayDMSMedia action for the created DLNA device, under Advanced Editor in the scene creator. Not comfortable with luup so I try to avoid it.

I understand you need to add "x-file-cifs://" before the URL to the network device? I have put a .mp3-file on the Vera itself for checking, so I used "x-file-cifs://VERAIP/test.mp3".

When I run the scene my DLNA device (KODI on a HTPC) seems to respond (the screensaver is turned off) but no .mp3 is played. TTS works! If I try to play the .mp3 from a browser (using the URL http://VERAIP/chime.mp3) it works.

Should I put something in the ObjectID and Protocol fields?

Nobody who could help me with this (using a scene to play a .mp3 stored on the Vera or a NAS)?
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: paros on December 25, 2015, 01:56:59 am
I have installed the "DLNA DMC app version 1.4" and am able to pause/play via Kodi (XBMC). The first 5 times it also worked using the Text To Speech, but for some reason it stopped (last action was that I raised the volume, but I dont think it caused the problem)...
Since then, I have uninstalled/installed the "DLNA DMC app" again and rebooted the Vera Edge, but nothing happens when I try to use the Text To Speech function.

Need help here :) !
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 26, 2015, 06:29:33 am
I have installed the "DLNA DMC app version 1.4" and am able to pause/play via Kodi (XBMC). The first 5 times it also worked using the Text To Speech, but for some reason it stopped (last action was that I raised the volume, but I dont think it caused the problem)...
Since then, I have uninstalled/installed the "DLNA DMC app" again and rebooted the Vera Edge, but nothing happens when I try to use the Text To Speech function.

Need help here :) !

We have to forget Google TTS. The service is now only partially available.
Rather use Microsoft engine. Works well.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: lolodomo on December 26, 2015, 06:40:06 am
With 1.4 TTS seems to work again... I can get both Google and Microsoft to speak both English and Swedish (which isn't in the settings, but works using "sv" for language)!

Maybe someone could help with I assume is a easy question?

I have never used the app to play .mp3-files from my NAS before. I would like to play a file as part of a scene in UI7, but I can't get it to work... ;)

I use the PlayDMSMedia action for the created DLNA device, under Advanced Editor in the scene creator. Not comfortable with luup so I try to avoid it.

I understand you need to add "x-file-cifs://" before the URL to the network device? I have put a .mp3-file on the Vera itself for checking, so I used "x-file-cifs://VERAIP/test.mp3".

When I run the scene my DLNA device (KODI on a HTPC) seems to respond (the screensaver is turned off) but no .mp3 is played. TTS works! If I try to play the .mp3 from a browser (using the URL http://VERAIP/chime.mp3) it works.

Should I put something in the ObjectID and Protocol fields?

That's normal ! x-file-cifs is a specific protocol for Sonos !
Use the plugin UI to browse and play you MP3 file from your NAS. Then switch to the help tab and take the values from "DMS description URL", "Last server media played" and "Selected protocol" to fill the parameters of the PlayDMSMedia action.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: n0ir on January 20, 2016, 06:48:07 pm
With 1.4 TTS seems to work again... I can get both Google and Microsoft to speak both English and Swedish (which isn't in the settings, but works using "sv" for language)!

Maybe someone could help with I assume is a easy question?

I have never used the app to play .mp3-files from my NAS before. I would like to play a file as part of a scene in UI7, but I can't get it to work... ;)

I use the PlayDMSMedia action for the created DLNA device, under Advanced Editor in the scene creator. Not comfortable with luup so I try to avoid it.

I understand you need to add "x-file-cifs://" before the URL to the network device? I have put a .mp3-file on the Vera itself for checking, so I used "x-file-cifs://VERAIP/test.mp3".

When I run the scene my DLNA device (KODI on a HTPC) seems to respond (the screensaver is turned off) but no .mp3 is played. TTS works! If I try to play the .mp3 from a browser (using the URL http://VERAIP/chime.mp3) it works.

Should I put something in the ObjectID and Protocol fields?

That's normal ! x-file-cifs is a specific protocol for Sonos !
Use the plugin UI to browse and play you MP3 file from your NAS. Then switch to the help tab and take the values from "DMS description URL", "Last server media played" and "Selected protocol" to fill the parameters of the PlayDMSMedia action.

Sorry for the late replay! Thank you @lolodomo! It worked great using the browse option in the created device! Scared my wife half to death when I played a airport chime stored on our NAS through our network speaker... ;)

Now I just need to learn how to play specific network stored .mp3 using scenes... I'm thinking about using this option to play stored, pre-recorded voice notifications instead of using TTS on the fly.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Mike Yeager on July 12, 2016, 03:24:19 pm
How would I use this to make announcements to an android device such as an android phone? I'm exploring the idea of using an android device as a chime / status device...
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: RichardTSchaefer on July 12, 2016, 04:07:15 pm
You would need some DLNA Media Player app on the phone ...

It's easier to use Vera Alerts.
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: Mike Yeager on July 13, 2016, 09:07:23 am
I haven't figured Vera alerts out yet either....  😀
Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: tedp on July 13, 2016, 09:40:50 am
I haven't figured Vera alerts out yet either....  😀
Vera Alerts is the way to go. Check out the documentation http://rts-services.com/Vera/Plugin/VeraAlerts/

There is a bit of a learning curve, but once you get it, you'll be happy.

Sent from my Nexus 5X using Tapatalk

Title: Re: DLNA Media Controller plugin - Common library for UPnP AV
Post by: TMC on September 26, 2016, 09:04:36 am
I bought a SONY BLU-RAY HOME THEATRE SYSTEM, I see this device in DLNA plugin but I can not send them orders. If I use Android and BubbleUPnP I can send audio and video content from DLNA plugin. What can I do to send from DLNA plugin audio and video content to SONY?