Quantcast
Jump to content

  • 0

LG SmartShare cannot handle multiple UPnP/DLNA streams


Question

Posted

I discovered that my LG SmartShare app could not play FLAC or M4A audio files natively from my DLNA server, so I decided to enable transcoding on the server to present MP3/WAV resources in addition to the native stream. However, the SmartShare app still doesn't display those files when browsing for audio, and I am trying to determine why.

And now, the extreme technical detail:

I have a shell utility, upnp-browse.sh to make HTTP calls to my DLNA server, emulating the types of calls that LG SmartShare would make:

#!/bin/sh

curl -s -d @- -H 'Content-Type: text/xml; charset="utf-8"' -H 'SOAPAction: #Browse' http://host/path/to/DLNA \
	| xmllint --xpath '////Result/text()' - \
	| recode html..utf8 \
	| xml_pp

The curl call makes a HTTP POST request with the data from stdin, which would have similar content to the following:

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
	<s:Body>
		<u:Browse xmlns:u="urn:schemas-upnp-org:service:serviceType:v">
			<ObjectID>ID_PARENT</ObjectID>
			<BrowseFlag>BrowseDirectChildren</BrowseFlag>
		</u:Browse>
	</s:Body>
</s:Envelope>

The call to curl then yields an XML Response similar to the following:

<?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="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">
<item id="ID_FILE" parentID="ID_PARENT" restricted="1"><dc:title>Title</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:creator>Creator</dc:creator><upnp:artist>Artist</upnp:artist><res size="######" duration="H:MM:SS.###" bitrate="1022868" sampleFrequency="44100" nrAudioChannels="2" protocolInfo="http-get:*:audio/x-flac:*">http://IP:port/MediaItems/####.ext</res><res duration="H:MM:SS.###" bitrate="176400" sampleFrequency="44100" nrAudioChannels="2" protocolInfo="http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000">http://IP:port/MediaItems/TranscodeAudio/LPCM/####.ext</res><res duration="H:MM:SS.###" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000">http://IP:port/MediaItems/TranscodeAudio/MP3/####.ext</res></item><container id="ID_FOLDER" parentID="ID_PARENT" restricted="1" searchable="1" childCount="#"><dc:title>folder name</dc:title><upnp:class>object.container.storageFolder</upnp:class><upnp:storageUsed>-1</upnp:storageUsed></container></DIDL-Lite></Result>
<NumberReturned>2</NumberReturned>
<TotalMatches>2</TotalMatches>
<UpdateID>3</UpdateID></u:BrowseResponse></s:Body></s:Envelope>

Then the calls to xmllint, recode, and xml_pp take this data and extract the data from the Result node and format it for readability, yielding an output similar to:

<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="ID_FILE" parentID="ID_PARENT" restricted="1">
    <dc:title>Title</dc:title>
    <upnp:class>object.item.audioItem.musicTrack</upnp:class>
    <dc:creator>Creator</dc:creator>
    <upnp:artist>Artist</upnp:artist>
    <res bitrate="1022868" duration="H:MM:SS.###" nrAudioChannels="2" protocolInfo="http-get:*:audio/x-flac:*" sampleFrequency="44100" size="######">http://IP:port/MediaItems/####.ext</res>
    <res bitrate="176400" duration="H:MM:SS.###" nrAudioChannels="2" protocolInfo="http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000" sampleFrequency="44100">http://IP:port/MediaItems/TranscodeAudio/LPCM/####.ext</res>
    <res duration="H:MM:SS.###" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000">http://IP:port/MediaItems/TranscodeAudio/MP3/####.ext</res>
  </item>
  <container childCount="#" id="ID_FOLDER" parentID="ID_PARENT" restricted="1" searchable="1">
    <dc:title>folder name</dc:title>
    <upnp:class>object.container.storageFolder</upnp:class>
    <upnp:storageUsed>-1</upnp:storageUsed>
  </container>
</DIDL-Lite>

Note with the sample file (item node), it contains three res nodes. The DLNA client (LG SmartShare) should select the data from the res node for the format it supports, and allow for selection of the item, but when I browse in the container which contains the item, LG SmartShare doesn't show it.

