USB DAC Native DSD Support

  • I use LibreElec/Kodi as my multimedia hub and have several USB DACs that support native DSD decoding. On current LibreElec generic builds, DSD files are software decoded on LibreElec and sent to the DACs as PCM files. I am able to send native DSD files to my DACs on my Ubuntu linux machines by compiling the kernel with additions to ../sound/usb/quirks.c

    Current ALSA versions support bit-perfect transmission of DSD files over USB to vendor/device ID's specified in ../sound/usb/quirks.c

    Would this be possible in OpenElec?

    The following section added to ../sound/usb/quirks.c (added from RoPieee) enables native DSD support for a number of USB DACs on the market:

    Edited once, last by J.L.C. (July 23, 2018 at 4:00 AM).

    • Official Post

    is there any reason why these quirks are not already upstream and included in kernel sources? - e.g. patches being submitted and rejected by kernel maintainers?

  • Thanks!

    I tried the latest Milhouse build, but unfortunately it seems it's a little too early. Addons like MPD aren't available yet (listed but installation fails), so DACs can't be tested.

  • 1.

    As far as I understand XMOS is supported and native DSD support possible as long as the hardware is recognised by her USB ID provided in that "C" file above.


    2.

    Since my DSD Files are converted to 44.1kHz PCM, I have to asume, that my YAMAHA Amplifier is not registered in that list by his USB ID.


    Is there any easy way to provide LibreElec with the YAMAHA USB ID without the need to compile the whole distribution?

  • NSXD We support native DSD for some audio interfaces, but it's limited on HDMI (PCM down-sampled, as described by you).

    Please read those threads:

    fliz
    April 5, 2024 at 6:07 PM
    greenvorbisfan
    June 29, 2021 at 3:05 PM
  • I read the topics above but the things become fancy and offering no practicable solutions or are got even closed before somebody could explain e.g. how the ffmpeg patch mentioned in some thread could be applied.

    Lets take a look on a common setup and what millions people are doing or in our case trying to do with LibreELEC:



    As you may see there is no fancy stuff involved like Rapsberries, servers and clients etc. but just a Tablet PC as Media Center and a simple Digital to Analog Converter connected by USB to the tablet PC.

    Main goal is to get the audio files injected direct resp. native in to the Digital to Analog Converter.


    In Windows the manufacturer of such Digital to Analog Converters decided to utilize a proprietary ASIO driver made by some German company.

    Main reason for this is to circumvent the whole Windows Audio Engine by using Foobar in combination with that proprietary ASIO driver. That ensures the Windows Audio Engine have no impact on the data feeded to the DAC especially when all sorts of settings are set in Windows.

  • In short: You want to use a USB audio interface, connect it to the AVR over S/PDIF, and play native DSD.

    This setup is generally possible with LE.

    Theory: I think the problem is the proprietary ASIO driver of your USB audio interface. Because it's proprietary, not all codecs are usable by LE. That means, LE offers all codecs, including hi-res native DSD, but the incomplete Linux driver only accepts lo-res DSD.

    Suggestion a): Use a USB audio interface, which is fully supported by Linux.

    Suggestion b): Use an RPi with HiFiBerry Digi2 Pro, as mentioned at post #8.

  • In short: You want to use a USB audio interface, connect it to the AVR over S/PDIF, and play native DSD.

    No!!!

    Main purpose of that kind of equipment is to provide highest grade of analog signal possible. It is connected to an high quality analog headphone or stereo amplifier.

    The S/PDIF Out is just an addon, which may become handy sometimes.

    No one would come up with the idea to spend hundreds or even thousands of Dollars to use that kind of equipment as a simple USB to S/PDIF Converter. Meaning and purpose is a High-End Digital to Analog conversion. Nothing else.

    ...

    Theory: I think the problem is the proprietary ASIO driver of your USB audio interface.

    The proprietary ASIO driver is just a solution for Windows in order to bypass the Window's own Audio Engine which have certain advantages in combination whith Foobar.

    The proprietary ASIO isn't needed for Linux or Android and also in Windows WSAPI in exclusive Mode shall work, the say.

    ...

    I think the problem is a completely different one. That kind of Interfaces just expecting raw data in PCM or DSD (see specs above). There should be no magic to feed them by just passing the data from the files to the interface.

    With one exception...

    Since not all audio is saved are PCM or DSD Files an additional layer is needed to unpack or convert files like FLAC or MP3 etc. to PCM. ...This job I guess is already done by FFMPEG.


    That means we just need a Conrolbox "USB DAC Direct" which is passing the data

    1. from PCM/DSD Files directly to the Interface

    2. from other Formats via FFMPEG as PCM to the Interface.


    By providing an "USB DAC Direct" Mode there is no reason for LibreELEC to pass DSD Files through FFMPEG for convertion to PCM. Just let the USB Interface and its High End DAC do the job it is intended to do... namely convert PCM and DSD Data into an analog signal.


    For compatibility reasons and DSD there could be an additional Option for packaging native DSD Data from the Audiofiles into PCM Chunks for "DSD over PCM" (DoP). That kind of interfaces can play usually both or at least one of them.


    Since not all Audio Files are in PCM or DSD but compressed in Flac which

  • If you just want a good DAC, then you don't need DSD. I'm using a cheap Behringer UMC22, which provides 48kHz /16 bit PCM. It uses standard ASIO, so it works perfectly with a Linux OS, like LE.

    ASIO is more than a bypass. It's a low-latency audio solution.

    If your proprietary ASIO sounds bad, try a standard ASIO interface. LE is no low-latency OS, so you eventually lose data on transmission.

  • PS: Your logic is: Just transfer the codec from A to B. In reality things are more complex, so processes have to be scheduled etc. That's when drivers come into play. They don't just manage the codecs, but also the timing. Your proprietary ASIO driver is incomplete on Linux for a reason.

  • In short: You want to use a USB audio interface, connect it to the AVR over S/PDIF, and play native DSD.

    This setup is generally possible with LE.

    Theory: I think the problem is the proprietary ASIO driver of your USB audio interface. Because it's proprietary, not all codecs are usable by LE. That means, LE offers all codecs, including hi-res native DSD, but the incomplete Linux driver only accepts lo-res DSD.

    Suggestion a): Use a USB audio interface, which is fully supported by Linux.

    Suggestion b): Use an RPi with HiFiBerry Digi2 Pro, as mentioned at post #8.

    DSD doesn't travel over regular 44.1-48k/16bit stereo SPDIF does it? (Though higher sample rate 192k/24bit SPDIF may carry some of the lower bitrate DSD stuff via DoP?)

    DSD64 (as used by SACD) is based on 2.8824MHz 1-bit Delta Sigma sampling (so needs 2.884Mb/s connectivity - which is more than the 1.536Mb/s of 48k/16bit stereo that regular SPDIF supports?)

    DSD512 is based on 22.5792MHz delta sigma 1-bit sampling - which is nearly 15x the data rate of basic SPDIF.

    AIUI there are USB standards for both DSD native transport, and DSD-over-PCM aka DoP (where DSD audio is kept as DSD format data but presented as if it's PCM at a high sample rate like 768kHz and sent using USB PCM Audio - in a standard that compatible devices then re-package back to DSD allowing native transport of the DSD Delta Signal bitstream. This requires the DSD to DoP packaging software/drivers to be DSD DoP-aware?)

    The OP is - I think - asking if it's possible to connect a USB Native DSD DAC to LibreElec to send DSD audio from LE to a USB-connected DAC which then outputs analogue - without transcoding that audio to PCM format audio for DAC decoding. This is a widely used route with smartphones, tablets, Windows and Mac PCs.

    I don't know what the Linux support is for DSD64-512 native audio transport over USB - either as DSD Native or carried as DSD-over-PCM.

    NB I'm not making any claims for DSD audio being better or worse than PCM audio, nor am I making any claims that DSD512 is better than 48k/16bit audio - but I know for some people it's important...


    What Yamaha amplifier do you have ?

    I take it from your post that it has a USB connector that will appear to connected devices as a USB DAC for both PCM and DSD audio? If you find out the USB IDs for it that may help?

    Edited once, last by noggin: Merged a post created by noggin into this post. (June 26, 2024 at 8:37 AM).

  • noggin The user only uses S/PDIF to detect the incoming data rate. He wants to use the analogue output of the USB audio interface to connect speakers. The USB audio interface was made for musicians, so the input/output timing has to be low-latency. That requires a specific ASIO driver. That driver is incomplete on Linux, so he only gets 44.1kHz.

  • The USB audio interface was made for musicians, so the input/output timing has to be low-latency. That requires a specific ASIO driver. That driver is incomplete on Linux, so he only gets 44.1kHz.

    That information isn't up to date and that kind of devices aren't made for musicians but for high end audio reproduction (audiophile).

    There is/was a sample rate limitation setting in the hidden "Expert" Settings. When the limitation setting is set to it's maximum value of 384 kHz, High-Resolution files seem to be transported at their native sample rate. DSD Files are being converted accordingly to 384 kHz.

    What Yamaha amplifier do you have ?

    I take it from your post that it has a USB connector that will appear to connected devices as a USB DAC for both PCM and DSD audio? If you find out the USB IDs for it that may help?

    All that kind of devices no mater from which manufacturer are using the same technology/concept. There is XMOS USB controller sitting at the entrance followed by one or even two D/A converters for left and right channel separately (mostly ESS Sabre or sometimes Akashi AKM).

  • I don't know what the Linux support is for DSD64-512 native audio transport over USB - either as DSD Native or carried as DSD-over-PCM.

    There is some information on https://github.com/lintweaker/xmos-native-dsd. from 2019. It does not seem impossible and over the last 5 years there maybe further development and insights into that matter.

    I know that some apps like the Fiio Music App on Android are working flawlessly (PCM/DSD) no matter from which manufacturer the devices are made (Yamaha, Fiio, Topping, whatever). USB ID don't seems to matter. And as I said above all these devices are using XMOS USB Controller at their Input.

    Native DSD support for XMOS based devices

    XMOS based USB DACs and converters can support native DSD playback using a 32-bit sample format. DACs that support this feature expose it using a Alternate Setting on the USB interface.

    On Windows systems this feature can be used with a ASIO 2.1/2.2 driver from the DAC manufacturer.

    I have added a new DSD sample format to ALSA and the Linux kernel (DSD_U32_LE) to support it on Linux and added the needed quirks to support it for a few XMOS based USB DACs/boards.

    Currently native DSD playback on Linux is supported for the following XMOS based DACs/USB converters:

    • iFi Audio micro iDSD [max DSD512]
    • iFi Audio nano iDSD [max DSD256, with latest 4.04 firmware]
    • DIYINHK USB to I2S/DSD converter [max DSD128]
    • ..more to follow

    ALSA support status:

    • New DSD sample format accepted, code resides in ALSA development git
    • Will be generally available with the next ALSA release (1.0.29)

    Kernel support status:

    • Kernel 3.18rc1 contains the needed new sample format support
    • Kernel 3.18rc1 supports the iFi Audio and DIYINKHK devices

    Linux Playback support:


    NB I'm not making any claims for DSD audio being better or worse than PCM audio, nor am I making any claims that DSD512 is better than 48k/16bit audio - but I know for some people it's important...

    Yes. Some of these DACs are quite expensive and sophisticated in an audiophile way. And people don't want some OS or Software to fiddele with the original data. People also want their displays, indicators to work correctly.

  • That information isn't up to date and that kind of devices aren't made for musicians but for high end audio reproduction (audiophile).

    There is/was a sample rate limitation setting in the hidden "Expert" Settings. When the limitation setting is set to it's maximum value of 384 kHz, High-Resolution files seem to be transported at their native sample rate. DSD Files are being converted accordingly to 384 kHz.

    All that kind of devices no mater from which manufacturer are using the same technology/concept. There is XMOS USB controller sitting at the entrance followed by one or even two D/A converters for left and right channel separately (mostly ESS Sabre or sometimes Akashi AKM).

    Low-latency devices are used by musicians and audiophile people. The point is "low-latency", not the group of customers.

    As you can read in the second link of post #8, LE supports frequencies above 384kHz.

    Please learn the concept of an ASIO driver, and whats the challenge of writing low-latency code. Then you'll understand.