amixer.1: Some remarks and a patch with editorial changes for this man page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Package: alsa-utils
Version: 1.2.13-1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"

  [Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?


an.tmac:<stdin>:1: style: .TH missing fourth argument; consider package/project name and version (e.g., "groff 1.23.0")
troff:<stdin>:124: warning: trailing space in the line
troff:<stdin>:133: warning: trailing space in the line
troff:<stdin>:138: warning: trailing space in the line


   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.12-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages alsa-utils depends on:
ii  kmod              33+20240816-2
ii  libasound2t64     1.2.13-1+b1
ii  libatopology2t64  1.2.13-1+b1
ii  libc6             2.40-7
ii  libfftw3-single3  3.3.10-2+b1
ii  libncursesw6      6.5+20250216-1
ii  libsamplerate0    0.2.2-4+b2
ii  libtinfo6         6.5+20250216-1

alsa-utils recommends no packages.

Versions of packages alsa-utils suggests:
pn  dialog  <none>

-- no debconf information
Input file is amixer.1

Output from "mandoc -T lint  amixer.1": (shortened list)

      1 input text line longer than 80 bytes: This document is by ...
      4 whitespace at end of input line

Remove trailing space with: sed -e 's/  *$//'

-.-.

Output from "test-groff -mandoc -t -ww -z amixer.1": (shortened list)

      4 trailing space in the line

Remove trailing space with: sed -e 's/  *$//'

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

4

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

12:for the default soundcard and device. This is a good way to see a list
35:Sets the simple mixer control contents. The parameter can be the volume
54:A simple mixer control must be specified. Only one device can be controlled
61:A simple mixer control must be specified. Only one device can be controlled
74:Sets the card control contents. The identifier has these components: iface,
75:name, index, device, subdevice, numid. The next argument specifies the value
80:Shows the card control contents. The identifier has same syntax as for
98:Select the card number to control. The device name created from this
104:Select the device name to control. The default control name is 'default'.
112:Only sset and cset are accepted.  Other commands are ignored.
121:Quiet mode. Do not show results of changes.
143:will set the master volume of the second card to \-20dB.  If the master
148:will increase the PCM volume of the second card with 2dB.  When both

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.  

Line 169, length 91

This document is by Paul Winkler <zarmzarm@xxxxxxxxx> and Jaroslav Kysela <perex@xxxxxxxx>.

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

161:alsamixer(1)

-.-.

Use the name of units in text; use symbols in tables and
calculations.
The rule is to have a (no-break, \~) space between a number and
its units (see "www.bipm.org/en/publications/si-brochure")

37:a dB gain with \fIdB\fP suffix (like \-12.5dB), or an exact hardware value.
148:will increase the PCM volume of the second card with 2dB.  When both

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

amixer.1:37:a dB gain with \fIdB\fP suffix (like \-12.5dB), or an exact hardware value.

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

an.tmac:<stdin>:1: style: .TH missing fourth argument; consider package/project name and version (e.g., "groff 1.23.0")
troff:<stdin>:116: warning: trailing space in the line
troff:<stdin>:124: warning: trailing space in the line
troff:<stdin>:129: warning: trailing space in the line
troff:<stdin>:162: warning: trailing space in the line

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- amixer.1	2025-03-01 15:39:10.554803625 +0000
+++ amixer.1.new	2025-03-01 16:00:13.654895906 +0000
@@ -9,7 +9,8 @@ soundcard driver.
 \fBamixer\fP supports multiple soundcards.
 
 \fBamixer\fR with no arguments will display the current mixer settings
-for the default soundcard and device. This is a good way to see a list
+for the default soundcard and device.
+This is a good way to see a list
 of the simple mixer controls you can use.
 
 .SH COMMANDS
@@ -32,34 +33,45 @@ Shows a complete list of simple mixer co
 
 .TP
 \fIset\fP or \fIsset\fP <\fISCONTROL\fP> <\fIPARAMETER\fP> ...
-Sets the simple mixer control contents. The parameter can be the volume
+Sets the simple mixer control contents.
+The parameter can be the volume
 either as a percentage from 0% to 100% with \fI%\fP suffix,
-a dB gain with \fIdB\fP suffix (like \-12.5dB), or an exact hardware value.
+a dB gain with \fIdB\fP suffix
+(like \-12.5\~dB),
+or an exact hardware value.
 The dB gain can be used only for the mixer elements with available
 dB information.
 When plus(+) or minus(\-) letter is appended after
 volume value, the volume is incremented or decremented from the current
 value, respectively.
 
-The parameters \fIcap, nocap, mute, unmute, toggle\fP are used to
+The parameters
+.BR cap ", " nocap ", " mute ", " unmute ", " toggle
+are used to
 change capture (recording) and muting for the group specified.
 
 The optional modifiers can be put as extra parameters before the value to
 specify the stream direction or channels to apply.
-The modifiers \fIplayback\fP and \fIcapture\fP specify the stream,
-and the modifiers \fIfront, frontleft, frontright, frontcenter, center,
-rear, rearright, rearleft, woofer\fP are used to specify channels to be
+The modifiers
+.B playback
+and
+.B capture
+specify the stream,
+and the modifiers
+.BR front ", " frontleft ", " frontright ", " frontcenter ", " center ", " \
+rear ", " rearright ", " rearleft ", " woofer
+are used to specify channels to be
 changed.
 
-A simple mixer control must be specified. Only one device can be controlled
-at a time.
+A simple mixer control must be specified.
+Only one device can be controlled at a time.
 
 .TP
 \fIget\fP or \fIsget\fP <\fISCONTROL\fP>
 Shows the simple mixer control contents.
 
-A simple mixer control must be specified. Only one device can be controlled
-at a time.
+A simple mixer control must be specified.
+Only one device can be controlled at a time.
 
 .TP
 \fIcontrols\fP
@@ -71,14 +83,15 @@ Shows a complete list of card controls w
 
 .TP
 \fIcset\fP <\fICONTROL\fP> <\fIPARAMETER\fP> ...
-Sets the card control contents. The identifier has these components: iface,
-name, index, device, subdevice, numid. The next argument specifies the value
-of control.
+Sets the card control contents.
+The identifier has these components:
+iface, name, index, device, subdevice, numid.
+The next argument specifies the value of control.
 
 .TP
 \fIcget\fP <\fICONTROL\fP>
-Shows the card control contents. The identifier has same syntax as for
-the \fIcset\fP command.
+Shows the card control contents.
+The identifier has same syntax as for the \fIcset\fP command.
 
 .SH ADVANCED COMMANDS
 
@@ -95,13 +108,15 @@ Shows the events for the mixer controls.
 .TP
 \fI\-c\fP card
 
-Select the card number to control. The device name created from this
-parameter has syntax 'hw:N' where N is specified card number.
+Select the card number to control.
+The device name created from this parameter has syntax 'hw:N'
+where N is specified card number.
 
 .TP
 \fI\-D\fP device
 
-Select the device name to control. The default control name is 'default'.
+Select the device name to control.
+The default control name is 'default'.
 
 .TP
 \fI\-s\fP | \fI\-\-stdin\fP
@@ -109,24 +124,26 @@ Select the device name to control. The d
 Read from stdin and execute the command on each line sequentially.
 When this option is given, the command in command\-line arguments is ignored.
 
-Only sset and cset are accepted.  Other commands are ignored.
+Only sset and cset are accepted.
+Other commands are ignored.
 The commands to unmatched ids are ignored without errors too.
 
 .TP
-\fI\-h\fP 
+\fI\-h\fP
 Help: show syntax.
 
 .TP
 \fI\-q\fP
-Quiet mode. Do not show results of changes.
+Quiet mode.
+Do not show results of changes.
 
 .TP
-\fI\-R\fP 
+\fI\-R\fP
 Use the raw value for evaluating the percentage representation.
 This is the default mode.
 
 .TP
-\fI\-M\fP 
+\fI\-M\fP
 Use the mapped volume for evaluating the percentage representation
 like \fBalsamixer\fR, to be more natural for human ear.
 
@@ -140,13 +157,15 @@ capture (recording).\fR
 
 .TP
 \fBamixer \-c 1 \-\- sset Master playback \-20dB\fR
-will set the master volume of the second card to \-20dB.  If the master
-has multiple channels, all channels are set to the same value.
+will set the master volume of the second card to \-20dB.
+If the master has multiple channels,
+all channels are set to the same value.
 
 .TP
 \fBamixer \-c 1 set PCM 2dB+\fR
-will increase the PCM volume of the second card with 2dB.  When both
-playback and capture volumes exist, this is applied to both volumes.
+will increase the PCM volume of the second card with 2\~dB.
+When both playback and capture volumes exist,
+this is applied to both volumes.
 
 .TP
 \fBamixer \-c 2 cset iface=MIXER,name='Line Playback Volume",index=1 40%\fR
@@ -157,13 +176,12 @@ will set the third soundcard's second li
 will set the 34th soundcard element to 40%
 
 .SH SEE ALSO
-\fB
-alsamixer(1)
-\fP
+.BR alsamixer (1)
 
-.SH BUGS 
+.SH BUGS
 None known.
 
 .SH AUTHOR
 \fBamixer\fP is by Jaroslav Kysela <perex@xxxxxxxx>.
-This document is by Paul Winkler <zarmzarm@xxxxxxxxx> and Jaroslav Kysela <perex@xxxxxxxx>.
+This document is by Paul Winkler <zarmzarm@xxxxxxxxx>
+and Jaroslav Kysela <perex@xxxxxxxx>.
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  See man-pages(7), item "semantic newline".

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -d -u <out1> <out2>

and for groff, using

\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output from 'diff -d -u ...' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option \"-warnings=w\"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT=\"-ww -b -z\"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux