Page MenuHomeFreeBSD

sound: add hw.snd.default.*
Needs ReviewPublic

Authored by fuz on Sat, Apr 18, 2:35 PM.
Tags
None
Referenced Files
F153323884: D56504.diff
Mon, Apr 20, 11:48 AM
F153323512: D56504.diff
Mon, Apr 20, 11:44 AM
Unknown Object (File)
Sun, Apr 19, 5:28 PM
Unknown Object (File)
Sun, Apr 19, 12:25 AM
Subscribers

Details

Reviewers
christos
Summary

These sysctls permit setting default mixer volumes for newly attached
snd(4) devices.

Test Plan

works on my machine

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72327
Build 69210: arc lint + arc unit

Event Timeline

fuz requested review of this revision.Sat, Apr 18, 2:35 PM

Note that this won't have any effect after a device driver has initialized. snd_mixerdefaults is only used in mixer_init(), so any change with these sysctls will require a driver re-load for the new defaults to take effect. I suppose this is not really an issue if these defaults are set and "forgotten" in a config file, though.

To be fair though, thinking again about our conversation on IRC, I think this approach might not be the best. The reason is that currently we have the following ways of changing/setting mixer levels:

  • mixer(8), and any other mixer application (mixertui, gtk-mixer, dsbmixer, ...), which may or may not be more complete in terms of functionality, so something like this might already be solved by some application.
  • The mixer rc script.
  • hint.pcm.%d.{mixercontrol}=%d. This actually is similar to what your patch does, but is device-specific. See mixer_init().

And this patch will introduce one more way to do level setting. I think having such a scattered way of doing just this thing is quite ugly. I'd prefer a single way to handle all this.

sys/dev/sound/pcm/mixer.c
1587

Stray newline.