What is required for the volume sublet?

Added by Christoph Kappel over 5 years ago. Updated by Christoph Kappel over 5 years ago.

Category: Sublets Difficulty: Difficulty5
Assignee: - Due date:
Related issue: - Related Message: -
Related version: - Views: 4683
Valid: Valid


The volume sublet uses /dev/mixer to set/get the volume levels, which is an older interface introduced with OSS and still available via ALSA OSS emulation. Apparently, newer kernels refuse to autoload that module anymore and you need to load it manually or via any init file.

Please check to the docs of your distribution how to do it.

modprobe snd_mixer_oss

Following explanation is technical!

The sublet needs a way to access a mixer without any asynchronous callbacks. The reason for that is that subtle is single-threaded and can't use a dedicated thread to wait for the reply, but the APIs of ALSA and PulseAudio are both designed to be asynchronous. Normally event drivven is fine but it is troublesome when you can't use their mainloop.

Since there is no way to add e.g. a control socket to the event main loop of subtle, the /dev/mixer approach is the only way and works for all sound systems.

Also available in: PDF