.dsf support in kodi

Not relevant to me. I don’t play the sound through my TV as I have 5.1 surround speakers played from my amplifier - which is less than three years old. I wouldn’t think that the newer builds (for the same old devices) should be assuming a capability that the audio/video sinks don’t have. Within Kodi config you basically configure your passthrough capability (Dolby, DTS, etc.) but there is no option for the sample rate unless you fix it. I would have thought that the EDID information from the AVR would be used to set the capabilities?

I’m looking into this some more. Could you install Amlogic-ng build on your S905X box and see if it works as it should or not?

I’ll give it a shot…

I have had a nightmare trying to get a new sd card install of 9.2.5ng to work. Just wouldn’t seem to install with the reset button (cocktail stick) option. Eventually did a .nocompat ng update of my 9.2.5 non-ng installed on my internal storage and now won’t boot at all from internal :sob:. I re-did an sd card install and I’m getting a kernel panic. The only thing that’s booting for me is my old LibreElec sd card. I’ll have a look for older ng versions and see if they will boot. Not easy to find anything except most recent…

Edit - found the earlier release files on github!

After many attempts to get a stable version of ng to work, I eventually used the latest nightly. This installed ok, configured my NAS etc and then discovered that the nightly does not have PCM multichannel support :rage:
I’ve abandoned my efforts until I calm down and I will again look for a working version of ng stable.

The GXL devices use a different driver, therefore it doesn’t require PCM multichannel.
Just use it at default configuration.

I’m afraid that I can only play 2.0 files. Any 5.1 files result in no sound. Snip of log here:
> 2020-11-21 17:04:36.922 T:4060435328 INFO: CActiveAESink::OpenSink - initialize sink
> 2020-11-21 17:04:36.923 T:4060435328 DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=AMLMESONAUDIO,DEV=0
> 2020-11-21 17:04:36.923 T:4060435328 INFO: CAESinkALSA::Initialize - Attempting to open device “hdmi:CARD=AMLMESONAUDIO,DEV=0”
> 2020-11-21 17:04:36.928 T:4060435328 INFO: CAESinkALSA::Initialize - Opened device “hdmi:CARD=AMLMESONAUDIO,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x08”
> 2020-11-21 17:04:36.929 T:4060435328 INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
> 2020-11-21 17:04:36.929 T:4060435328 ERROR: CAESinkALSA::InitializeHW - Unable to find a suitable output format
> 2020-11-21 17:04:36.930 T:4060435328 DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:default
> 2020-11-21 17:04:36.930 T:4060435328 INFO: CAESinkALSA::Initialize - Attempting to open device “default”
> 2020-11-21 17:04:36.935 T:4060435328 INFO: CAESinkALSA::Initialize - Opened device “default”
> 2020-11-21 17:04:36.936 T:4060435328 INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
> 2020-11-21 17:04:36.937 T:4060435328 ERROR: CAESinkALSA::InitializeHW - Unable to find a suitable output format
> 2020-11-21 17:04:36.937 T:4060435328 ERROR: CActiveAESink::OpenSink - no sink was returned
> 2020-11-21 17:04:36.937 T:4068828032 ERROR: ActiveAE::InitSink - returned error

Here’s the same album track in 2.0 format:

020-11-21 17:04:16.228 T:4060435328    INFO: CActiveAESink::OpenSink - initialize sink
2020-11-21 17:04:16.228 T:4060435328   DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=AMLMESONAUDIO,DEV=0
2020-11-21 17:04:16.228 T:4060435328    INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=AMLMESONAUDIO,DEV=0"
2020-11-21 17:04:16.233 T:4060435328    INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=AMLMESONAUDIO,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x0c"
2020-11-21 17:04:16.234 T:4060435328    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2020-11-21 17:04:16.234 T:4060435328    INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S16NE
2020-11-21 17:04:16.234 T:4060435328   DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 8820, bufferSize 35280
2020-11-21 17:04:16.235 T:4060435328   DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 16384, bufferSize 32768
2020-11-21 17:04:16.236 T:4060435328   DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 186 ms
2020-11-21 17:04:16.237 T:4060435328   DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 2 Output Channel Count: 2
2020-11-21 17:04:16.237 T:4060435328   DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL, FR
2020-11-21 17:04:16.237 T:4060435328   DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL, FR (ALSA: none)
2020-11-21 17:04:16.237 T:4060435328   DEBUG: CActiveAESink::OpenSink - ALSA Initialized:
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Output Device : AML-MESONAUDIO
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Sample Rate   : 176400
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Sample Format : AE_FMT_S16NE
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Channel Count : 2
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Channel Layout: FL, FR
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Frames        : 16384
2020-11-21 17:04:16.238 T:4060435328   DEBUG:   Frame Size    : 4

