Raspberry Pi 4 - no sound over USB Audio S/PDIF

  • [NOT SOLVED, I just found out the problem]

    racko
    May 14, 2021 at 7:19 PM

    * * *

    Hi all!

    I just bought a Raspberry Pi 4 8GB and I installed LibreELEC 9.2.

    I configured the audio output device via USB (shown as ALSA: DigiHug USB Audio, Analog) because I use an external USB DAC. The problem is that all audio files are resampled at 48kHz, no matter they are 44.1/16, 96/24 or 192/24. "Output configuration" is set to "Best match"and "Limit sampling rate" at 192kHz (maximum sample rate supported by my DAC). I tried also with ALSA: DigiHug USB Audio, S/PDIF as audio output device, with same result, the audio files are resampled at 48kHz.

    With LibreELEC 10 Beta I don't have audio output at all over DigiHug USB Audio S/PDIF.

    On my Raspberry Pi 3B+ I don't have this problem, the audio files are sent at their original sample rate to the DAC with the same settings ("Best match" and limit sample rate 192kHz).

    I know that if I use "Best match" at output configuration and the software volume in Kodi is set 100%, the audio output should be passed unaltered, bit perfect, and this is my goal.

    Does anyone knows what is happening?

    Thank you!

    Edited 7 times, last by racko (May 20, 2021 at 5:56 PM).

  • You DAC advertises the following

    Which tells me that the Analog device only supports 48kHz. The iec958 (spdif) supports up to 96kHz. So someone is lying :)

  • You DAC advertises the following

    Which tells me that the Analog device only supports 48kHz. The iec958 (spdif) supports up to 96kHz. So someone is lying :)

    My mistake, sorry, I was a bit tired ... :sick: This is what I have:


    Both RPi3 and RPi4:

    - Output configuration - Best match

    - Limit sampling rate - 192kHz

    Outcome (I underlined the differences):

    RPi3

    1. DigiHug USB Audio Analog: everything is resampled at 48kHz. After boot, without playing anything, the DAC shows 48kHz.

    2. Digi USB Audio S/PDIF: everything OK, 44.1kHz and 96kHz are passed away without resampling. After boot, without playing anything, the DAC shows 44.1kHz).


    RPi4:

    1. DigiHug USB Audio Analog: everything is resampled at 48kHz. After boot, without playing anything, the DAC shows 48kHz.

    2. Digi USB Audio S/PDIF: no sound at all. After boot, without playing anything, the DAC shows 48kHz.

    The DAC only offers 48kHz (device 5), so it could be a driver problem.

    I bet on your RPi3B+ the DAC offers more sampling rates. Can you check this please?

    Attached are the logs of RPi3 and RPi4, both with same settings below:

    - DigiHug USB Audio S/PDIF

    - Output configuration - Best match

    - Limit sampling rate - 192kHz

    To summarize:

    - DigiHug USB Audio Analog: both RPi3 and RPi4 are resampling everything at 48kHz (probably that is how it is supposed to be)

    - DigiHug USB Audio S/PDIF: RPi3 is working as it should and the DAC is displaying 44.1kHz at boot. RPi4 has no audio output at all (not even GUI sounds) and the DAC is displaying 48kHz at boot.

    Thanks for help!

  • USB Audio Analog: The DAC only offers 48kHz on RPi3B+ and RPi4B, so the driver generally works fine.

    USB Audio S/PDIF: The DAC offers 96kHz at max. on RPi3B+ and RPi4B, so you should limit the sampling rate to 96kHz, not 192kHz.

    Make sure you have your DAC attached to a blue USB port, because that ensures max. data rate.

  • USB Audio Analog: The DAC only offers 48kHz on RPi3B+ and RPi4B, so the driver generally works fine.

    USB Audio S/PDIF: The DAC offers 96kHz at max. on RPi3B+ and RPi4B, so you should limit the sampling rate to 96kHz, not 192kHz.

    Make sure you have your DAC attached to a blue USB port, because that ensures max. data rate.

    RPi3 is working just fine with 192kHz sampling rate limit. I tried anyway with 96kHz limit on RPi4, no change.

    The problem is that I don't have sound at all (not even GUI sounds) on RPi4 through USB Audio S/PDIF, with identical settings with RPi3. So it's not about the sampling rate limit. And on RPi4 the DAC is displaying 48kHz instead of 44.1kHz right after the boot, when nothing is playing - which is not normal.

    I attached the DAC to both USB 2.0 and USB 3.0 on my RPi4, no sound. And USB 2.0 is anyway sufficient for data rate even for 192kHz/24-bit audio files. As I said, my RPi3 is working perfect up to 192/24 and it has only USB 2.0.

  • Thanks a lot, all I can do is to wait than. I hope it could be solved ... :)

    I was really excited about switching to RPi4 and the audio quality is really important to me.

  • Ok, I'll get back roght away with a new log. The previous was after boot, without playing anything.


    New log after trying to play three tracks at 44.1/16, 96/24 and 192/24:

    http://ix.io/2WTr

    Edited once, last by racko: Merged a post created by racko into this post. (April 21, 2021 at 9:38 PM).

  • Can you check if the USB firmware is up-to-date (in Settings->LibreELEC->Updates)? If it's not please update it.

    dmesg shows that the USB controller can't set up the required parameters for your USB device, kodi then falls back to the default (HDMI) audio device

    Code
    pr 21 22:28:37.569965 LibreELEC kernel: usb 1-1.2: Not enough bandwidth for new device state.
    Apr 21 22:28:37.570686 LibreELEC kernel: usb 1-1.2: Not enough bandwidth for altsetting 2
    Apr 21 22:28:37.571228 LibreELEC kernel: usb 1-1.2: 3:2: usb_set_interface failed (-28)

    I've found a couple of similar reports on the RPi forum (most of them with multiple USB audio cards though), eg Not enough bandwidth for new device state. - Raspberry Pi Forums so that could still be a compatibility issue with the RPi4's USB controller and that specific USB audio device.

    If updating the USB firmware doesn't help it's best if you test with Raspberry Pi OS (ex Raspbian) and if that fails too open a thread on the raspberrypi forum where the RPi USB dev(s) will hopefully pick it up.

    so long,

    Hias