LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-05-2009, 11:30 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
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


# lsmod | grep snd
Code:
snd_usb_audio          72008  1 
snd_pcm_oss            32232  0 
snd_mixer_oss          12368  1 snd_pcm_oss
snd_pcm                62364  2 snd_usb_audio,snd_pcm_oss
snd_page_alloc          8180  1 snd_pcm
snd_usb_lib            13508  1 snd_usb_audio
snd_hwdep               6104  1 snd_usb_audio
snd_seq_midi            5688  0 
snd_rawmidi            18580  2 snd_usb_lib,snd_seq_midi
snd_seq_midi_event      6212  1 snd_seq_midi
snd_seq                42436  2 snd_seq_midi,snd_seq_midi_event
snd_timer              17436  2 snd_pcm,snd_seq
snd_seq_device          6136  3 snd_seq_midi,snd_rawmidi,snd_seq
snd                    49040  11 snd_usb_audio,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_hwdep,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore               6184  1 snd
usbcore               125872  6 snd_usb_audio,snd_usb_lib,usbhid,ehci_hcd,ohci_hcd
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:

# /etc/modprobe.d/alsa_local
options snd‐foo dma1=0 ctlport=0x530

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.
 
Old 12-06-2009, 04:38 AM   #2
jim_p
Member
 
Registered: Aug 2009
Distribution: Debian testing
Posts: 564

Rep: Reputation: 131Reputation: 131
Go to alsamixer > F6 > select the other card > "alsactl store" as root.
 
Old 12-06-2009, 05:19 AM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by jim_p View Post
Go to alsamixer > F6 > select the other card > "alsactl store" as root.
I am sorry but it didnt work. I am running Debian stable lenny. F6 gives no results.

I have
Code:
$ alsamixer --version
alsamixer: invalid option -- -
AlsaMixer v1.0.16
Code:
2.6.30-1-686 #1 SMP Sun Jun 14 16:11:32 UTC 2009 i686 GNU/Linux
I have to remain with stable.

Last edited by frenchn00b; 12-06-2009 at 05:34 AM.
 
Old 12-06-2009, 12:07 PM   #4
dchost
LQ Newbie
 
Registered: Oct 2009
Posts: 18

Rep: Reputation: 2
asoundconf set-default-card "the_card"
 
Old 12-06-2009, 02:28 PM   #5
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by dchost View Post
asoundconf set-default-card "the_card"
wow sounds very interesting.

Code:
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
problem shall I do?

Code:
asoundconf set-default-card "USB-Audio - PnP Audio Device"
 
Old 12-06-2009, 02:33 PM   #6
dchost
LQ Newbie
 
Registered: Oct 2009
Posts: 18

Rep: Reputation: 2
asoundconf list
 
Old 12-07-2009, 03:12 AM   #7
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
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
 
Old 12-08-2009, 10:22 AM   #8
dchost
LQ Newbie
 
Registered: Oct 2009
Posts: 18

Rep: Reputation: 2
i think that asoundconf is in lenny (with alsa-utils) ...

Last edited by dchost; 12-08-2009 at 11:02 AM.
 
Old 12-10-2009, 01:30 PM   #9
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by dchost View Post
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
 
Old 12-10-2009, 05:15 PM   #10
dchost
LQ Newbie
 
Registered: Oct 2009
Posts: 18

Rep: Reputation: 2
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
 
Old 12-11-2009, 12:16 PM   #11
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by dchost View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound card conflict with Vid-Capture card ALSA Optimistic Debian 5 11-05-2007 11:20 PM
USB sound card not detected by ALSA but is by lsusb, using alsa 1.0.15 mjkelly93 Linux - Hardware 1 10-20-2007 10:23 AM
Alsa is only able to use one card kummiliim Slackware 20 04-03-2007 11:30 PM
card 0:intel8x0m card 1: intel8x0, alsa mixer cannot locate them T.T Fortuner Slackware 3 06-06-2006 01:39 AM
ALSA Doesn't like my card arew264 Linux - Software 2 01-15-2006 11:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration