Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlna dmr error on device playing music #135424

Open
VergilGao opened this issue Jan 12, 2025 · 3 comments
Open

dlna dmr error on device playing music #135424

VergilGao opened this issue Jan 12, 2025 · 3 comments

Comments

@VergilGao
Copy link

VergilGao commented Jan 12, 2025

The problem

I have a dlna speaker, which usually works well with DLNA DMR, but when I use QQ Music to play music on it, it becomes unavailable in HA.

What version of Home Assistant Core has the issue?

core-2025.1.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

DLNA Digital Media Renderer

Link to integration documentation on our website

https://www.home-assistant.io/integrations/dlna_dmr

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2025-01-12 12:45:02.392 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1713, in feed
    self.parser.Parse(data, False)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1055, in _async_update_entity_states
    await entity.async_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 978, in async_update_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1107, in __async_calculate_state
    if (entity_picture := self.entity_picture) is not None:
                          ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1081, in entity_picture
    return self.media_image_local
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1086, in media_image_local
    if (image_hash := self.media_image_hash) is None:
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 652, in media_image_hash
    if (url := self.media_image_url) is not None:
               ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/media_player.py", line 894, in media_image_url
    return self._device.media_image_url
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 1198, in media_image_url
    items = _cached_from_xml_string(xml)
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
    return didl_lite.from_xml_string(xml, strict=False)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
    xml_el = defusedxml.ElementTree.fromstring(xml_string)
  File "/usr/local/lib/python3.13/site-packages/defusedxml/common.py", line 126, in fromstring
    parser.feed(text)
    ~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1715, in feed
    self._raiseerror(v)
    ~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1622, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0

Additional information

This is the description.xml file for the speaker when the entity becomes unavailable.

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<dlna:X_DLNADOC>DMR-1.50</dlna:X_DLNADOC>
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
<friendlyName>main bedroom</friendlyName>
<manufacturer>wiimu</manufacturer>
<manufacturerURL>http://www.wiimu.com/</manufacturerURL>
<modelDescription>WiiMu LinkPlayer</modelDescription>
<modelName>WiiMu LinkPlayer</modelName>
<modelURL>http://www.muzohifi.com/</modelURL>
<UDN>uuid:FF310092-AE0B-BE9A-139A-89A6FF310092</UDN>
<modelNumber>V01-Jun  4 2018
</modelNumber>
<serialNumber>00001</serialNumber>
<ssidName>GGMM_E3_9D4C</ssidName>
<uuid>FF310092AE0BBE9A139A89A6</uuid>
<qq:X_QPlay_SoftwareCapability xmlns:qq="http://www.tencent.com">QPlay:2</qq:X_QPlay_SoftwareCapability>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnp/grender-48x48.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnp/grender-120x120.png</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnp/grender-48x48.jpg</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnp/grender-120x120.jpg</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
<SCPDURL>/upnp/rendertransportSCPD.xml</SCPDURL>
<controlURL>/upnp/control/rendertransport1</controlURL>
<eventSubURL>/upnp/event/rendertransport1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/upnp/renderconnmgrSCPD.xml</SCPDURL>
<controlURL>/upnp/control/renderconnmgr1</controlURL>
<eventSubURL>/upnp/event/renderconnmgr1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
<SCPDURL>/upnp/rendercontrolSCPD.xml</SCPDURL>
<controlURL>/upnp/control/rendercontrol1</controlURL>
<eventSubURL>/upnp/event/rendercontrol1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-wiimu-com:service:PlayQueue:1</serviceType>
<serviceId>urn:wiimu-com:serviceId:PlayQueue</serviceId>
<SCPDURL>/upnp/PlayQueueSCPD.xml</SCPDURL>
<controlURL>/upnp/control/PlayQueue1</controlURL>
<eventSubURL>/upnp/event/PlayQueue1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-tencent-com:service:QPlay:1</serviceType>
<serviceId>urn:tencent-com:serviceId:QPlay</serviceId>
<SCPDURL>/upnp/QPlaySCPD.xml</SCPDURL>
<controlURL>/upnp/control/QPlay1</controlURL>
<eventSubURL>/upnp/event/QPlay1</eventSubURL>
</service>
</serviceList>
</device>
</root>
@home-assistant
Copy link

