Author Topic: DLNA Media Controller plugin - Common library for UPnP AV  (Read 183141 times)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #180 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.

Offline macfly92

  • Full Member
  • ***
  • Posts: 132
  • Karma: +1/-0
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #181 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.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #182 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.
« Last Edit: November 11, 2013, 07:24:59 pm by lolodomo »

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 831
  • Karma: +57/-8
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #183 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?
« Last Edit: November 11, 2013, 08:35:05 pm by a-lurker »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3252
  • Karma: +190/-9
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #184 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).

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #185 on: November 12, 2013, 01:10:30 am »
Access is now enabled.

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 831
  • Karma: +57/-8
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #186 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:
  • a DLNA Mediaserver list for selection
  • an Apple Airplay player
  • and a Net radio list for selection

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?


Offline macfly92

  • Full Member
  • ***
  • Posts: 132
  • Karma: +1/-0
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #187 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 !

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #188 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)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #189 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.
« Last Edit: November 12, 2013, 06:44:26 am by lolodomo »

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #190 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.

Offline macfly92

  • Full Member
  • ***
  • Posts: 132
  • Karma: +1/-0
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #191 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 !

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #192 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.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #193 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.

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 831
  • Karma: +57/-8
Re: DLNA Media Controller plugin - Common library for UPnP AV
« Reply #194 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.