Module Name:src
Committed By: martin
Date: Sat Jun 20 16:08:57 UTC 2020
Modified Files:
src/usr.sbin/hdaudioctl [netbsd-9]: graph.c hdaudioctl.8 hdaudioctl.c
hdaudioctl.h
Log Message:
Pull up following revision(s) (requested by sborrill in ticket #961):
usr.sbin/hdaudioctl/hdaudioctl.8: revision 1.7
usr.sbin/hdaudioctl/graph.c: revision 1.5
usr.sbin/hdaudioctl/hdaudioctl.c: revision 1.3
usr.sbin/hdaudioctl/hdaudioctl.c: revision 1.4
usr.sbin/hdaudioctl/hdaudioctl.h: revision 1.3
Add show subcommand that displays the codec configuration in
human-readable tabulated form
Nix trailing whitespace.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.18.1 src/usr.sbin/hdaudioctl/graph.c
cvs rdiff -u -r1.6 -r1.6.28.1 src/usr.sbin/hdaudioctl/hdaudioctl.8
cvs rdiff -u -r1.2 -r1.2.18.1 src/usr.sbin/hdaudioctl/hdaudioctl.c
cvs rdiff -u -r1.2 -r1.2.44.1 src/usr.sbin/hdaudioctl/hdaudioctl.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/hdaudioctl/graph.c
diff -u src/usr.sbin/hdaudioctl/graph.c:1.3 src/usr.sbin/hdaudioctl/graph.c:1.3.18.1
--- src/usr.sbin/hdaudioctl/graph.c:1.3 Sat Mar 28 14:09:59 2015
+++ src/usr.sbin/hdaudioctl/graph.c Sat Jun 20 16:08:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: graph.c,v 1.3 2015/03/28 14:09:59 jmcneill Exp $ */
+/* $NetBSD: graph.c,v 1.3.18.1 2020/06/20 16:08:57 martin Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd
@@ -45,13 +45,6 @@
#include "hdaudioctl.h"
-static const char *pin_devices[16] = {
- "Line Out", "Speaker", "HP Out", "CD",
- "SPDIF Out", "Digital Out", "Modem Line", "Modem Handset",
- "Line In", "AUX", "Mic In", "Telephony",
- "SPDIF In", "Digital In", "Reserved", "Other"
-};
-
int
hdaudioctl_graph(int fd, int argc, char *argv[])
{
Index: src/usr.sbin/hdaudioctl/hdaudioctl.8
diff -u src/usr.sbin/hdaudioctl/hdaudioctl.8:1.6 src/usr.sbin/hdaudioctl/hdaudioctl.8:1.6.28.1
--- src/usr.sbin/hdaudioctl/hdaudioctl.8:1.6 Tue Mar 18 18:20:46 2014
+++ src/usr.sbin/hdaudioctl/hdaudioctl.8 Sat Jun 20 16:08:57 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: hdaudioctl.8,v 1.6 2014/03/18 18:20:46 riastradh Exp $
+.\" $NetBSD: hdaudioctl.8,v 1.6.28.1 2020/06/20 16:08:57 martin Exp $
.\"
.\" Copyright (c) 2009 Precedence Technologies Ltd
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 6, 2009
+.Dd June 12, 2020
.Dt HDAUDIOCTL 8
.Os
.Sh NAME
@@ -55,6 +55,8 @@ Valid commands are:
For each child codec of the chosen
.Xr hdaudio 4
device, display the nid, vendor, product, subsystem and device IDs.
+.It show
+Retrieve and display the current codec configuration in human-readable form.
.It get Ar codecid Ar nid
Retrieve and display the current codec configuration as a
.Xr proplib 3
Index: src/usr.sbin/hdaudioctl/hdaudioctl.c
diff -u src/usr.sbin/hdaudioctl/hdaudioctl.c:1.2 src/usr.sbin/hdaudioctl/hdaudioctl.c:1.2.18.1
--- src/usr.sbin/hdaudioctl/hdaudioctl.c:1.2 Sat Mar 28 14:09:59 2015
+++ src/usr.sbin/hdaudioctl/hdaudioctl.c Sat Jun 20 16:08:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudioctl.c,v 1.2 2015/03/28 14:09:59 jmcneill Exp $ */
+/* $NetBSD: hdaudioctl.c,v 1.2.18.1 2020/06/20 16:08:57 martin Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd
@@ -49,13 +49,54 @@
#define DEVPATH_HDAUDIO "/dev/hdaudio0"
+const char *pin_devices[16] = {
+ "Line out", "Speaker", "Headphones", "CD",
+ "SPDIF Out", "Digital Out", "Modem Line", "Modem Handset",
+ "Line In", "AUX", "Mic In", "Telephony",
+ "SPDIF In", "Digital In", "Reserved", "Other"
+};
+static const char *pin_jacks[16] = {
+ "Unknown", "1/8\"", "1/4\"", "ATAPI",
+ "RCA", "Optic", "Digital", "Analog",
+ "DIN", "XLR", "RJ-11", "Combo",
+ "0xC", "0xD", "0xE", "Other"
+};
+static const char *pin_connections[4] = {
+ "Jack", "None", "Fixed", "Both"
+};
+static const char *pin_colors[16] = {
+ "Unknown", "Black", "Grey", "Blue",
+ "Green", "Red", "Orange", "Yellow",
+ "Purple", "Pink", "Res. A", "Res. B",
+ "Res. C", "Res. D", "White", "Other"
+};
+static const char *pin_locations[64] = {
+ "0x00", "Rear", "Front", "Left",
+ "Right", "Top", "Bottom", "Rear-panel",
+ "Drive-bay", "0x09", "0x0a", "0x0b",
+ "0x0c", "0x0d", "0x0e", "0x0f",
+ "Internal", "0x11", "0x12", "0x13",
+ "0x14", "0x15", "0x16", "Riser",
+ "0x18", "Onboard", "0x1a", "0x1b",
+ "0x1c", "0x1d", "0x1e", "0x1f",
+ "External", "Ext-Rear", "Ext-Front", "Ext-Left",
+ "Ext-Right", "Ext-Top", "Ext-Bottom", "0x07",
+ "0x28", "0x29", "0x2a", "0x2b",
+ "0x2c", "0x2d", "0x2e", "0x2f",
+ "Other", "0x31", "0x32", "0x33",
+ "0x34", "0x35", "Other-Bott", "Lid-In",
+ "Lid-Out", "0x39", "0x3a", "0x3b",
+ "0x3c", "0x3d", "0x3e", "0x3f"
+};
+
void
usage(void)
{
const char *prog;
prog = getprogname();
-
+
fprintf(stderr, "usage: %s