Hey there @chishm, mind taking a look at this issue as it has been labeled with an integration (dlna_dmr) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of dlna_dmr can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign dlna_dmr Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


dlna_dmr documentation
dlna_dmr source
(message by IssueLinks)

@VergilGao
Copy link
Author

add this speaker as link play device then fix it.

@VergilGao VergilGao changed the title dlna dmr error on device playing music from qqmusic dlna dmr error on device playing music Jan 12, 2025
@VergilGao
Copy link
Author

OK, got the same error on another device.
it was playing music owntone server as a airplay device. but can't config as an airplay device on homeassistant. so i config it as dlna device.

the error log:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1713, in feed
    self.parser.Parse(data, False)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
xml.parsers.expat.ExpatError: unbound prefix: line 1, column 945

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/aiohttp.py", line 348, in _handle_request
    status = await self.event_handler.handle_notify(http_request)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/event_handler.py", line 167, in handle_notify
    service.notify_changed_state_variables(changes)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/client.py", line 543, in notify_changed_state_variables
    self.on_event(self, changed_state_variables)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 389, in _on_event
    dlna_handle_notify_last_change(state_variable)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 215, in dlna_handle_notify_last_change
    service.notify_changed_state_variables(changes_0)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/client.py", line 543, in notify_changed_state_variables
    self.on_event(self, changed_state_variables)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 394, in _on_event
    self._update_current_track_meta_data(state_variable)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 1086, in _update_current_track_meta_data
    items = _cached_from_xml_string(xml)
  File "/usr/local/lib/python3.13/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
    return didl_lite.from_xml_string(xml, strict=False)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
    xml_el = defusedxml.ElementTree.fromstring(xml_string)
  File "/usr/local/lib/python3.13/site-packages/defusedxml/common.py", line 126, in fromstring
    parser.feed(text)
    ~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1715, in feed
    self._raiseerror(v)
    ~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1622, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: unbound prefix: line 1, column 945

the xml:

<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<dlna:X_DLNADOC>DMR-1.50</dlna:X_DLNADOC>
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
<friendlyName>主卧的漫步者音箱</friendlyName>
<manufacturer>WiiMu</manufacturer>
<manufacturerURL>http://www.wiimu.com/</manufacturerURL>
<modelDescription>WiiMu Media player</modelDescription>
<modelName>WiiMu Media player</modelName>
<modelURL>http://www.wiimu.com/</modelURL>
<UDN>uuid:1ffc1d28-1dd2-11b2-b1ba-d894f992681c</UDN>
<modelNumber>V01-Oct  8 2015
</modelNumber>
<serialNumber>00001</serialNumber>
<ssidName>主卧的漫步者音箱</ssidName>
<uuid>FF31001253CED14260E7C8C0</uuid>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnp/grender-48x48.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnp/grender-120x120.png</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/upnp/grender-48x48.jpg</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/upnp/grender-120x120.jpg</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
<SCPDURL>/upnp/rendertransportSCPD.xml</SCPDURL>
<controlURL>/upnp/control/rendertransport1</controlURL>
<eventSubURL>/upnp/event/rendertransport1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/upnp/renderconnmgrSCPD.xml</SCPDURL>
<controlURL>/upnp/control/renderconnmgr1</controlURL>
<eventSubURL>/upnp/event/renderconnmgr1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
<SCPDURL>/upnp/rendercontrolSCPD.xml</SCPDURL>
<controlURL>/upnp/control/rendercontrol1</controlURL>
<eventSubURL>/upnp/event/rendercontrol1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-wiimu-com:service:PlayQueue:1</serviceType>
<serviceId>urn:wiimu-com:serviceId:PlayQueue</serviceId>
<SCPDURL>/upnp/PlayQueueSCPD.xml</SCPDURL>
<controlURL>/upnp/control/PlayQueue1</controlURL>
<eventSubURL>/upnp/event/PlayQueue1</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-wiimu-com:service:MediaManager:1</serviceType>
<serviceId>urn:wiimu-com:serviceId:MediaManager</serviceId>
<SCPDURL>/upnp/MediaMangerSCPD.xml</SCPDURL>
<controlURL>/upnp/control/MediaManager1</controlURL>
<eventSubURL>/upnp/event/MediaManager1</eventSubURL>
</service>
</serviceList>
</device>
</root>

@VergilGao VergilGao reopened this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant