FAQ#27
What is required for the volume sublet?
Category: | Sublets | Difficulty: | ![]() |
Assignee: | - | Due date: | |
Related issue: | - | Related Message: | - |
Related version: | - | Views: | 4684 |
Valid: | Valid |
Answer
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.
modprobe snd_mixer_oss
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