Re: Permanent audio device with snd-usb-audio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le Sat, 19 May 2012 06:25:26 +0200,
Dieter Knopf <dieterknopf@xxxxxxxxxxxxxx> a écrit :

> Hello,
> 
> i'm searching for a way to create a permanent audio device with the
> snd-usb-audio and a USB microphone.

If you have only one USB sound device, to modify the alsa configuration
in /etc/modprobe.d should be enough. It is some examples of multi sound
card configuration on the alsa wiki.

If you have more than one USB sound device, you should modify the alsa
configuration and write some custom udev rules in /etc/udev/rules.d.
lsusb It is zdev that will assign permanent device nodes (or
permanent symlinks to the real device nodes).

> 
> The device should be already there and working and after plugging in
> the USB device it should be avaialble through that device.
> 
> Example: /dev/pcm is already there and i can stream from it and after
> i plugged in the USB device this should be available through that
> device. After unplugging it it should be still there. Like a mixer.

Short answer: you can't.

Long answer: if a device node is already in /dev, you will have to
write some custom script that will unload alsa, remove /dev/pcm,
recreate it for the USB device, modify the alsa configuration and
reload alsa when the usb device is plugged in. Of course, that script
should be launched by some udev rule.

Another udev rule and another script will do the same work for the
other sound card when the usb device is plugged out.

I never experimented with udev that way (I mean with external script to
create the device nodes), and I don't know if or how it is possible.

Another solution would be to write a correct alsa sound for 2 or more
sound cards and make a ~/.asoundrc to make a virtual sound card with
the output of the 2 cards. But I don't know if it will work if you
start alsa and plug in the USB card later.

The last solution I can see is with JACK and alsa_out. From 'man
alsa_out':
A JACK client that opens a specified audio interface (different to the
one  used by  the JACK server, if any) and moves audio data between its
JACK ports and the interface. alsa_in will provide data from the
interface  (potentially  for  capture); alsa_out will deliver data to
it (for playback).

Ciao,
Dominique
> 
> Thanks
> 
> Dieter
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond.
> Discussions will include endpoint security, mobile security and the
> latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________ Alsa-user mailing list
> Alsa-user@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/alsa-user


-- 
"We have the heroes we deserve."

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux