Skip to content

circuitbeard/alsa_volume_from_usb_hid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ALSA Volume From USB HID

Overview

This is a small script-based daemon for Linux systems using the Advanced Linux Sound Architecture (ALSA) to allow USB HID 'Consumer Control' volume events to adjust the ALSA mixer volume.

As far as I know, this should 'just work' for the default ALSA playback device without the need for this daemon. However, it seems some ALSA configurations break this. In my case I was using the ALSA SoftVol plugin to enable a volume control for an Adafruit MAX98357 I2S Class-D Mono Amp PCM device which has no volume control itself.

The daemon installs as a systemd service.

Usage

Alsa Mixer

The script uses the default ALSA playback mixer control. This is one returned from the following command:

amixer -D default

USB HID Device

By default, with no other command line arguments the daemon will select the first USB HID input device found under /dev/input. This can be overridden by specifying an alternative device when starting the daemon. e.g. from the root of this repo:

src/alsa_vol_from_usb_hid.sh /dev/input/event1

However most of the time you will want the daemon to install and start automatically instead of starting it manually like this. See the 'Installation' section below.

Installation

To install with automatic USB HID device selection (the first USB HID input device found under /dev/input):

sudo make install

To install specifying a particular USB HID device (e.g. /dev/input/event1):

sudo make install USBHID_DEVICE=/dev/input/event1

To uninstall:

sudo make uninstall

About

A daemon to control ALSA volume from USB HID Consumer Control events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 82.7%
  • Makefile 17.3%