LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-13-2013, 12:08 PM   #1
deu
LQ Newbie
 
Registered: May 2013
Posts: 2

Rep: Reputation: Disabled
Alsa - problem with hotpluggable USB soundcard


Hello,
recently I purchased a new pluggable USB soundcard. When I first plugged it into the USB, I couldn't get it to work. Later I realized I have to set up the default soundcard in Alsa so I made an udev rule to create alsa configuration after the device is plugged in. The present pci card name is Intel and the USB card name is Dongle. The rule looks like this:
Code:
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'echo defaults.clt.card Dongle > /etc/asound.conf; echo defaults.pc.card Dongle >> /etc/asound.conf;'"
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove",
 PROGRAM="/bin/sh -c 'echo defaults.clt.card Intel > /etc/asound.conf; echo defaults.pc.card Intel >> /etc/asound.conf;'"
After restart all seemed to work ok, the configuration file got changed as expected and the playback was working. But now after another boot up I found that the playback doesn't work with the card unplugged for unknown reason. The kernel modules for both devices (snd_hda_intel, snd_usb_audio) are loaded and alsa seems to be running as $alsactl init gives:
Code:
Found hardware: "HDA-Intel" "Realtek ALC269" "HDA:10ec0269,1025022a,00100004" "0x1025" "0x022a"
Hardware is initialized using a generic method
But when I try to run alsamixer i get this:
Code:
cannot open mixer: No such file or directory
I get this error when i boot up with the card plugged in as well as with the card unplugged.
Some more information:
Code:
Sound cards:
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
	Subsystem: Acer Incorporated [ALI] Device 022a
	Flags: bus master, fast devsel, latency 0, IRQ 45
	Memory at e4500000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: [50] Power Management version 2
	Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Capabilities: [130] Root Complex Link
	Kernel driver in use: snd_hda_intel

Bus 005 Device 004: ID 040d:3400 VIA Technologies, Inc.
  iManufacturer           1 VIA Technologies Inc.
  iProduct                2 VIA USB Dongle

Uname:
Linux Thelonious 3.2.29-smp #2 SMP Mon Sep 17 13:16:43 CDT 2012 i686 Intel(R) Core(TM)2 Solo CPU    U3500  @ 1.40GHz GenuineIntel GNU/Linux

Distribution:
Slackware 14.0
Thanks for replies,
Deu

Last edited by deu; 05-13-2013 at 12:10 PM.
 
Old 05-13-2013, 05:05 PM   #2
deu
LQ Newbie
 
Registered: May 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Problem solved

Well after few hours of studying not very well documented alsa configuration I found a solution. Here is it:
For the configuration in '/etc/asound.conf' to take effect I had to comment out this lines:
Code:
#defaults.ctl.card 0
#defaults.pcm.card 0
#defaults.pcm.device 0
in '/usr/share/alsa/alsa.conf'

I changed the rules in '/etc/udev/rules.d/10-alsa.rules' to:
Code:
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'ln -sf /etc/asound.d/asound.dongle /etc/asound.conf;'"
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'ln -sf /etc/asound.d/asound.intel /etc/asound.conf;'"
so that it creates a symbolic link in '/etc/asound.conf' pointing to either '/etc/asound.d/asound.intel' or '/etc/asound.d/asound.dongle'
and in those files I put the required configuration - setting default card and creating a pcm device.
For Intel card (/etc/asound.d/asound.intel):
Code:
# Here is configuration for the Intel card
defaults.ctl.card Intel
defaults.pcm.card Intel
defaults.pcm.device Intel

pcm.!default {
   type hw
   card Intel
}
For Dongle card (/etc/asound.d/asound.dongle):
Code:
# Here is configuration for the Dongle card
defaults.ctl.card Dongle
defaults.pcm.card Dongle
defaults.pcm.device Dongle

pcm.!default {
   type hw
   card Dongle
}
I hope that this thread will at least help someone else. If there is anybody who knows of a better solution please reply.

Last edited by deu; 05-13-2013 at 05:07 PM.
 
  


Reply


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
Alsa: USB soundcard device disappears suddenly JonL Linux - General 1 08-04-2012 04:47 AM
alsa to use usb soundcard efus Linux - Hardware 2 07-09-2007 06:02 AM
Alsa / soundcard problem foodhater Debian 11 03-07-2006 03:43 PM
problem with ALSA and an audigy LS soundcaRD wlad_von_tokyo Linux - Hardware 4 11-08-2005 03:41 AM
alsa -- soundcard problem ankurkumar78 Debian 6 06-28-2005 08:25 AM


All times are GMT -5. The time now is 09:10 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