Ok, the way I have it setup is:
PCM audio device.
7.1 channel (anything other than 2.0 or 7.1 will not work right)
Best match

I’ve managed to get a stable 9.2.5 to load (I think my issue was with a dodgy sd card), and tried both with the HDMI setup and now with your suggested PCM setup. 2.0 is fine at all sampling rates, but 5.1 will not playback at all. :thinking:

And on the non-ng build everything works ok on the S905X?

oh nice, there is some progress going on here, thanks guys!

short notice: tbh i dont care what happens with that .dsf, if its somehow converted or not, as long as i can at least play it :slight_smile:

Everything FLAC PCM (2.0 and 5.1) ok on the non-ng build. SACD ISO 2.0 (DSF) ok on non-ng build. SACD ISO 5.1 (DSF) not ok - buzzing noise, but this is apparently the usual issue with multichannel SACD ISO.

On the ng build, PCM 2.0 is ok at all bit rates. ISO SACD 2.0 is ok although it plays back at 192kHz instead of a more logical 176.4kHz - but it sound ok.
PCM 5.1 is not reproduced - here’s another log file clip:

2020-11-21 22:14:01.910 T:4060083072    INFO: CActiveAESink::OpenSink - initialize sink
2020-11-21 22:14:01.910 T:4060083072   DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:sysdefault:CARD=AMLMESONAUDIO
2020-11-21 22:14:01.910 T:4060083072    INFO: CAESinkALSA::Initialize - Attempting to open device "sysdefault:CARD=AMLMESONAUDIO"
2020-11-21 22:14:01.915 T:4060083072    INFO: CAESinkALSA::Initialize - Opened device "sysdefault:CARD=AMLMESONAUDIO"
2020-11-21 22:14:01.916 T:4060083072   DEBUG: CAESinkALSA::SelectALSAChannelMap - Selected ALSA map "FL FR LFE FC RL RR"
2020-11-21 22:14:01.916 T:3731600256   DEBUG: ffmpeg[DE6BB380]: [NULL] invalid channel mode: 15
2020-11-21 22:14:01.917 T:4060083072    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2020-11-21 22:14:01.917 T:4060083072   ERROR: CAESinkALSA::InitializeHW - Unable to find a suitable output format
2020-11-21 22:14:01.917 T:4060083072   DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:default
2020-11-21 22:14:01.917 T:4060083072    INFO: CAESinkALSA::Initialize - Attempting to open device "default"
2020-11-21 22:14:01.920 T:3731600256   DEBUG: ffmpeg[DE6BB380]: [NULL] sample/frame number mismatch in adjacent frames
2020-11-21 22:14:01.923 T:4060083072   DEBUG: Previous line repeats 2 times.
2020-11-21 22:14:01.923 T:4060083072    INFO: CAESinkALSA::Initialize - Opened device "default"
2020-11-21 22:14:01.924 T:4060083072   DEBUG: CAESinkALSA::SelectALSAChannelMap - Selected ALSA map "FL FR LFE FC RL RR"
2020-11-21 22:14:01.924 T:4060083072    INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2020-11-21 22:14:01.924 T:4060083072   ERROR: CAESinkALSA::InitializeHW - Unable to find a suitable output format
2020-11-21 22:14:01.924 T:4060083072   ERROR: CActiveAESink::OpenSink - no sink was returned
2020-11-21 22:14:01.925 T:4069954432   ERROR: ActiveAE::InitSink - returned error
2020-11-21 22:14:01.925 T:4069954432 WARNING: CActiveAE::StateMachine - signal: 10 from port: OutputControlPort not handled for state: 2
2020-11-21 22:14:01.925 T:4069954432 WARNING: Previous line repeats 1 times.
2020-11-21 22:14:01.925 T:4069954432 WARNING: CActiveAE::StateMachine - signal: 9 from port: OutputControlPort not handled for state: 2
2020-11-21 22:14:01.931 T:3731600256   DEBUG: ffmpeg[DE6BB380]: [NULL] sample/frame number mismatch in adjacent frames
2020-11-21 22:14:01.945 T:3731600256   DEBUG: Previous line repeats 2 times.
2020-11-21 22:14:01.945 T:3731600256   DEBUG: ffmpeg[DE6BB380]: [NULL] invalid channel mode: 12
2020-11-21 22:14:01.945 T:3731600256   DEBUG: ffmpeg[DE6BB380]: [NULL] sample/frame number mismatch in adjacent frames
2020-11-21 22:14:02.426 T:4069954432   DEBUG: Previous line repeats 5 times.
2020-11-21 22:14:02.426 T:4069954432   DEBUG: ffmpeg[F2969380]: [SWR] Using fltp internally between filters
2020-11-21 22:14:02.433 T:4069954432   DEBUG: ffmpeg[F2969380]: [SWR] Matrix coefficients:

Further update 01.15…

Fixing the output sample rate (rather than using best match) seems to make 5.1 PCM output work for me. Not ideal, as my multichannel FLAC files are at 88.2, 96, 176.4 and 192kHz depending on whether they originated from DVD-A or SACD sources.

Otherwise, it seems to be a problem whereby Kodi can’t decide an appropriate output sampling rate depending on the source and the capabilities of the sink.

I personally don’t have any HD audio stuff, so I can’t test any of this.
I think the “best” way to tell whether it’s a CE issue or not is to test on another platform, such as PC.

Yep, I think we kind of diverted from the original question posed regarding DSD (DSF/DFF) files. The answer would seem to be - yes 2.0 can be played, providing you constrain your output to a sampling rate that your playback equipment can handle. Furthermore, you can playback SACD ISO two channel music once you have the SACD filesystem handler plug-in installed. There seems to be a difference between the old and new kernels on how sampling rates (and thus audible playback) are handled.

I’ll keep digging, but I don’t really use my S905X box any more, so I will concentrate on the N2, I think.

I’ve been trying to get to the bottom of this issue and raised a query on the Kodi forum. One of the developers of the AE sound engine has replied to me confirming my suspicions. The AMLAUGESOUND driver used for PCM multichannel output on the N2/N2+ displays sample rates capability which exceed that of my AVR (and most AVRs I believe). It shows sample rates from 8kHz - 384kHz as being possible. However, my AVR (and most) will only support 32kHz - 192kHz on the HDMI and other digital inputs. It’s possible if using a USB DAC that capabilities beyond 192kHz may be available on the playback device, but should not be assumed by the HDMI interface. The playback of SACD files is caused by too high a sample rate. The maximum sensible sample rate for SACD file data converted to PCM should be 176.4kHz on the HDMI interface to the AVR. It may be ok to exceed 192kHz on specialist USB DAC interface.
See the snip from the log showing the sink capabilities:

2020-11-20 12:54:27.667 T:4042675072  NOTICE:     Device 3
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_deviceName      : surround71:CARD=AMLAUGESOUND,DEV=0
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_displayName     : AML-AUGESOUND
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_displayNameExtra: HDMI Multi Ch PCM
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_channels        : FL, FR, BL, BR, FC, LFE, SL, SR
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_sampleRates     : 8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,384000
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_dataFormats     : AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_streamTypes     : No passthrough capabilities

The standard passthrough HDMI interface is ok mostly as it doesn’t exceed 192kHz (but potential exists for issues below 32kHz):

2020-11-20 12:54:27.667 T:4042675072  NOTICE:     Device 5
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_deviceName      : hdmi:CARD=AMLAUGESOUND,DEV=0
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_displayName     : AML-AUGESOUND
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_displayNameExtra: HDMI
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_channels        : FL, FR, BL, BR, FC, LFE, SL, SR
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_sampleRates     : 8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_dataFormats     : AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_RAW
2020-11-20 12:54:27.667 T:4042675072  NOTICE:         m_streamTypes     : STREAM_TYPE_AC3,STREAM_TYPE_DTSHD,STREAM_TYPE_DTSHD_MA,STREAM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_2048,STREAM_TYPE_DTS_512,STREAM_TYPE_EAC3,STREAM_TYPE_TRUEHD

i set output configuration to “fixed” and suddently music played, so as workaround to play .dsf just set output to fixed (atm i have 2.0 channel output, dont know if other values here work too)

edit: works with 5.1 too, as long as i dont exceed the 192khz

@Joe_90 @anon26735799
Please try this build: https://test.coreelec.org/arthur/CoreELEC-Amlogic-ng.arm-9.2-devel-1606608513.tar
Let me know if it works or not.

1 Like

@TheCoolest - will try the build shortly. Just waiting on TV to become available!

I know that “fixed” will do as a workaround. Just not ideal if you have lots of different sample rates in your audio files.