Coder Social home page Coder Social logo

Comments (19)

masmu avatar masmu commented on July 19, 2024

One thing is strange. Does your device have a name? As it seems it discovers your device but it does not identifies itself. What is the new sink called in pavucontrol? Or did you just anonymized the log?

from pulseaudio-dlna.

hcsaustrup avatar hcsaustrup commented on July 19, 2024

The device is called "Libratone 083100". It show up like this in pavucontrol. I moved a couple of other speakers from the log, nothing else.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

Ok. Are you sure, that you specified the correct host of your computer? You have to specify the address your computer is reachable within your network. Most times something like 192.168.x.x.

Registering failed means that the xml request which normally registers your computer as a remote controller is declined by the upnp device (speaker). The server returns something other than HTTP 200. I have heard of devices where you have to confirm the access, e.g. with a remote control usually with TVs.

On the other hand, it could be that the xml request is somehow invalid for your device. It had this problem once myself, and usually there is nothing wrong besides an attribute (or stuff like this) which is fine for most devices but your device has some issues with it.

from pulseaudio-dlna.

hcsaustrup avatar hcsaustrup commented on July 19, 2024

Full logs:

$ ./pulseaudio_dlna.py --host 192.168.0.135
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.75
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.50
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.65
INFO:root:found upnp_device "<CoinedUpnpMediaRenderer name="192.168.0.75 - Sonos PLAY:5" short_name="sonosplay" state="idle">"
INFO:root:found upnp_device "<CoinedUpnpMediaRenderer name="192.168.0.50 - Sonos PLAY:5" short_name="sonosplay" state="idle">"
INFO:root:found upnp_device "<CoinedUpnpMediaRenderer name="Libratone 083100" short_name="libratone" state="idle">"

The devices show up in pavucontrol. Music is playing on the local analog stereo sink. I pick "Libratone 083100":

INFO:root:PulseWatcher.on_device_updated
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.65

The music stops, but pavucontrol indicates that the music is still playing (volume peak bar changes).
After a little while:

ERROR:root:"Libratone 083100" registering failed!
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.65
ERROR:root:"Libratone 083100" playing failed!

I've got the local firewall completely disabled, so I'm assuming the problem is that the reply from my PC is slightly off, and the speaker can't understand it. I'm not sure if this is a pulseaudio or pulseaudio-dlna issue, but I'd love to get to the bottom of it :-)

Assuming the two devices can see each other, what would be the next step in debugging this? Dump network traffic between a working setup (like Mac/Windows) and the speaker and compare this to a dump of traffic between my Linux system and the speaker?

Sorry for being a bit clueless here - I hope my enthusiasm makes up for it ;-)

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

It does indeed :) and it is a pulseaudio-dlna issue.

I mentioned i had a similar problem (i assume its the same kind of problem) before.
Here you can find the commit which fixed it, so you get an idea what might be wrong.
In your case it is the registering command which fails first.

I can give you some hints how to reproduce a successful registering.
There is a package named gupnp-tools which has 2 neat tools. One is gupnp-av-cp which can perform basic operations to upnp devices such as registering, playing, pause or stop.
We will use this to get a valid XML request, but in case you have applications which work with your Libratone device, they also do the job. But hence you want to capture their traffic they should run on your computer.
Surprise, you need a network sniffer. A good one is named wireshark. It records your network traffic so that you can analyse whats really going on.
What you have to do is, first start wireshark and make sure that it is recording your current network traffic.
Hint: It really helps if there is no other traffic at all. A running download e.g. would make the traffic log really long ;)
After that start gupnp-av-cp. It should also detect your Libratone device. Select your device in gupnp-av-cp. This is the part where gupnp-av-cp should have registered your speaker and therefore wireshark has recordered a XML register-request which acutally works with your device.
Now you can stop wireshark from recording your network, but don't close it. Just stop the recording. It makes debugging easier.
In wireshark you can watch the packages which got recorded. Search for a POST request to your device which should look like the follwing:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
            <InstanceID>0</InstanceID>
            <CurrentURI>{stream_url}</CurrentURI>
            <CurrentURIMetaData>{current_url_metadata}</CurrentURIMetaData>
        </u:SetAVTransportURI>
    </s:Body>
</s:Envelope>

Another hint for the correct request is the following HTTP header entry:

SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"

If you found it, you can compare it to the one pulseaudio-dlna does. meld is a good tool for that.
You can find the xml request templates in upnp -> renderer.py : 32 & 43

