git: e83a53abeb90 - main - Chase mixer(8) command-line interface changes

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Sun, 13 Mar 2022 16:44:10 UTC
The branch main has been updated by 0mp (doc, ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=e83a53abeb90258206285be517af2f2045caa78b

commit e83a53abeb90258206285be517af2f2045caa78b
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2022-03-13 13:13:28 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2022-03-13 16:43:49 +0000

    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:  903873ce1560 Implement and use new mixer(3) library for FreeBSD.
    Differential Revision:  https://reviews.freebsd.org/D34545
---
 sbin/devd/apple.conf                  |  6 +++---
 sbin/devd/asus.conf                   | 12 ++++++------
 share/man/man4/acpi_ibm.4             |  6 +++---
 usr.bin/fortune/datfiles/freebsd-tips |  4 ++--
 usr.bin/usbhidaction/usbhidaction.1   | 19 +++++++++----------
 5 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/sbin/devd/apple.conf b/sbin/devd/apple.conf
index 3084cd459fd4..9c132ec9f183 100644
--- a/sbin/devd/apple.conf
+++ b/sbin/devd/apple.conf
@@ -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
diff --git a/sbin/devd/asus.conf b/sbin/devd/asus.conf
index a195a58bc51d..eed369f6ca4d 100644
--- a/sbin/devd/asus.conf
+++ b/sbin/devd/asus.conf
@@ -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
diff --git a/share/man/man4/acpi_ibm.4 b/share/man/man4/acpi_ibm.4
index a2c862b69703..290c7d3b29c1 100644
--- a/share/man/man4/acpi_ibm.4
+++ b/share/man/man4/acpi_ibm.4
@@ -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
 		;;
         *)
diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips
index c974f74dfda3..e8fa84e02489 100644
--- a/usr.bin/fortune/datfiles/freebsd-tips
+++ b/usr.bin/fortune/datfiles/freebsd-tips
@@ -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
 
diff --git a/usr.bin/usbhidaction/usbhidaction.1 b/usr.bin/usbhidaction/usbhidaction.1
index ca4556da3416..423b21adae9f 100644
--- a/usr.bin/usbhidaction/usbhidaction.1
+++ b/usr.bin/usbhidaction/usbhidaction.1
@@ -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 ,