Page MenuHomeFreeBSD

sound: add hw.snd.default.*
AcceptedPublic

Authored by fuz on Sat, Apr 18, 2:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 12, 7:43 PM
Unknown Object (File)
Tue, May 12, 1:59 AM
Unknown Object (File)
Sun, May 10, 9:23 AM
Unknown Object (File)
Sun, May 10, 9:17 AM
Unknown Object (File)
Fri, May 1, 1:15 AM
Unknown Object (File)
Fri, May 1, 1:10 AM
Unknown Object (File)
Thu, Apr 30, 12:32 PM
Unknown Object (File)
Tue, Apr 28, 9:13 AM
Subscribers

Details

Reviewers
christos
bcr
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.

bcr added a subscriber: bcr.

OK for the man page part of the change.

This revision is now accepted and ready to land.Sun, Apr 26, 10:17 AM