Chase mixer(8) command-line interface changes

FreeBSD 14.0 is going to ship with a new implementation of the mixer(8)
command. Unfortunately, in order to support new features like mute, the
command-line interface of the new implementation is not backwards
compatible.

Update all the remaining documentation and scripts in the src tree
to use the new syntax.

While here, document in usbhidaction.1 that the mute functionality is
now supported.

Reviewed by:	christos, debdrup, hselasky
Approved by:	hselasky (src)
Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
Differential Revision:	https://reviews.freebsd.org/D34545
This commit is contained in:
Mateusz Piotrowski 2022-03-13 14:13:28 +01:00
parent 0134bbe56f
commit e83a53abeb
5 changed files with 23 additions and 24 deletions

View File

@ -44,7 +44,7 @@ notify 0 {
match "system" "PMU";
match "subsystem" "keys";
match "type" "mute";
action "mixer 0";
action "mixer vol.volume=0";
};
notify 0 {
@ -52,7 +52,7 @@ notify 0 {
match "subsystem" "keys";
match "type" "volume";
match "notify" "down";
action "mixer vol -10";
action "mixer vol.volume=-10";
};
notify 0 {
@ -60,7 +60,7 @@ notify 0 {
match "subsystem" "keys";
match "type" "volume";
match "notify" "up";
action "mixer vol +10";
action "mixer vol.volume=+10";
};
# Eject key

View File

@ -7,21 +7,21 @@ notify 0 {
match "system" "ACPI";
match "subsystem" "ASUS";
match "notify" "0x32";
action "mixer 0";
action "mixer vol.volume=0";
};
notify 0 {
match "system" "ACPI";
match "subsystem" "ASUS";
match "notify" "0x31";
action "mixer vol -10";
action "mixer vol.volume=-10";
};
notify 0 {
match "system" "ACPI";
match "subsystem" "ASUS";
match "notify" "0x30";
action "mixer vol +10";
action "mixer vol.volume=+10";
};
# The next blocks enable volume hotkeys that can be found on the Asus EeePC
@ -29,21 +29,21 @@ notify 0 {
match "system" "ACPI";
match "subsystem" "ASUS-Eee";
match "notify" "0x13";
action "mixer 0";
action "mixer vol.volume=0";
};
notify 0 {
match "system" "ACPI";
match "subsystem" "ASUS-Eee";
match "notify" "0x14";
action "mixer vol -10";
action "mixer vol.volume=-10";
};
notify 0 {
match "system" "ACPI";
match "subsystem" "ASUS-Eee";
match "notify" "0x15";
action "mixer vol +10";
action "mixer vol.volume=+10";
};
# Enable user hotkeys that can be found on the Asus EeePC

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 24, 2020
.Dd March 13, 2022
.Dt ACPI_IBM 4
.Os
.Sh NAME
@ -451,11 +451,11 @@ case ${NOTIFY} in
LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led`
if [ $LEVEL -eq 0 ]; then
sysctl dev.acpi_ibm.0.mic_led=1
mixer rec 0
mixer rec.volume=0
fi
if [ $LEVEL -eq 1 ]; then
sysctl dev.acpi_ibm.0.mic_led=0
mixer rec 30
mixer rec.volume=30
fi
;;
*)

View File

@ -339,8 +339,8 @@ If you have sudo(8) installed and permissions to use it, type
``<ESC>w ! sudo tee %'' to force a write.
%
You can adjust the volume of various parts of the sound system in your
computer by typing 'mixer <type> <volume>'. To get a list of what you can
adjust, just type 'mixer'.
computer by typing 'mixer <type>.volume=<volume>'. To get a list of what
you can adjust, just type 'mixer'.
%
You can automatically download and install binary packages by doing

View File

@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd October 28, 2020
.Dd March 13, 2022
.Dt USBHIDACTION 1
.Os
.Sh NAME
@ -139,12 +139,11 @@ The following configuration file can be used to control a pair
of Philips USB speakers with the HID controls on the speakers.
.Bd -literal -offset indent
# Configuration for various Philips USB speakers
Consumer:Volume_Increment 1 0 mixer -f $1 vol +1
Consumer:Volume_Decrement 1 0 mixer -f $1 vol -1
# mute not supported
#Consumer:Mute 1 0 mixer -f $1 mute
Consumer:Channel_Top.Microsoft:Base_Up 1 0 mixer -f $1 bass +1
Consumer:Channel_Top.Microsoft:Base_Down 1 0 mixer -f $1 bass -1
Consumer:Volume_Increment 1 0 mixer -f $1 vol.volume=+1
Consumer:Volume_Decrement 1 0 mixer -f $1 vol.volume=-1
Consumer:Mute 1 0 mixer -f $1 mute.volume=^
Consumer:Channel_Top.Microsoft:Base_Up 1 0 mixer -f $1 bass.volume=+1
Consumer:Channel_Top.Microsoft:Base_Down 1 0 mixer -f $1 bass.volume=-1
.Ed
.Pp
A sample invocation using this configuration would be
@ -154,9 +153,9 @@ A sample invocation using this configuration would be
The following example controls the mixer volume using a Logitech Wingman.
Notice the debounce of 1 for buttons and 5 for the slider.
.Bd -literal -offset indent
Button:Button_1 1 1 mixer vol +10
Button:Button_2 1 1 mixer vol -10
Generic_Desktop:Z * 5 mixer vol `echo $V | awk '{print int($$1/255*100)}'`
Button:Button_1 1 1 mixer vol.volume=+10
Button:Button_2 1 1 mixer vol.volume=-10
Generic_Desktop:Z * 5 mixer vol.volume=`echo $V | awk '{print int($$1/255*100)}'`
.Ed
.Sh SEE ALSO
.Xr usbhidctl 1 ,