How to switch my alsa card 0 and alsa card 1 in ALSA?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to switch my alsa card 0 and alsa card 1 in ALSA?
# aplay /usr/share/sounds/pop.wav
Code:
ALSA lib pcm_dmix.c:996:(snd_pcm_dmix_open) unable to open slave
aplay: main:564: audio open error: No such file or directory
Quote:
cat /proc/asound/cards
0 [default ]: USB-Audio - AK5370
AKM AK5370 at usb-0000:00:02.1-1, full speed
1 [default_1 ]: USB-Audio - PnP Audio Device
PnP Audio Device at usb-0000:00:02.1-4, full speed
$ arecord -L
Code:
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=default_1
PnP Audio Device , USB Audio
Default Audio Device
front:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
Front speakers
surround40:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=default_1,DEV=0
PnP Audio Device , USB Audio
IEC958 (S/PDIF) Digital Audio Output
I would like to exchange the usb microphone to the sound card.
USB microphone would be second place, since it is a mic only.
first main sound would come from usb sound card system.
then would get sounds
Quote:
ALSA has a special built‐in module autoloading system. You do
not have to make use of it, and it is useless if your /dev direc‐
tory is managed by udev, but in case you do want to use it, here
is a brief explanation of how it is supposed to work.
When the "snd" module is loaded and the user tries to open a
sound device file with a minor number that indicates that card
number N is wanted, snd modprobes "snd‐card‐N". Thus, if you set
up module loader configuration file /etc/modprobe.d/sound to look
like this:
alias snd‐card‐0 snd‐cs46xx
options snd‐cs46xx index=0
then snd‐cs46xx will be automagically loaded when it is needed to
handle the attempted open() of the sound device. The "index=0"
option ensures that when snd‐cs46xx is loaded the first card that
it registers is given index 0.
If you have an additional sound card of the same type then make
the file look like this:
alias snd‐card‐0 snd‐cs46xx
alias snd‐card‐1 snd‐cs46xx
options snd‐cs46xx index=0,1
If you have, instead, an additional sound card of a different
type then make the file look like this:
alias snd‐card‐0 snd‐cs46xx
options snd‐cs46xx index=0
alias snd‐card‐1 snd‐emu10k1
options snd‐emu10k1 index=1
ALSA supports up to eight sound cards.
The alsaconf program, available in the alsa‐utils package (in De‐
bian but not in Ubuntu), performs hardware detection and can
write out a module loader configuration file that looks like the
above.
Unfortunately, alsaconf can only detect one sound card and is
generally a poorly written program.
The module loader configuration files just described are addi‐
tional to /etc/modprobe.d/alsa‐base which is shipped as conffile
with the alsa‐base package. The files contain basic configura‐
tion entries which don’t normally need to be customized. The en‐
tries may include:
* ALSA autoloader aliases * an entry for each normal sound card
driver that will cause a command
to be executed after the driver has initialized * an entry for
each abnormal driver (i.e., a driver that drives
hardware such as a TV card or modem that is not suited to be
the
primary sound card) preventing it from grabbing index 0
Suppose you decide that you need to load a certain driver, snd‐
foo, with options: "dma1=0 ctlport=0x530". The recommended way
to set this up is to create additional files in /etc/modprobe.d/
each containing an "options" line:
creating device files ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ALSA native device
files are located in /dev/snd/. (ALSA’s kernel‐ OSS‐emulation
device files are of course the same as the OSS device files.)
Udev takes care of creating devices files when modules are load‐
ed.
reloading modules across APM suspend‐a
Last edited by frenchn00b; 12-06-2009 at 12:00 AM.
Ok, now, I have hand on the box (sorry for the trying delay). So let's give the try of asoundconf.:
Code:
# asoundconf set-default-card "USB-Audio - PnP Audio Device"
bash: asoundconf: command not found
Code:
# asoundconf list
bash: asoundconf: command not found
2.6.30-1-686 #1 SMP Sun Jun 14 16:11:32 UTC 2009 i686 GNU/Linux
my alsa is now:
Code:
alsa-utils_1.0.21-1_i386.deb
ls *.deb
alsa-utils_1.0.21-1_i386.deb libasound2_1.0.21a-1_i386.deb
there is nothing better than this alsa version. But still it seems that this new alsa version is still complicated for humans, a simple switch between 2 sound cards
i think that asoundconf is in lenny (with alsa-utils) ...
alsa-utils installed
squeeze testing seems no asoundconf
but as you see, the above solutions I gave was difficult for a regular n00b, and seems that no one really knows all about alsa. I guess a console installer or adds-on options into alsamixer would be welcome for new linux incomers
i had the same problem, and i remove alsa-utils, add lenny to source list and install alsa-utils from lenny to be able to use asoundconf
well, I did opposite I have a testing and a lenny.
On the lenny, I installed the alsa of the testing, so brand new and better cuz upgrading.
I guess you should try to play around with that how-to I put above. that conf. file is the key to swap those cards.
No one knows about its existance, and its difficult to code. Forget for people having ubuntu and a mic. That's bad for them, they'll end up with a linux with no sound. Then, they'll get back to windows, cuz hardware malfunction. It's just that alsa does not deal much about making Linux human.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.