Skip to contentSkip to conversation

codec audio Cirrus CS42L51 - Audio capture problems

DISCUSSION Liam Girdwood 1 participant 1 message Oct 10, 2007 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 16 lines · Pierre Savary

I am currently writing a driver for the CS42L51 audio codec to work with at91sam9260, using I2C and I2S. I used the couple of files { /sound/soc/at91/eti_b1_wm8731.c , /sound/soc/codecs/wm8731.c } as a model. I succeeded in playing sounds using the codec (WAV or MP3), via /dev/dsp.

Unfortunately, I encounter problems implementing the opposite, i.e. recording sounds. For example, when I launch the command "cat /dev/dsp > foo.wav", or the command "wavrec foo.wav", I get "read error: Input/output error".

I have observed the clock signals and the RD signal (data sent from the codec), and when I launch the command, these signals seem correct (data is provided by the codec on RD pin and all signals are correctly synchronized together).

Quoted 9 lines

I didn't modify the driver dedicated to the configuration of at91sam9260 registers (at91-i2s.c) and it seems to me it should work in both ways (playback and record). I notably checked that the RFMR and RCMR registers of at91sam9260 were well configured.

Do someone has an idea on where the error could come from ? I must precise that, as I don't work with a kernel debugger, I didn't localize where the error occurs.

Can you try "arecord -f cd -Dhw:0,0 > file.wav" as this will rule out any OSS emulation or PCM plugin issues (this command will read directly from your hardware).

Fwiw, this error is usually seen in capture when the upper alsa layers don't receive any data from your hardware. This could mean your DMA or your I2S port is not configured correctly.

Liam