All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jelle de Jong <jelledejong@powercraft.nl>
To: alsa-devel@alsa-project.org
Subject: how to configure .asoundrc to make arecord use a default device
Date: Wed, 29 Jul 2009 14:46:54 +0200	[thread overview]
Message-ID: <4A7044BE.5040509@powercraft.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

Hello everybody,

I am having some issues making arecord use the default device for 
recording. Could somebody help me get a working .asoundrc configuration?

I attached all information in the attachment and also made temporary 
hyperlink: http://debian.pastebin.com/m52601230

It works with:
arecord -v -f S16_LE -r 44100 -D audiodevice0 ~/record0.wav
but it does not work with:
arecord -v -f S16_LE -r 44100 ~/record0.wav

background:
http://mailman.alsa-project.org/pipermail/alsa-devel/2008-November/012366.html

Thanks in advance,

Best regards,

Jelle de Jong

[-- Attachment #2: udev-alsa-setup-debug.txt --]
[-- Type: text/plain, Size: 3595 bytes --]

------------------------------------------------------------------------

# ls -hal /dev/snd/
total 0
drwxr-xr-x  2 root root       320 2009-07-29 10:21 .
drwxr-xr-x 14 root root      4.9K 2009-07-29 12:26 ..
crw-rw----  1 root user0 116,   0 2009-07-29 10:21 controlC0
crw-rw----  1 root user1 116,  32 2009-07-29 10:21 controlC1
crw-rw----  1 root user2 116,  64 2009-07-29 10:21 controlC2
crw-rw----  1 root user3 116,  96 2009-07-29 10:21 controlC3
crw-rw----  1 root user0 116,  24 2009-07-29 10:21 pcmC0D0c
crw-rw----  1 root user0 116,  16 2009-07-29 11:26 pcmC0D0p
crw-rw----  1 root user1 116,  56 2009-07-29 10:21 pcmC1D0c
crw-rw----  1 root user1 116,  48 2009-07-29 10:40 pcmC1D0p
crw-rw----  1 root user2 116,  88 2009-07-29 10:21 pcmC2D0c
crw-rw----  1 root user2 116,  80 2009-07-29 12:26 pcmC2D0p
crw-rw----  1 root user3 116, 120 2009-07-29 10:21 pcmC3D0c
crw-rw----  1 root user3 116, 112 2009-07-29 10:37 pcmC3D0p
crw-rw----  1 root audio 116,   1 2009-07-29 10:21 seq
crw-rw----  1 root audio 116,  33 2009-07-29 10:21 timer

------------------------------------------------------------------------

# cat /proc/asound/cards
 0 [audiodevice0   ]: USB-Audio - C-Media USB Audio Device
                      C-Media USB Audio Device    at usb-0000:00:13.0-1, full speed
 1 [audiodevice1   ]: USB-Audio - C-Media USB Audio Device
                      C-Media USB Audio Device    at usb-0000:00:13.0-2, full speed
 2 [audiodevice2   ]: USB-Audio - C-Media USB Audio Device
                      C-Media USB Audio Device    at usb-0000:00:13.3-1, full speed
 3 [audiodevice3   ]: USB-Audio - C-Media USB Audio Device
                      C-Media USB Audio Device    at usb-0000:00:13.3-2, full speed

------------------------------------------------------------------------

# cat /home/user0/.asoundrc
pcm.!default {
   type plug
   slave.pcm dmixer
}
pcm.dmixer {
   type dmix
   ipc_key 2048
   slave.pcm hw:audiodevice0
}
ctl.dmixer {
   type hw
   card audiodevice0
}
pcm.dsp {
    type plug
    slave.pcm dmixer
}
ctl.mixer {
    type hw
    card audiodevice0
}

------------------------------------------------------------------------

su user0

# This is the issue. how can I configure the asoundrc so that arecord
# uses audiodevice0 by default like speaker-test already does for playing.

$ arecord -v -f S16_LE -r 44100 ~/record1.wav
ALSA lib pcm_dmix.c:947:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
arecord: main:608: audio open error: Invalid argument

$ arecord -v -f S16_LE -r 44100 -D hw:audiodevice0 ~/record0.wav
Recording WAVE '/home/user0/record0.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Hardware PCM card 0 'C-Media USB Audio Device   ' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 22050
  period_size  : 5513
  period_time  : 125011
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 5513
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 6206523236469964800
  appl_ptr     : 0
  hw_ptr       : 0
^CAborted by signal Interrupt...

$ ls -hal ~/record*.wav
-rw-r----- 1 user0 user0 1.8M 2009-07-29 12:56 /home/user0/record0.wa

------------------------------------------------------------------------

su -c "speaker-test -c 2 & speaker-test -c 2 &" user0

------------------------------------------------------------------------

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2009-07-29 12:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29 12:46 Jelle de Jong [this message]
2009-07-29 15:28 ` how to configure .asoundrc to make arecord use a default device stan
2009-07-29 17:14   ` Jelle de Jong
2009-07-29 17:51     ` stan
2009-07-29 18:29       ` Jelle de Jong
2009-07-29 18:52         ` stan
2009-07-29 19:39           ` Jelle de Jong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A7044BE.5040509@powercraft.nl \
    --to=jelledejong@powercraft.nl \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.