Handling of newly attached pcm devices (eg. via uaudio)

Alexander Leidinger Alexander at Leidinger.net
Thu Jan 31 05:19:42 PST 2008


Quoting Aragon Gouveia <aragon at phat.za.net> (from Thu, 31 Jan 2008  
14:10:05 +0200):

> Hi,
>
> On my FreeBSD workstations I frequently use a USB sound device (headphone
> amplifier).  I typically plug it in and out only when I need it, and expect
> (or hope!) for my system to use it when it's plugged in, but use the onboard
> sound when it is unplugged.
>
> On FreeBSD 7 I used to set hw.snd.default_unit to 1 (from 0) after plugging
> the device in and then set the mixer levels to how I want them.  I've
> subsequently automated this ala devd and a shell script to do precisely the
> same thing, except the shell script also calls /etc/rc.d/mixer to restore
> the saved mixer settings in /var/db.
>
> I would like to PR my work in the hope of someone committing it as I think
> it might be useful to others.  What are people's opinions of this idea,
> in particular setting hw.snd.default_unit to make a newly plugged sound
> device the default?  Can anyone think of a better way to handle newly
> attached sound hardware?

Not commenting on the fact if this handling itself is ok or not (I  
have no strong opinion about it), but it should at least be not  
activated by default. So whatever you submit as a PR should contain  
something which has a look at rc.conf (and the other config files) and  
only do something if it is explicitly activated there. It should also  
be able to not fail if the attached device is the only sound device  
(so on removal of the only sound device, it should not fall on the  
nose or spit out a lot of messages).

Bye,
Alexander.

-- 
Why do they call a fast a fast, when it goes so slow?

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-multimedia mailing list