I have been able to resolve the previously reported errors by setting the 
environment variable for ALSA configuration file on the target filesystem of 
the embedded platform.

ALSA_CONFIG_PATH=/usr/share/alsa/alsa.conf

However, I do not hear any audio from USB sound device with speaker-test or 
aplay:

/home/saurav # aplay -D plughw:0,0 Vincent.wav
Playing WAVE 'Vincent.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Aborted by signal Interrupt...

.....

/home/saurav # speaker-test

speaker-test 0.0.8

Playback device is plughw:0,0
Stream parameters are 48000Hz, S16_BE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 262144
Period size range from 48 to 131072
Periods = 4
Buffer time size 2525
To choose buffer_size = 262144
To choose period_size = 65536
was set period_size = 65536
was set buffer_size = 262144
 0 - Front Left
Time per period = 0.276507
 0 - Front Left
Time per period = 0.273772
 0 - Front Left

......

Upon using arecord for recording, I get an error:

/home/saurav # arecord -D plughw:0,0 -t wav file.wav
Recording WAVE 'file.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord: xrun:1077: read/write error, state = PREPARED

Is this problem related to a low-level driver issue which may not be working 
well on target platform? Could there be a DMA related issue as the samples 
don't seem to be transferred to the USB audio device.

Best Regards
Saurav

  ----- Original Message ----- 
  From: Saurav Sahu 
  To: alsa-user@lists.sourceforge.net 
  Sent: Thursday, March 06, 2008 4:28 PM
  Subject: ALSA utility aplay/arecord error


  Hello

  I am working towards using ALSA for playback and capture on an embedded 
platform running Linux. The kernel uses ALSA driver version 1.0.10rc1. I had 
manually built and installed ALSA library (v1.0.10) and ALSA utilities 
(v1.0.10) for the target platform filesystem. I have a USB audio device 
(C-Media) connected to the USB port of the board and it seems to be 
successfully successfully detected by the driver.

  ~ # ls /dev/snd -l
  crw-rw----    1 root     root     220,   0 Jan  1 00:00 controlC0
  crw-rw----    1 root     root     220,  24 Jan  1 00:00 pcmC0D0c
  crw-rw----    1 root     root     220,  16 Jan  1 00:00 pcmC0D0p
  crw-rw----    1 root     root     220,   1 Jan  1 00:00 seq
  crw-rw----    1 root     root     220,  33 Jan  1 00:00 timer


  ~ # cat /proc/asound/cards
  0 [default        ]: USB-Audio - C-Media USB Audio Device
                       C-Media USB Audio Device    at usb-asic-ehci-1.4, full 
speed

  ~ # cat /proc/asound/devices
    1:       : sequencer
   16: [0- 0]: digital audio playback
   24: [0- 0]: digital audio capture
    0: [0- 0]: ctl
   33:       : timer

  ~ # cat /proc/asound/card0/stream0
  C-Media USB Audio Device    at usb-asic-ehci-1.4, full speed : USB Audio

  Playback:
    Status: Stop
    Interface 1
      Altset 1
      Format: S16_LE
      Channels: 2
      Endpoint: 1 OUT (ADAPTIVE)
      Rates: 48000, 44100

  Capture:
    Status: Stop
    Interface 2
      Altset 1
      Format: S16_LE
      Channels: 1
      Endpoint: 2 IN (ASYNC)
      Rates: 48000, 44100


  However, when I run ALSA utilities like aplay, arecord or speaker-test, I 
observe errors opening the hardware device which may be related to the 
configuration on the filesystem.

  ~ # aplay -l
  **** List of PLAYBACK Hardware Devices ****
  ALSA lib control.c:817:(snd_ctl_open_noupdate) Invalid CTL hw:0
  aplay: device_list:230: control open (0): No such file or directory
  aplay: conf.c:3109: snd_config_update_free: Assertion `update->count > 0 && 
update->finfo' failed.
  Aborted (core dumped)
  ~ #

  /home/saurav # aplay -D plughw:0,0 winxp.wav
  ALSA lib pcm.c:2099:(snd_pcm_open_noupdate) Unknown PCM plughw:0,0
  aplay: main:544: audio open error: No such file or directory
  /home/saurav #
  /home/saurav #
  /home/saurav # speaker-test

  speaker-test 0.0.8

  Playback device is plughw:0,0
  Stream parameters are 48000Hz, S16_BE, 1 channels
  Using 16 octaves of pink noise
  ALSA lib pcm.c:2099:(snd_pcm_open_noupdate) Unknown PCM plughw:0,0
  Playback open error: -2,No such file or directory
  speaker-test: conf.c:3109: snd_config_update_free: Assertion `update->count > 
0 && update->finfo' failed.
  Aborted (core dumped)
  /home/saurav #

  Are these errors from ALSA utility/library due to the detection of hardware, 
ALSA configuration files or something else related to my target device 
filesystem?

  Thanks in advance for any help. Do let me know if you need any more details.

  Best Regards
  Saurav
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to