LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 11-17-2009, 04:10 AM   #1
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Rep: Reputation: 15
Need help to configure multiple soundcards (built-in card and webcam).


Hi all,

I'm trying to add a webcam and it get's registered nicely. The problem is that after a reboot it registers as card 0, my internal card gets registered as card 1, and I lose all sound.

arecord -l without webcam:
Code:
card 0: default [PnP Audio Device        ], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
arecord -l with webcam plugged in to a running system
Code:
card 0: default [PnP Audio Device        ], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Camera [USB Video Camera], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
arecord -l with webcam after reboot
Code:
card 0: Camera [USB Video Camera], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: default [PnP Audio Device ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Notice that the cards have switched index. Registered as this I have no sound. None. So, in order to solve this I reckon I'll have to force my internal card to register as card 0.

lsusb with the card attached
Code:
Bus 002 Device 002: ID 0d8c:0201 C-Media Electronics, Inc. CM6501
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 0471:0333 Philips SPC 620NC PC Camera
Bus 001 Device 003: ID 059b:0277 Iomega Corp. 
Bus 001 Device 002: ID 059b:005d Iomega Corp. Mass Storage Device
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
C-Media is the built-in soundcard and Philips is the webcam. (I have no idea why the built-in is registered as an usb-device but it is and external sources confirm that this is correct.

According to the alsa project wiki the correct way to give two devices using the same module (such as two usb-devices) a specific index is to add something along the following in the main alsa configuration file.

Code:
options snd-usb-audio index=1,2 vid=0x0ccd,0x0d8c pid=0x0028,0x000c
As I use Debian Squeeze 64-bit with the odd package from sid and multimedia repository enabled I found that the correct file to add this in is /etc/modprobe.conf. I therefore added this:
Code:
options snd-usb-audio index=0,1 vid=0d8c,0471 pid=0201,0333
This corresponds to my hardwares' VID and PID. When I reboot I and do arecord -l I get:
Code:
arecord: device_list:223: no soundcards found...
As an alternative I tried to add this snippet to /etc/modprobe.d/sound instead but at boot I get the message that "vid 0d8c" is an invalid parameter. Well, it's not. It adds upp with the output from lsusb and the external source linked to above. Do I need to add that arecord -l tells me I have no soundcard?

Does anyone have any idea what's going on here and how I might solve this? Is there another way to force two usb-devices to register as a specific card? Should I add this option in another file?

Any and all help is very much appreciated.
best regards
/CZ
 
Old 11-17-2009, 04:30 AM   #2
skuzye
Member
 
Registered: Jul 2008
Location: São Paulo - Brazil
Distribution: Fedora 17
Posts: 97

Rep: Reputation: 15
Ok.. here we go...

I didn't understand why would you want two different cards with the same module.

I had a similar issue than you have although it was pretty simple to solve. I just followed the instructions in http://forum.vectorlinux.com/index.php?topic=4888.0.

Please, undo whatever you've done and try the instructions exactly as exposed in the site I told you then report back.

Skuzye
 
Old 11-17-2009, 04:52 AM   #3
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by skuzye View Post
Ok.. here we go...

I didn't understand why would you want two different cards with the same module.

I had a similar issue than you have although it was pretty simple to solve. I just followed the instructions in http://forum.vectorlinux.com/index.php?topic=4888.0.

Please, undo whatever you've done and try the instructions exactly as exposed in the site I told you then report back.

Skuzye
I think you're missing the point here. Both cards *use* snd-usb-audio. It is their *proper* driver. The link you posted presupposes that you have multiple cards that use *different* modules. Had that been the case your solution would have been the way to solve this but as the output of arecord clearly shows that is *not* the case here. Trying to force my built-in or the webcam to use a module that is not its proper driver is obviously not the correct way to solve this, as this module simply will not work with the hardware.

best regards
/CZ
 
Old 11-18-2009, 08:00 AM   #4
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 227

Rep: Reputation: 54
Code:
options snd-usb-audio index=1,2 vid=0x0ccd,0x0d8c pid=0x0028,0x000c   <-- the documentation example
options snd-usb-audio index=0,1 vid=0d8c,0471 pid=0201,0333           <-- your file
You forgot the 0x prefix for hexadecimal numbers.
 
1 members found this post helpful.
Old 11-18-2009, 10:52 AM   #5
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Original Poster
Rep: Reputation: 15
Problem solved!

Quote:
Originally Posted by cladisch View Post
Code:
options snd-usb-audio index=1,2 vid=0x0ccd,0x0d8c pid=0x0028,0x000c   <-- the documentation example
options snd-usb-audio index=0,1 vid=0d8c,0471 pid=0201,0333           <-- your file
You forgot the 0x prefix for hexadecimal numbers.
Aha! Yes I did. I had noticed that the format looked a bit differently but I wasn't aware that part of it was a prefix (nor is this mentioned in, for example, the alsa wiki). Now that you've pointed it out it does seem so obvious.

Many thanks for this, it works perfectly now. The built-in registers as card 0, the camera as card 1 and sound is back on! Solved my problem and I learned something to boot!

Best regards!
/CZ
 
Old 12-15-2009, 02:21 PM   #6
NeilM
Member
 
Registered: Apr 2004
Location: Alberta
Distribution: Debian
Posts: 32

Rep: Reputation: 0
Is their a step by step instructions for people that have never changed command line instructions. I dont have(see) SU editing pad.
Thanks!
 
Old 12-16-2009, 02:46 AM   #7
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by NeilM View Post
Is their a step by step instructions for people that have never changed command line instructions. I dont have(see) SU editing pad.
Thanks!
There's really no steps to it, you just enter the relevant information in a text file. Two lines, that's it. If you post the output of the commands mentioned in the first post together with some system information (distro, kernel) somebody might be able to help you out, i.e. tell you what lines in which file.

/CZ
 
Old 12-16-2009, 10:43 AM   #8
NeilM
Member
 
Registered: Apr 2004
Location: Alberta
Distribution: Debian
Posts: 32

Rep: Reputation: 0
Thanks!
I use Debian, always updating as it asks. My webcam is a Logitech 9000 pro. Works fine when I plug it in (except for skype not having activate video chat), when I reboot thiers no sound.
This is what I get, and i need to know how to change the information.
Greatly appreciated, thanks!

cat /proc/asound/modules
0 snd_intel8x0
1 snd_mpu401
 
Old 12-16-2009, 12:42 PM   #9
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by NeilM View Post
Thanks!
I use Debian, always updating as it asks. My webcam is a Logitech 9000 pro. Works fine when I plug it in (except for skype not having activate video chat), when I reboot thiers no sound.
This is what I get, and i need to know how to change the information.
Greatly appreciated, thanks!

cat /proc/asound/modules
0 snd_intel8x0
1 snd_mpu401
Ok, I meant for you to post the output of arecord with and without the webcam connected. Anyway, you are using different modules so the solution posted in post #2 in this thread will probably do it for you. So, try adding the following line in the file /etc/modprobe.d/sound with your favorite editor (If the file don't exist just create it. Also, you'll have to be root to edit this file)

Code:
options snd_mpu401 index=1
Now, I'm assuming that snd_mpu401 is your webcam and this line of code should, I think, force it to always register as device 1, leaving your built-in as device 0 (which is what it register as if it is the only connected device during boot).

Try it out and let us now if it worked or not.

regards
/CZ
 
Old 12-16-2009, 02:45 PM   #10
NeilM
Member
 
Registered: Apr 2004
Location: Alberta
Distribution: Debian
Posts: 32

Rep: Reputation: 0
This is what I have in that directory. So I would create a file "sound.conf' ?
Attached Images
File Type: png sound.png (17.0 KB, 5 views)
 
Old 12-17-2009, 02:47 AM   #11
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by NeilM View Post
This is what I have in that directory. So I would create a file "sound.conf' ?
Yes. The easiest way is to open a terminal, and switch to root using

Code:
su
Enter your root password and then use an editor, for example nano to edit/create the file

Code:
nano /etc/modprobe.d/sound
Add the line of code and exit using CTRL-x, answer yes to save changes.

Reboot and you should be good to go.
 
1 members found this post helpful.
Old 12-19-2009, 03:24 PM   #12
NeilM
Member
 
Registered: Apr 2004
Location: Alberta
Distribution: Debian
Posts: 32

Rep: Reputation: 0
Great ! thanks, will try that.
 
Old 01-01-2010, 04:54 PM   #13
NeilM
Member
 
Registered: Apr 2004
Location: Alberta
Distribution: Debian
Posts: 32

Rep: Reputation: 0
didnt work, still get no sound after boot up.
(sorry it took so long to reply)
 
Old 01-05-2010, 05:18 AM   #14
Count Zero
Member
 
Registered: Feb 2008
Distribution: Debian wheezy
Posts: 130

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by NeilM View Post
didnt work, still get no sound after boot up.
(sorry it took so long to reply)
Just to make sure you got it right, could you post the output of

Code:
cat /etc/modprobe.d/sound
EDIT:

while you're at it, post the output of

Code:
arecord -l
both with and without the webcam connected.

Last edited by Count Zero; 01-05-2010 at 08:35 AM.
 
Old 01-05-2010, 11:39 AM   #15
NeilM
Member
 
Registered: Apr 2004
Location: Alberta
Distribution: Debian
Posts: 32

Rep: Reputation: 0
I get;
cat: /etc/modprobe.d/sound: No such file or directory

**** List of CAPTURE Hardware Devices ****
card 0: nForce2 [NVidia nForce2], device 0: Intel ICH [NVidia nForce2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: nForce2 [NVidia nForce2], device 1: Intel ICH - MIC ADC [NVidia nForce2 - MIC ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0

I tried doing it again but nano asks to save the file under a diff name, when I say no it goes back to;
File name to write:
 
  


Reply

Tags
debian, soundcard, webcam


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how is sound directed to multiple soundcards? belliott4488 Fedora 1 02-16-2007 12:49 PM
2 soundcards + usb webcam microphone zefo Linux - Hardware 1 11-20-2006 04:54 AM
multiple soundcards lead to ALSA problems?? timsch75 Slackware 8 03-13-2005 12:10 PM
using multiple soundcards Quis Linux - Hardware 1 02-02-2005 04:41 AM
Configure Two soundcards, ALSA...How? Outabux Debian 0 12-15-2004 12:48 PM


All times are GMT -5. The time now is 10:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration