[GSoC'21 Weekly Update #4] Sound mixer improvements

Christos Margiolis christos at freebsd.org
Tue Jul 6 00:31:16 UTC 2021


Hello,

This the last week's report.

Kernel:

- Re-implemented the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE
  ioctls in `/usr/src/sys/dev/sound/pcm/mixer.c`, where all the other
  OSS mixer ioctls are implemented. These two ioctls were not part of
  the current version of OSS and were considered obsolete. HOWEVER, I
  decided to change their behavior, so this implementation is not
  backwards compatible with the old one, but that should not be a
  problem.

  Older OSS versions had the MUTE ioctls take/return an integer with 
  a value of 0 or 1, which meant that the _whole_ mixer is unmuted or 
  muted respectively.

  In my implementation, the ioctl takes/returns a bitmask that tells us
  which devices are muted. This allows us to (un)mute only the devices
  we want, instead of the whole mixer. The bitmask works the same way
  as in DEVMASK, RECMASK and RECSRC.

mixer(8):

- Added sysctl(8)-style controls for easier parsing and extensibility.
  The following formats can be used:
  
  * dev			show a device's controls and their values
  * dev.control		show a control's value
  * dev.control=value	set a control value

  The currently available controls are:

  * dev.volume		set/display volume
  * dev.recsrc		set/display recording source
  * dev.mute		set/display mute

  For example, to set the `vol` device's volume to 0.65, we can now
  do `mixer vol.volume=0.65`.

mixer(3):

- Added a new function to handle muting.

Documentation:

- Started working on the man pages for both mixer(3) and mixer(8).

The code is available on:
- GitHub: https://github.com/christosmarg/mixer
- Sourcehut: https://git.sr.ht/~crm/mixer
- My Git server: https://git.margiolis.net/mixer/files.html

The project's Wiki article can be found at: 
- https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements

--
Christos


More information about the soc-status mailing list