odknt / bspwmbar

A lightweight status bar for bspwm.
ISC License
92 stars 11 forks source link

Still not working on OpenBSD - volume module #35

Open museur4 opened 4 years ago

museur4 commented 4 years ago

I get error when trying to start it: volume: failed to open /dev/mixer I am sorry if this is a previlige problem but I doubt it.

c0dev0id commented 4 years ago

Hi @museur4,

The mixer device in OpenBSD ist /dev/audioctlX; Try this:

export MIXERDEVICE=/dev/audioctl0 
bspwmbar

EDIT: Okay, it is not that simple. The solution above works, but crashes once concurrent device access happens (for example by starting an SDL application [e.g. scummvm]).

The proper fix would be to read the volume through the sndio API (look at sndioctl.c). Start at sioctl_open(). https://github.com/openbsd/src/blob/master/usr.bin/sndioctl/sndioctl.c#L979

As a temporary quick hack, you could replace https://github.com/odknt/bspwmbar/blob/master/volume.c#L113 with return;. This makes the volume disappear when the device is blocked, and reappar when access to the device is working again.