[alsa-devel] arecord read error, input/output error in embedded linux project

Robert Schmit robo1508 at yahoo.com
Tue Nov 11 18:21:41 CET 2008


I am working on resurrecting an embedded linux project started by someone else.  The project is using an AT91SAM9260 processor on an AT91SAM9260-EK development board and I am currently trying to get audio playback and capture working through an external W6811 codec chip.  The previous developer had the audio working both ways but unfortunately I can only get playback to work but not capture.  During a capture operation, I can verify on a scope that the proper clocks and frame syncs are being delivered to the W6811 chip and furthermore I can see data on the PCM output line of the chip (which is of course connected to an input pin on the AT91SAM9260 processor).  So I'm almost certain that the problem is not hardware.

A machine/codec driver for the W6811 chip was written by the previous developer and is known to be correct and properly included in the kernel.  The ALSA version is 1.0.14 and is compiled into a 2.6.22.1 kernel.  I am currently using the default alsa.conf file and am not using ~/.asoundrc or /etc/asound.conf.  I am testing the audio using aplay and arecord.  Specifically, arecord is failing, after 10 seconds, as follows:


/usr/bin $ arecord -traw -fS8 -r8000 ulaw2.raw
Recording raw data 'ulaw2.raw' : Signed 8 bit, Rate 8000 Hz, Mono
arecord: pcm_read:1346: read error: Input/output error


An strace of the arecord execution provides the following at the point of error.  The ioctl() call is what hangs for 10 seconds, then the error message is printed and the program immediately exits.

open("test_sample.raw", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3
ioctl(4, 0x800c4151, 0xbef15c24)        = -1 EIO (Input/output error)
write(2, "arecord", 7arecord)                  = 7
write(2, ": ", 2: )                       = 2
write(2, "pcm_read", 8pcm_read)                 = 8
write(2, ":", 1:)                        = 1
write(2, "1346", 41346)                     = 4
write(2, ": ", 2: )                       = 2
write(2, "read error: ", 12read error: )            = 12
write(2, "Input/output error", 18Input/output error)      = 18
write(2, "\n", 1
)                       = 1
exit(1)                                 = ?
Process 844 detached


Is it possible that there is an extra step towards properly configuring a capture channel/stream that would explain why playback works but capture does not??  If anybody has any ideas, I would be very grateful as I have been stuck on this for days now.  I'm not sure what information would be helpful, but I will try to describe some details of my sound configuration here.  THANKS!!

/dev/snd $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: GRHEKW6811 [GRH_EK_W6811], device 0: W6811 W6811-PCM-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


/dev/snd $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: GRHEKW6811 [GRH_EK_W6811], device 0: W6811 W6811-PCM-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


/dev/snd $ ls -l
crw-rw-rw-    1 root     root     116,   0 Dec 31 17:27 controlC0
crw-rw-rw-    1 root     root     116,  24 Dec 31 17:29 pcmC0D0c
crw-rw-rw-    1 root     root     116,  16 Dec 31 17:27 pcmC0D0p
crw-rw-rw-    1 root     root     116,  33 Dec 31 17:51 timer


/proc/asound $ ls
GRHEKW6811  cards       pcm         version
card0       devices     timers


/proc/asound $ cat devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 24: [ 0- 0]: digital audio capture
 33:        : timer


/proc/asound $ cat pcm
00-00: W6811 W6811-PCM-0 :  : playback 1 : capture 1


/proc/asound $ cat cards
 0 [GRHEKW6811     ]: W6811 - GRH_EK_W6811
                      GRH_EK_W6811 (W6811)


/proc/asound $ cat timers 
G0: system timer : 10000.000us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE
P0-0-1: PCM capture 0-0-1 : SLAVE


      


More information about the Alsa-devel mailing list