home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.11k stars 29.16k forks source link

dlna server cannot play flac and dsf audio files #67690

Closed werfpsa closed 2 years ago

werfpsa commented 2 years ago

The problem

The new DLNA server only plays mp3 music files. The standard DLNA formats flac and dsf (SACD DSD) are not supported.

What version of Home Assistant Core has the issue?

2022.3.1

What was the last working version of Home Assistant Core?

new function in 2022.3

What type of installation are you running?

Home Assistant Core

Integration causing the issue

DLNA digital media server

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

dlna_dms documentation dlna_dms source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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

chishm commented 2 years ago

Thank you for the bug report. To understand this a bit better, I'll need a little more information:

  1. What media_player device are you trying to play to?
  2. Does your media player support FLAC and DSF natively?
  3. What DMS software are you running?
  4. Does your DMS do transcoding for clients that don't natively support a format?
  5. When you say it only plays mp3, do you mean that only mp3 files are visible, or that other file types are visible but don't begin playback?
werfpsa commented 2 years ago
  1. A Denon heos player. Denon Ceol capable to play flac (up to 192khz) and dsd files.
  2. Yes.
  3. Synology Media Server (DLNA).
  4. I do not use transcoding as I only have media players with flac and dsd capabilities.
  5. Only mp3 are visible. The other file types do not show the songs.
  6. regards, Pedro

werfpsa commented 2 years ago

image

chishm commented 2 years ago

Ok, assuming you're connecting to the Denon player using the dlna_dmr integration, then can you please enable the following logging configuration to gather more information:

logger:
  default: warning
  logs:
    homeassistant.components.dlna_dmr: debug
    homeassistant.components.dlna_dms: debug
    async_upnp_client.profiles.profile: debug
    async_upnp_client.profiles.dlna: debug

If you don't want to post the entire logs, the messages I'm specifically looking for will contain the phrases Get content filter for and browse_direct_children ->. The first one tells me what the receiver is using to filter results, and the second tells me what the results are.

werfpsa commented 2 years ago

home-assistant.log Attached

chishm commented 2 years ago

It looks like the FLAC files are not displaying because the Denon player says it supports "audio/flac", but the Synology declares the file's MIME type as "audio/x-flac". MDN says the x-flac type is non-standard, but perhaps the dlna_dmr integration can be a little smarter for filtering MIME types.

I haven't figured out what type is SACD / DSF yet. Here's the full list that the Denon player says it supports: audio/mpeg, audio/vnd.dlna.adts, audio/x-ms-wma, audio/x-ms-wma, audio/L16;rate=48000;channels=2, audio/L16;rate=48000;channels=1, audio/L16;rate=44100;channels=2, audio/L16;rate=44100;channels=1, audio/wav, audio/mp3, audio/flac, audio/aac, audio/m4a

werfpsa commented 2 years ago

home-assistant_dsf.log Attached trying to open a folder with dsf files.

werfpsa commented 2 years ago

To make it more complex.... There are 2 types of DSD formats in DLNA:

  1. native DSD files (DSF with meta data and DFF without meta data). There is DSD64, DSD128 and DSD256. These are all formats for audio freaks like me..... DSD is one bit studio quality music (bitrate DSD64 = 64x of CD).
  2. DOP = DSD over PCM (this is DSDS encoded into the PCM format)
chishm commented 2 years ago

Interestingly, the media server says the MIME type of the DSF files is "audio/x-dsf", but the player doesn't have it in its supported list. There might be some transcoding going on for it to work when you're using a DLNA control point other than Home Assistant (i.e., a proper DLNA Digital Media Controller). What controller do you use to get it to work normally?

werfpsa commented 2 years ago

I use the Denon Heos app to select and play audio on the Denon devices.

werfpsa commented 2 years ago

https://support.denon.com/app/answers/detail/a_id/2412/~/dlna-and-how-its-used-with-heos

chishm commented 2 years ago

Ok, I'm not familiar with that app, but I'm going to guess it acts as a proper media controller (DMC). That means negotiating protocols between the server and renderer as needed. Home Assistant (currently) doesn't do that, and that's probably why DSF isn't working.

werfpsa commented 2 years ago

I used to have PlugPlayer app on my iphone where you could select out of all DLNA servers in the network and link to all the DLNA players in the network. This app is not supported anymore and I hoped that I could do this with Home assistant... (maybe in the future)....

etxttul commented 2 years ago

Hi, I have the same issue with Audiocast M5 (linkplay). I can cast my FLAC file with the audiocast app to the devices, but when looking at them through home assistant I can see the structure of my libraries but with for example the text "20 incompatible items hidden" MP3 pops up as it should, but my whole CD and SACD collection is ripped as FLAC.

etxttul commented 2 years ago

Hi, might add that I can cast my FLAC files from my (windows media) server to my Audio cast M5 (linkplay) with bubbleUPnP app.