This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

hdmi audio consuming too much data

I'm trying to get an audio application working where I'm taking audio data at 32bit, 48000Hz from MCASP0 and reconfiguring it for 16bit, 48000Hz and sending it to the HDMI audio output.  It would seem that the HDMI audio output is consuming twice as much data as it should.  The buffer for the 16 bit data should be half the size of the 32bit buffer, but I get underruns reported on the HDMI audio output if I send that amount of data.  I have to double the amount of data I send to the HDMI audio output so that I don't get underruns.  Of course if I do that then the audio sounds garbled.

I've been searching through the linux code and I've noticed that the dma data_type for the HDMI audio output is always set to 4.  But a data_type of 4 seems to indicate 32 bit audio samples whereas the HDMI audio output is set to 16 bit audio samples (a data_type of 2?).  I realize that the audio fifo always consumes 32 bits at a time and for 16 bit audio samples each 32 bit from the fifo gives 2 audio samples.

Is there a solution for this?

I also have been testing with the ALSA example program pcm which outputs a 440Hz audio signal.  When I tell the pcm program to output on the HDMI audio output I can hear the 440Hz audio signal, but it sounds garbled.  It's very similar to the garbling I hear from my application I mentioned in the first paragraph.  The pcm program sounds perfectly fine when I output the audio to MCASP2.

Any help would be appreciated.