svn commit: r222826 - head/sys/dev/sound/pcm
skipford9 at gmail.com
Wed Jun 8 00:10:25 UTC 2011
On Tue, Jun 07, 2011 at 08:47:32PM +0300, Alexander Motin wrote:
> Hans Petter Selasky wrote:
> > On Tuesday 07 June 2011 19:01:52 Alexander Motin wrote:
> >> Author: mav
> >> Date: Tue Jun 7 17:01:52 2011
> >> New Revision: 222826
> >> URL: http://svn.freebsd.org/changeset/base/222826
> >> Log:
> >> Make automatic hw.snd.default_unit choice a bit more intelligent. Instead
> >> of just setting it to the first registered device, reevaluate it for each
> >> device registered, trying to choose best candidate, unless one was
> >> forced. For now use such preference order: play&rec, play, rec.
> >> As side effect, this should workaround the situation when HDMI audio
> >> output of the video card, usually not connected to anything, becomes
> >> default, that requires manual user intervention to make sound working. If
> >> at some point this won't be enough, we can try to fetch some additional
> >> priority flags from the device driver.
> > Idea: I would be cool if some GTK mixer apps can set this value.
> Definitely. This patch only tries to set more or less reasonable initial
> default, which later may need to be tuned. I am personally using two
> different playback devices depending on situation: digital (SPDIF) pcm1
> at home and analog pcm0 when out. Now I am switching it via sysctl, but
> obviously it is not the "right way".
I switch back and forth between a soundcard and wireless headphones, and
have always felt that the sysctl is misnamed. It really acts as a
combination of default_unit and current_unit.
If I set the default_unit to my wireless headphones, then unplug the usb
dongle, the kernel changes my default_unit setting since my preferred
device disappears. The kernel changing my default setting is contrary
to what I'd expect.
It would seem more natural if the kernel maintained its own
currently_active_unit variable and just used default_unit as a hint for
when to switch back and forth. Just feels like it shouldn't overwrite,
and lose, a setting that I've specified.
More information about the svn-src-head