RPi4 + LibreELEC 10.0.1 + Hifiberry Amp2 not working together

  • I've just freshly set up a brandnew RPi4 with a Hifiberry Amp2 HAT as well as LibreELEC 10.0.1.

    The problem now is that aplay --list-device recognizes this device as card 3 but I cannot choose it via System -> Audio -> Audio Device. There I can only choose from "ALSA:bcm2835 Headphones" or "PULSE:Default".

    When trying to play an mp3 file I get the error "aplay: main:830: audio open error: No such device".

    What's going wrong?

    My /flash/config.txt contains these lines:

    Code
    dtoverlay=hifiberry-dacplus
    dtparam=audio=on
    audio_pwm_mode=1

    When switching off dtparam=audio=off the choosing option for audio device is greyed out. I already tried some things at this place but this is sort of driving me crazy.

    Any hint would be highly appreciated.

  • You're right, the HiFiBerry Amp2 uses the DAC+ driver.

    Try these config.txt options, don't use dtparam=audio or audio_pwm_mode:

    Code
    dtoverlay=hifiberry-dacplus
    force_eeprom_read=0
  • Thanks for your reply, I went ahead as instructed, but it still does not work at all. Omitting dtparam=audio=on leads to an audio output choice being greyed out. Reintroducing it shows the same behavior as above, Amp2 is not recognized by Kodi running on that machine running LibreELEC 10.0.1.

  • Install "Raspberry Pi OS" on another microSD, and use the settings of post #4. If you also get no audio there, I'm pretty sure your HAT is broken, and it's best to order a replacement / use your warranty.

  • Good news, I just created a fresh install of LibreELEC 10.0.1 on the very same SD card and did the initial bootup with repartitioning of the SD card again. Then I added these two lines at the very end of /flash/config.txt:

    Code
    dtparam=audio=on
    dtoverlay=hifiberry-dacplus

    and, tadaa, it's working again.

    I even did 3 or 4 additional reboots to see if it "forgets" about my settings and now it seems it doesn't. Just listening to Jimi Hendrix being broadcasted over internet right now.

    Edited once, last by FHoevi (November 21, 2021 at 3:32 PM).