HiFiBerry DIGI+ I/O problems with Raspberry OS, kernel 5.4

As part of an audio project I want to record digital audio (spdif via toslink) on an R-Pi 4B and am exploring options for an interface with digital toslink input. I have gotten everything working with a miniDSP USBStreamer, however, at half the price I thought I would also try HiFiBery's digi+ I/O board. Unfortunately it doesn't seem to function (at all). Communication with Danial at HiFiBerry has not resulted in a solution (he is not sure why it does not work properly). Details below.

I can attach the digi+ I/O HAT and set it up in the OS so that it is recognized properly. I can probe the hw-params using arecord. To try and record audio, I connected a CD player's toslink output (the same one I successfully used with the miniDSP unit) and attempted to use arecord like this:
arecord -D hw:CARD=USBStreamer,DEV=0 -c 2 -f S16_LE -r 44100 ~/test.wav
The command executes and then after about 10 seconds or so it self-terminates with a message about an I/O problem. A file called test.wav appears but it in only 44 Bytes in size (probably only contains the header). During this 10 seconds, I can look at the file
/proc/asound/USBStreamer/pcm0c/sub0/status
The status file shows the PID using the card, as well as info about the memory pointers involved in reading the data from the soundcard and creating the file. The pointers all remain at zero, and all other values stay the same. Also, looking at running processes via top the arecord process does not appear. This tells me that the process is halted or asleep, or blocked.

In fact, on the HiFiBerry web site there is a note that for kernels 5.4 and above they are having some issues:
Configuring Linux 4.x or higher | HiFiBerry
Scroll down about halfway in the note to get to the relevant section. I followed the advice given there but have not been able to prevent the blocking behavior.

I also used a toslink to coax spdif converter and tried to feed the digital output from the CD player into the coax input on the HAT, but the behavior was unchanged.

Has anyone gotten this card to work with a recent kernel like 5.4 or higher? Any ideas on what to check, or modify that might fix the problem?
 
miniDSP USBStreamer: cost approx $100.
HiFiBerry Digi+ I/O HAT: cost approx $50.

I already owned the USBStreamer, so I gave it a try first. After doing some "customization" of the ALSA state file, it works great. But a HAT that could do the same thing at half the price sounded intriguing, so I bought the Digi+ I/O to try it out. No bueno.

I've decided to return the HAT and stick with the USBStreamer for now.
 
I meant in your arecord command. It looks like you're trying to record from the USBStreamer card when it should be the digi+ one.

OK, was typing fast. Sure, just replace USBSteramer with the long string for the digi+. From memory, it's something like sndrpihifiberry-digi or the like. That machine is on an isolated network so I can't post from there.

@soundcheck: I also tested the HAT on a Pi 3B+ running kernel 4.19, an older version of Raspberian from last fall I think, and it still didn't work. I believe HiFiBerry is trying to come up with a firmware update tool for its boards (there is a blog post on the web site to that effect) but there is no ETA. I was able to use a DAC+ADC board from them just fine on the Pi 4B and latest OS release, so it seems to be dependent on which HiFiBerry product is being used.
 
Last edited: