On Mon, Apr 20, 2020 at 11:07:38PM +0200, Alexandre Ratchov wrote: > On Mon, Apr 20, 2020 at 08:00:05PM +0200, Alessandro De Laurenzis wrote: > > Hello Alexandre, > > > > On 20/04/2020 - 19:50, Alexandre Ratchov wrote: > > > On Mon, Apr 20, 2020 at 07:35:03PM +0200, Alessandro De Laurenzis wrote: > > > > Hello Alexandre, > > > > > > > > Thanks for your prompt feedback. > > > > > > > > On 20/04/2020 - 18:00, Alexandre Ratchov wrote: > > > > [...] > > > > > > > > > > This is the right way of doing it except that the user-id running > > > > > sndioctl is probably not authorized to use the server while you're > > > > > using. > > > > > > > > > > You could try to prefix the command with "doas -u <you_user_id>" > > > > > > > > > > -- Alexandre > > > > > > > > > > > > > Yes, that's the root cause and prefixing the sndioctl command with doas > > > > makes the trick. Unfortunately, this solution isn't applicable to my > > > > use-case, since there are several users that can log in this machine... > > > > > > > > Are there any alternatives? > > > > > > mixerctl still works for root. > > > > > > > I'm a bit confused now... so why the previous usbhidaction configuration > > (which was aligned to the manpage suggestions and worked flawlessly for > > years) doesn't work anymore? > > Sorry, few weeks ago mixerctl was changed to use /dev/audioctlN > instead of /dev/mixerN (which was just removed), but the > usbhidaction(1) man page was not updated. Now it's fixed. > > The sample invocation line should read: > > usbhidaction -f /dev/uhid1 -c conf /dev/audioctl0 > > Tested on my setup, let me know if it works for you.
I'm puzzled. This is -current as of yesterday (April 20th). >From /etc/rc.conf.local: usbhidaction_flags=-f /dev/uhid0 -c /etc/usbhidaction.conf /dev/audioctl0 My /etc/usbhidaction.conf: Consumer:Play/Pause 1 echo 'cycle pause' | socat - /tmp/mpvsocket Consumer:Volume_Decrement 1 sndioctl output.level=-0.1 #mixerctl outputs.master=-8 Consumer:Volume_Increment 1 sndioctl output.level=+0.1 #mixerctl outputs.master=+8 Consumer:Mute 1 sndioctl output.mute=! #mixerctl outputs.master.mute=toggle But alas, nothing happens when I press the respective buttons on my keyboard. Running from command line works, but not as root/doas.. Running with doas: $ doas sndioctl output.level=+0.1 default: can't open control device Running as myself: $ sndioctl output.level=+0.1 output.level=0.6 Regards, Erling