For native MP3 files, SmartShare will show and play those items. I can provide output for native MP3 items, as well as OGG or MP4/M4A files if those would help, though they all look fairly similar. However, for native MP3 files, the first res node has a slightly different set of DLNA flags:

<res bitrate="128000" duration="H:MM:SS.###" nrAudioChannels="2" protocolInfo="http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" sampleFrequency="44100" size="######">http://IP:port/MediaItems/####.mp3</res>

Is my server serving something incorrectly, does SmartShare just not support multiple res nodes, or have I overlooked something?

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

@palswim Interesting and neat (but very technical) thing to do! 😊

I assume you are using the latest Smartshare (33).2.3.1511.1201 ?  I always found it very clunky and "old fashioned", and as it has not been updated for over 2 years, I suspect it has bugs, and has fallen behind modern techiques and codec standards and stream processing methods.

I noticed on the same LG download site when checking the versions, there is mention of a "plex TV" app or "Plex Media Server", but I am unsure if this is suitable for your needs, or compatible with your DLNA  setup? See

link hidden, please login to view

By the way, did you check that all of your  DLNA devices have the latest firmware, and software stacks running on them?

Edited by td47
typo

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Topics

    • By wallyricks
      I have owned a couple of LG TV’s over the last 8 years, with the current one being a high-end 77” model.
      I am still using LG TV SmartShare (v.33) as my “Media Player” v2.3.1511.1201 for my PC– which was last updated in 2015 but it is still compatible today.  As proof, my latest TV is now 11 months old and I have had zero issue (until you see below).    
      link hidden, please login to view My PC setup is: Windows 10 Pro (with all latest updates) and a TP-Link Archer BE19000 (BE805) router.    NOTHING has been changed on my router, TV (no updated or changed firmware) or any equipment moved around in the last 4 months.
      Up until about 3 weeks ago, everything ran just fine.  The SmartShare program was always defaulted to have Sharing ON, upon start of it, which is always when Windows boots).  However, about 3 weeks ago, the SmartShare PC program has started to randomly change its status to Sharing OFF.  I would then have to go into the program, manually change it to ON and then it works anywhere for 30 minutes up to 20 hours, and again, randomly change the Sharing to OFF.
      I am an experienced PC user, and I am very sure that this has nothing to do with my WIFI because it’s not a dropped connection or random TV not being found.   Something is happening inside Windows 10 that is triggering this status change.  And it never fluctuates back to Sharing ON by itself.
      Being so frustrated, I actually updated the Router to the latest firmware a few days ago, but this problem continues as before.
      As an experiment, I installed an alternate Media Server program called Serviio.  One can also see that when my Sharing changes to OFF, the two green lights turn red.
      Anyone have an idea of what can be happening after nearly 8 years of not experiencing this?       I am guessing that Windows is triggering some “Service” to stop running, but what can it be?





    • By Joe C
      Since the Web OS update last week, the line on the Home Screen with all my apps has changed.  Now Apps is the first one in the line.  I do not want it there, but cannot move it.  If I go to the end where it shows Edit Apps, I can click on any app to move it or delete it.  But, the Apps icon is grayed out and cannot be moved.  My neighbor has the exact same model I do -- LG OLED 653PUA -- and it is not like that on his tv.  He can move the App icon anywhere he wants.  This is very annoying as it defaults to the Apps icon when I click on Home and then I need to click to get to YouTube TV, which until the update was always first in the line.  
    • By starwoodtech
      I have an optical plugged into a hearing aid box. I also have an LG S95QR sound bar plugged into the eARC.
      Works fine in eARC. When I try to select the optical + TV option for output, it switches over ok for about .5 seconds, then automatically switches back to the eARC output without me doing it.
      Does anyone know what it might do this? Why can't I change my output if I so choose?
    • By Peter Steinmeijer
      I can't connect  my LG ThinQ app to Google Home app.
      When I try I'm 'told' that no compatible appliance is found.
      But my tv, the LG Web OS TV  UM7100PLB ( 2019 ), is in the LG ThinQ app. I even reinstalled it.
      This probably is not a new subject, but, if this question has ever been answered, I can't find a solution.
      Is my TV too old ?
       
    • Solution For That Pollution
    • By Stephen Davies
      As above! All4 & My5 will no longer work. Also, how do you update the browser? My LG nano TV is just over 3 years old.
×
×
  • Create New...