Hopefully this helps you debugging this yourself. I plan to do a release tomorrow evening with a new --debug flag which will hopefully does much more logging. But if the problem is what i assume, logs won't help me much. So the next release is more for eleminating other possibilities as actually solving yours.

I will try my best to get this running. If you have any problems don't hesitate to ask.
Keep me posted and good luck!

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024
  • 0.2.1 - (2015-01-11)
    • TTL changed to 10 and timeout to 5 for UDP broadcasting
    • Added the --renderer-urls option to manually add UPNP devices via their control url
    • Added the --debug flag
    • The host ip address is now discovered automatically, no need to specifiy --host anymore

from pulseaudio-dlna.

hcsaustrup avatar hcsaustrup commented on July 19, 2024

Hi!

A quick update; I pulled the latest version from git, and tried running it again, this time with --debug:

$ ./pulseaudio_dlna.py --host 192.168.0.135 --debug
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.61
DEBUG:urllib3.connectionpool:"GET /smp_19_ HTTP/1.1" 200 2835
DEBUG:root:Response from upnp device (http://192.168.0.61:7676/smp_19_)
<?xml version="1.0"?>
<root xmlns='urn:schemas-upnp-org:device-1-0' xmlns:pnpx='http://schemas.microsoft.com/windows/pnpx/2005/11' xmlns:df='http://schemas.microsoft.com/windows/2008/09/devicefoundation' xmlns:sec='http://www.sec.co.kr/dlna'>
 <specVersion>
  <major>1</major>
  <minor>0</minor>
 </specVersion>
 <device>
  <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
  <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001</pnpx:X_compatibleId>
  <df:X_deviceCategory>Display.TV.LCD Multimedia.DMR</df:X_deviceCategory>
  <dlna:X_DLNADOC xmlns:dlna='urn:schemas-dlna-org:device-1-0'>DMR-1.50</dlna:X_DLNADOC>
  <friendlyName>[TV]Mødelokale (lille)</friendlyName>
  <manufacturer>Samsung Electronics</manufacturer>
  <manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
  <modelDescription>Samsung TV DMR</modelDescription>
  <modelName>UE55H6410</modelName>
  <modelNumber>AllShare1.0</modelNumber>
  <modelURL>http://www.samsung.com/sec</modelURL>
  <serialNumber>20110517DMR</serialNumber>
  <UDN>uuid:0a21fe82-00aa-1000-8bb9-5056bfdc8607</UDN>
  <sec:deviceID>P7CHVWLL6CIA6</sec:deviceID>
  <iconList>
   <icon>
    <mimetype>image/jpeg</mimetype>
    <width>48</width>
    <height>48</height>
    <depth>24</depth>
    <url>/dmr/icon_SML.jpg</url>
   </icon>
   <icon>
    <mimetype>image/jpeg</mimetype>
    <width>120</width>
    <height>120</height>
    <depth>24</depth>
    <url>/dmr/icon_LRG.jpg</url>
   </icon>
   <icon>
    <mimetype>image/png</mimetype>
    <width>48</width>
    <height>48</height>
    <depth>24</depth>
    <url>/dmr/icon_SML.png</url>
   </icon>
   <icon>
    <mimetype>image/png</mimetype>
    <width>120</width>
    <height>120</height>
    <depth>24</depth>
    <url>/dmr/icon_LRG.png</url>
   </icon>
  </iconList>
  <serviceList>
   <service>
    <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
    <controlURL>/smp_21_</controlURL>
    <eventSubURL>/smp_22_</eventSubURL>
    <SCPDURL>/smp_20_</SCPDURL>
   </service>
   <service>
    <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
    <controlURL>/smp_24_</controlURL>
    <eventSubURL>/smp_25_</eventSubURL>
    <SCPDURL>/smp_23_</SCPDURL>
   </service>
   <service>
    <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
    <controlURL>/smp_27_</controlURL>
    <eventSubURL>/smp_28_</eventSubURL>
    <SCPDURL>/smp_26_</SCPDURL>
   </service>
  </serviceList>
  <sec:ProductCap>Y2014,WebURIPlayable,SeekTRACK_NR,NavigateInPause</sec:ProductCap>
  <pnpx:X_hardwareId>VEN_0105&amp;DEV_VD0001</pnpx:X_hardwareId>
 </device>
</root>

Using localhost: 192.168.0.135:8080
Traceback (most recent call last):
  File "./pulseaudio_dlna.py", line 119, in <module>
    main()
  File "./pulseaudio_dlna.py", line 84, in main
    dlna_discover.search()
  File "/home/hc/src/pulseaudio-dlna/upnp/discover.py", line 48, in search
    self._header_received(header, address)
  File "/home/hc/src/pulseaudio-dlna/upnp/discover.py", line 58, in _header_received
    logging.info('found upnp_device "{}"'.format(upnp_device))
  File "/home/hc/src/pulseaudio-dlna/upnp/renderer.py", line 231, in __str__
    self.state,
UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-6: ordinal not in range(128)

Not sure what this means, but it looks like pulseaudio-dlna is unhappy about the XML from the Samsung TV after the lastest update?

Anyway, I installed gupnp-av-cp 0.8.9 and tested it with a local Rygel DLNA server and Rygels built-in renderer ("Audio/Video playback on (hostname)"). It worked. I picked the Libratone renderer, but there doesn't seem to be any connection. No visible errors though.

from pulseaudio-dlna.

hcsaustrup avatar hcsaustrup commented on July 19, 2024

(The above issue with pulseaudio-dlna and character encodings suddenly went away and now it starts fine)

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

So, just to get this right. The Samsung TV does work now?

Whats about the Libratone device?
What do you mean by "I picked the Libratone renderer, but there doesn't seem to be any connection. No visible errors though.". Could you explain this more in detail?

from pulseaudio-dlna.

hcsaustrup avatar hcsaustrup commented on July 19, 2024

I think the Samsung TV went offline. When I run pulseaudio-dlna now, it only includes the Sonos devices and the Libratone speaker.

I'm not sure if this is useful to you, but this is the device information on the Libratone:

<device ms:X_MS_SupportsWMDRM="true">
    <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
    <pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001
                </pnpx:X_compatibleId>
    <pnpx:X_deviceCategory>MediaDevices
                </pnpx:X_deviceCategory>
    <pnpx:X_hardwareId>Libratone_Wireless_Speaker_0xBD VEN_0138&amp;DEV_0001&amp;REV_01
                </pnpx:X_hardwareId>
    <df:X_deviceCategory>Multimedia.DMR
                </df:X_deviceCategory>
    <qq:X_QPlay_SoftwareCapability>QPlay:2</qq:X_QPlay_SoftwareCapability>
    <smsc:ProductCap>SeekOnPaused,WHA</smsc:ProductCap>
    <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
    <friendlyName>Libratone 083100</friendlyName>
    <manufacturer>Libratone</manufacturer>
    <manufacturerURL>http://www.libratone.com</manufacturerURL>
    <modelDescription>Libratone</modelDescription>
    <modelName>Libratone</modelName>
    <modelNumber>2</modelNumber>
    <modelURL>http://www.libratone.com</modelURL>
    <serialNumber>C467B5083100</serialNumber>
    <UDN>uuid:5f9ec1b3-ed59-1900-4530-c467b5083100</UDN>
    <UPC>123810928305</UPC>
    <iconList>
        <icon>
            <mimetype>image/jpeg</mimetype>
            <width>48</width>
            <height>48</height>
            <depth>24</depth>
            <url>/BCO_device_sm_icon.jpg</url>
        </icon>
        <icon>
            <mimetype>image/jpeg</mimetype>
            <width>120</width>
            <height>120</height>
            <depth>24</depth>
            <url>/BCO_device_lrg_icon.jpg</url>
        </icon>
        <icon>
            <mimetype>image/png</mimetype>
            <width>48</width>
            <height>48</height>
            <depth>24</depth>
            <url>/BCO_device_sm_icon.png</url>
        </icon>
        <icon>
            <mimetype>image/png</mimetype>
            <width>120</width>
            <height>120</height>
            <depth>24</depth>
            <url>/BCO_device_lrg_icon.png</url>
        </icon>
    </iconList>
    <serviceList>
        <service>
            <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
            <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
            <SCPDURL>/RenderingControl/desc.xml</SCPDURL>
            <controlURL>/RenderingControl/ctrl</controlURL>
            <eventSubURL>/RenderingControl/evt</eventSubURL>
        </service>
        <service>
            <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
            <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
            <SCPDURL>/ConnectionManager/desc.xml</SCPDURL>
            <controlURL>/ConnectionManager/ctrl</controlURL>
            <eventSubURL>/ConnectionManager/evt</eventSubURL>
        </service>
        <service>
            <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
            <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
            <SCPDURL>/AVTransport/desc.xml</SCPDURL>
            <controlURL>/AVTransport/ctrl</controlURL>
            <eventSubURL>/AVTransport/evt</eventSubURL>
        </service>
        <service>
            <serviceType>urn:schemas-smsc-com:service:X_WholeHomeAudio:1</serviceType>
            <serviceId>urn:schemas-smsc-com:serviceId:X_WholeHomeAudio:1</serviceId>
            <SCPDURL>/WholeHomeAudio/desc.xml</SCPDURL>
            <controlURL>/WholeHomeAudio/ctrl</controlURL>
            <eventSubURL/>
        </service>
        <service>
            <serviceType>urn:schemas-tencent-com:service:QPlay:1</serviceType>
            <serviceId>urn:tencent-com:serviceId:QPlay</serviceId>
            <SCPDURL>/QPlay/desc.xml</SCPDURL>
            <controlURL>/QPlay/ctrl</controlURL>
            <eventSubURL/>
        </service>
    </serviceList>
    <presentationURL>http://192.168.0.65</presentationURL>
</device>

Anyway, with regards to the gupnp-av-cp test, what I did was this:

  • Installed Rygel (I needed a DLNA server for testing)
  • Fired up the Rygel service
  • Installed gupnp-av-cp (0.8.9)
  • Started gupnp-av-cp

Here I was able to open my music collection through the Rygel DLNA server (show up as "HC's media") and play to the Rygel loopback renderer:

screenshot from 2015-01-12 15 58 53

Now that the media server has been verified, I tried to select the Libratone renderer and press Play:

screenshot from 2015-01-12 15 59 38

And nothing happens. No errors. No music. My conclusion: the Libratone speaker doesn't work with gupnp-av-cp and/or the Rygel DLNA server either.

I'm guessing I need to find a Windows system and dump network traffic when it registers the speaker?

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

To be honest. I really don't trust rygel, because of its complicated setup and its unreliability. Thats why i created that project in the first place.

What if you change rygel for an android / iphone DLNA server.
You can do this, because the registering (and also the playing command) is just between pulseaudio-dlna and your speaker. The DLNA server (what you rygel used for) is just the stream target, and until now there were not any problems with that part.
So, if you are already sniffing your network traffic search for the playing command too, just in case.
For android i can recommend BubbleUPnP for that. I used it myself for such kind of debugging.
So you have another try without switching to windows or mac.

In case that won't work, it would be great if you nevertheless can record the registering POST request as well as the device response and post them here.

It all that fails, i guess you have to use windows (or mac) to record the request.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

Because of your logs i figured out why your Samsung TV made pulseaudio-dlna crash. Fix will follow this evening.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024
  • 0.2.2 - (2015-01-18)
    • Fixed encoding issues
    • Try to load the DBus module if it is not loaded before (thanks to Takkat-Nebuk)

Try the new version. Perhaps this solves your issue. Anyway i am pretty sure that it won't crash anymore if there is your Samsung TV online. ;)

from pulseaudio-dlna.

holthe avatar holthe commented on July 19, 2024

Hello @hcsaustrup and @masmu,

I found this project (and this specific issue) because I have a Libratone Zipp to which I wanted to stream from my Linux machine - only to discover a "Bad Request" response for every POST request made through pulseaudio-dlna. I have managed to get the stream working by adding UTF-8 charset to every POST request in renderer.py, i.e. by setting

'Content-Type': 'text/xml; charset="utf-8"'

in the functions register, play, stop and pause.

I hope this helps.

Kind regards,
Peter Holthe Hansen

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

Thank you very much for sharing this!

I think that could be the solution and created a branch testing/renderer-incompatibility-fix-1

So guys, please test this.

from pulseaudio-dlna.

holthe avatar holthe commented on July 19, 2024

@masmu, I just tested the new branch and can confirm that it works (as expected) for me (Libratone Zipp Firmware version s9797.115.1).

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

Please test this version. I assume that this fixes your issues with the Libratone device.
Note that there is now a PPA to install from.

  • 0.3.0 - (2015-02-01)
    • Added debian packaging
    • Added proper signal handlers (new dependency: python-setproctitle)
    • Fixed a bug where binding to an already used port made the application crash
    • HTTP charset encoding is now specified correctly

from pulseaudio-dlna.

holthe avatar holthe commented on July 19, 2024

I installed via the PPA (yesterday, I think) but it did not work (output in terminal was just the PID line). Today I tried cloning the master branch. After installing python-setuptools, running setup.py and updating via the PPA, I now have it running successfully with the previously mentioned device 👍

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

@hcsaustrup Did you try the latest version? Is your issue fixed too?

from pulseaudio-dlna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.