PHAT DAC on R Pi 4b not recognized?

I have trouble getting the PHAT DAC to work under Raspbian Buster on a Raspberry Pi 4b with 4GB RAM, both in “generic” audio and from Kodi.

Apologies right up front if the following are stupid questions. I’ve tried to google for solutions including on the Pimoroni forums but not got anywhere.

Here’s the rundown:

But Kodi (18.4, installed as per https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=251645), while it listed the PHAT DAC as “hifiberry” as a potential audio output device, didn’t actually produce any sound if I switched to it. It worked fine on the Pi’s normal HDMI output.

  • I then installed the Fan Shim from Pimoroni, again following the standard script from the website.

  • Rebooting, I found that now the PHAT DAC doesn’t work even for generic audio. If I try “aplay -l” I get the output
    **** List of PLAYBACK Hardware Devices ****
    card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0
    Subdevices: 0/1
    Subdevice #0: subdevice #0

which looks different from before (where it was “subdevices 1/1”).

  • I’ve tried to reinstall the PHAT DAC as above. If I let the script run the audio test at the end, I get an error along the lines of
    “Unable to open decide: -16, device or resource busy”
    I’ve checked all the files referred to in the “Manual install” section of the PHAT DAC installation instructions and they look ok.

  • Less seriously, but in case it helps to diagnose the problem, if I try to change the Pi’s volume from the Main menu I can’t because of an error “no ALSA devices found”

The question, then, is in two parts: How can I reactive the PHAT DAC for generic audio, and how do I then make sure Kodi can also produce output through it? If there are log files I should dig out, please let me know.

Many thanks in advance.

There is a pin function conflict between the pHat DAC and the Fan Shim.
GPIO 18 Pin 12 is used by both. That has broken i2s and stopped the pHat DAC from working.
Reimaging your SD Card with a fresh Buster install, and only installing the pHat DAC should get that working again. The KODI issue is likely a Buster issue, thats my best guess anyway.

Great, many thanks for the quick reply. I hadn’t realised the Fan Shim and the PHAT DAC conflicted; it might be worth adding this to the installation web pages for one or both, or even to the product pages in the shop.

Is the pin conflict something that can be sorted in the medium term, e.g. can the temperature control software be adapted to work around it?

Before I did the software install for the Fan Shim, it seemed to be doing something but I didn’t check carefully - it may just have been on all the time. I guess I can leave it like that after the re-install, but in the long term it would be a bit inefficient.

Thanks again for the quick response.

There are just so many different hats etc its would be time consuming to list what works with what. That’s what the pinout site is for.
The pin assignment is fixed by the design, so changing the software isn’t going to help in this situation. Other than maybe not installing it,
I have a Fan Shim installed, and installed the software. However, if I stop and then disable the fan shim service that does all the magic. The fan just runs continuously, and the LED is off. My temps are around 40 c as i type this. The button still works but that’s because that function is built into the Pi and Raspbian.

disable service

sudo systemctl stop pimoroni-fanshim.service
sudo systemctl disable pimoroni-fanshim.service

enable again

sudo systemctl enable pimoroni-fanshim.service
sudo systemctl start pimoroni-fanshim.service

In your case I don’t think that will be enough. The DAC uses GPIO 18 which is the fan control. I believe the fan stops if that PIN is pulled low. Weird things might still happen.

I personally like it just running all the time. My temps stay a lot more constant with no big swings up and down. Just my personal preference. I have a Blinkt plugged in that is displaying my CPU temp, plus I have it displayed in the status bar next to the clock. You just add panel item and select CPU temperature monitor.