Quantcast
Jump to content

  • 0

LG SmartShare cannot handle multiple UPnP/DLNA streams


palswim

Question

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?

Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

@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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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 rwskinner
      A few months ago after a firmware update, the one that says "SLING + FreeStream" across the screen on starting sling, each time the tv comes on, and sling was the last item open, it says network error, and if I exit sling loads fine.
      It only does this with Sling and my LG tv's.  Netflix doesn't do it and my Samsung and Visio don't do it.  None of my LG's did until that update.   It's like they're trying to go to a site before the TV's network is ready, and no retrying it.
      If I go to Netflix then turn off the TV, when I turn it back on Netflix loads just fine with no Error.
      I'm resetting these again.  I tried that multiple times and it doesn't fix anything.  Deleting the Sling app and reloading and updating doesn't help either.  This all happens on all 3 of my new LG's.
    • By Beelbo
      Is there a Twitter App for LG webOS? I can't find it in the LG Content Store on my LG smart OLED TV.  I can open Twitter in the browser app, and once it raised a prompt "It's better in the App" but that has not returned. 

      Web searches on the topic come up empty.  Either the app is there so nobody asks about it, OR people are really incurious!
    • By picklesandbeans92
      I  have just bought an LG TV (model LG 43UQ7500). I have tuned it via antenna, but the TV has a problem playing everything (it says "invalid service") except for 7 channels, which are public broadcast (but that shouldn't make difference - they are all DTV). The only thing that does help is turning off the TV, waiting for a few minutes and then turning it back on. Once I turn it off and then on, it stops working - except for the 7 channels. So it's a neverending process of turning it off and on to actually be able to watch the TV. 
      Does anybody know what could be causing this? The TV has been updated, I have set it up for my location (Czech Republic), I've tried factory reset....
      Thank you for your suggestions!
       
    • By News Reporter
      New LG MAGNIT Designed for Advanced Content Creation Offers
      Excellent Picture Quality, Easy Installation and More

      SEOUL, May 24, 2023 — LG Electronics (LG) has announced the launch of its new LG MAGNIT (model LBAF) display for virtual production. A huge screen leveraging the company’s cutting-edge Micro LED technology, the new model delivers premium picture quality with deep blacks and vibrant, natural colors, helping directors to create immersive visual experiences. Ideal for film and media production, the new LG MAGNIT is capable of displaying digitally-rendered images in real time; synchronizing with monitors, cameras, camera trackers and production computers so that virtual and live-action elements can be seamlessly blended together.
      The use of LED displays to provide lifelike backdrops for shooting footage of real actors, presenters and foreground objects is becoming more popular in the broadcasting and film industries. Designed specifically for virtual production studios and extended reality (XR) stages, the new LG MAGNIT, boasting LG’s robust chip-on-board (COB) LED technology and a 1.5 millimeter pixel pitch, delivers the supreme picture quality, features and convenience needed for professional content production. Employing millions of self-lit pixels, LG’s Micro LED panels are known for their stellar contrast, bright colors and accurate image reproduction. LG MAGNIT’s ability to faithfully display digitally-rendered landscapes – whether depicting a location from this world or a completely imagined realm – enables directors to make their artistic vision come to life.
      LG MAGNIT for virtual production provides versatility by giving users the ability to customize the size of the displayed image and choose either hanging or stacking installation.* The structure of LG’s Micro LED solution helps reduce color distortion to keep images true across a wide viewing angle, making the impressive display suitable for large-screen configurations. Additionally, for content creators that prefer an immersive effect, LG MAGNIT allows for a concave curvature of up to 10 degrees. The design of this state-of-the-art display also makes module alignment easy.
      For simplicity of setup and management, the new LG MAGNIT offers convenient installation and maintenance. LG’s Micro LED display comes with large, 35.6-inch cabinets and has panel modules and power supply units that can be accessed from the rear. Offering broadcast quality performance, LG’s purpose-built display solution pairs superb color accuracy with low latency video processing and excellent HDR capabilities.
      “A premium Micro LED display, LG MAGNIT for virtual production is an invaluable tool for broadcasting systems, movie studios and XR stages, helping directors to see their creative vision come to life,” said Paik Ki-mun, senior vice president and head of the Information Display business unit of LG Electronics Business Solutions Company. “Through collaboration with industry leaders, LG will continue to enhance its lineup of Micro LED solutions, offering large-scale displays customized to the unique requirements of diverse verticals.”
      Since its initial launch in 2020, LG MAGNIT has raised the bar for premium display experiences, leveraging LG’s Micro LED technology to deliver stunning picture quality with accurate colors. Designed for use in various environments, the MAGNIT lineup includes displays for residential settings (model
      link hidden, please login to view / pixel pitch: 0.78mm) and solutions for diverse business sectors, including corporate, retail and hospitality (model / pixel pitch: 0.78/0.9/1.25mm). The new LG MAGNIT will be available in markets worldwide starting from this month. For more information about LG MAGNIT, visit .
      # # #
      * Accessories required for installation are sold separately.

    • By Miroslav Tuhársky
      Hello, I have LG OLED CX and recently the Youtube app has incorrect geographic data- CH. I am from Slovakia, the TV has never been to Switzerland. Nor physically, nor virtually (VPN). I am getting CH ads, which I dont mind so much, but I am afraid of possible in app geo restrictions.
      I already tried everything, even resetting the TV to default.  No other TV app is affected.
      Anybody please advise.




×
×
  • Create New...