{"id":191,"date":"2010-06-15T21:31:57","date_gmt":"2010-06-16T02:31:57","guid":{"rendered":"http:\/\/www.linuxpoweruser.com\/?p=191"},"modified":"2010-06-15T21:31:57","modified_gmt":"2010-06-16T02:31:57","slug":"dealing-with-multiple-usb-sound-devices","status":"publish","type":"post","link":"https:\/\/www.linuxpoweruser.com\/?p=191","title":{"rendered":"Dealing with multiple USB sound devices"},"content":{"rendered":"<p>Ever been plagued by your linux system detecting your webcam as the first sound device instead of your USB headset?\u00a0 This is a common problem with Linux, but can be easily remedied with editing your systems module configuration.\u00a0 On Ubuntu, the important file is \/etc\/modprobe.d\/alsa-base.conf.\u00a0 This file controls the module settings and parameters for the alsa sound system.\u00a0 First, we need to understand what to put in this file.<\/p>\n<p>With both of your USB devices connected to the system, run the following command:<br \/>\n<code><br \/>\nlsusb<br \/>\n<\/code><br \/>\nHere is a sample output:<br \/>\n<code><br \/>\nBus 001 Device 008: ID 046d:09a2 Logitech, Inc. QuickCam Communicate Deluxe\/S7500<br \/>\nBus 001 Device 005: ID 03f0:2f24 Hewlett-Packard<br \/>\nBus 001 Device 007: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader\/Writer (Internal\/External)<br \/>\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br \/>\nBus 002 Device 005: ID 051d:0002 American Power Conversion Uninterruptible Power Supply<br \/>\nBus 002 Device 004: ID 10f5:0200 Turtle Beach Audio Advantage Roadie<br \/>\nBus 002 Device 003: ID f617:0905<br \/>\nBus 002 Device 002: ID 046d:c521 Logitech, Inc. MX620 Laser Cordless Mouse<br \/>\nBus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br \/>\n<\/code><br \/>\nThis output shows all the USB devices connected to your system.\u00a0 In our example, the two devices we are looking for are:<br \/>\n<code><br \/>\nBus 001 Device 008: ID 046d:09a2 Logitech, Inc. QuickCam Communicate Deluxe\/S7500<\/p>\n<p>Bus 002 Device 004: ID 10f5:0200 Turtle Beach Audio Advantage Roadie<br \/>\n<\/code><br \/>\nFrequently, on this system, the webcam steals the default input device because of its internal mic.\u00a0 I would like the default input\/output to be assigned to the turtle beach roadie USB headset.\u00a0 The key here is something that all alsa modules have support for which is an index parameter.\u00a0 All also modules allow indexes to be assigned to a particular device.\u00a0 This works pretty well when your cards use different alsa modules.\u00a0 Simply specifiying module options setting the index # for your particular devices module resolves the issue.\u00a0 So what happens with USB audio devices, since they use the same snd-usb-audio module?\u00a0 It seems that linux simply assigns indexes in the order the devices are discovered.<\/p>\n<p>The lsusb output above shows two important pieces of information for each of the sound devices in question.\u00a0 The USB VID (Vendor ID) and PID (Product ID) can be used to control index assignment.\u00a0 In our case these values are:<\/p>\n<p>046d:09a2 for the Logitech, and 10f5:0200 for the Turtle Beach headset.\u00a0 The set of hexadecimal numbers is the Vendor ID and Product ID for the device, in the format VID:PID.<\/p>\n<p>The VID:PID combination can be used in conjuction with the Index value to control the way linux sees the devices.\u00a0 The format for the module option is:<br \/>\n<code><br \/>\noptions snd-usb-audio index=&lt;x&gt;,&lt;y&gt; vid=0x&lt;vid for index x&gt;,0x&lt;vid for index y&gt; pid=0x&lt;pid for index x&gt;,0x&lt;pid for index y&gt;<br \/>\n<\/code><br \/>\nSo, with this in mind, all we have to add to the \/etc\/modprobe.d\/alsa-default.conf file is this:<br \/>\n<code><br \/>\noptions snd-usb-audio index=0,1 vid=0x10f5,0x046d pid=0x0200,0x09a2<br \/>\n<\/code><\/p>\n<p>After rebooting the system, we should never see our Webcam grab the default input again (making us have to go to the Pulse Audio settings and reconfigure the sound system).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever been plagued by your linux system detecting your webcam as the first sound device instead of your USB headset?\u00a0 This is a common problem with Linux, but can be easily remedied with editing your systems module configuration.\u00a0 On Ubuntu, the important file is \/etc\/modprobe.d\/alsa-base.conf.\u00a0 This file controls the module settings and parameters for the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,6,7],"tags":[15,26,7,70],"_links":{"self":[{"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=\/wp\/v2\/posts\/191"}],"collection":[{"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=191"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxpoweruser.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}