shithub: riscv

ref: 0875cc2883deb30a0c75569ed8ee65c10988849b
dir: /sys/man/1/reform/

View raw version
.TH REFORM 1
.SH NAME
audio,
pm,
shortcuts
- MNT Reform 2 support utilities
.SH SYNOPSIS
.B reform/audio
[
.B -1
]
[
.B -D
]
[
.B -m
.I mountpoint
]
[
.B -s
.I service
]
.PP
.B reform/pm
[
.B -D
]
[
.B -m
.I mountpoint
]
[
.B -s
.I service
]
.PP
.B reform/shortcuts
[
.B -l
.I light_step
]
[
.B -v
.I vol_step
]
.SH DESCRIPTION
These programs provide support for certain functions of MNT Reform 2
computing device.  Some of them also make controlling file systems
available under
.BR /dev .
.PP
.SS Audio
.I audio
initializes the DAC (Digital-to-Analog Converter) on the platform and
provides a standard \fIaudio\fR(3) interface to control volume and
other parameters.
With
.I -1
only the initialization is performed and the program exits
immediately.
.PP
The following files are provided by the program:
.TP
.B audioctl
Shows the current status
.I (on
or
.I off )
of the three "outputs" -
.BR master ,
.B hp
and
.BR spk .
Each can be enabled, disabled or toggled, by writing a single line to
the same file, consisting of the output name and the desired action -
.I on ,
.I off
or
.I toggle ,
accordingly.
.IP
DAC can be reinitialized by writing a single
.BR reset .
.TP
.B volume
Provides an interface for volume control (see \fIaudio\fR(3)).  For
ease of use,
.B volume
supports relative adjustments by prefixing a number with a sign.
\fImaster +1\fR, for example, will increase the volume on
.B master
by 1%, which is 0.5dB for this particular output. For
.B hp
and
.B spk
one percent is 1dB.
.IP
Enhanced stereo separation can be enabled by writing
.BR 3d ,
followed by desired percentage of the effect.
.SS Power and monitoring
.I pm
presents a file system consisting of the following files:
.TP
.B battery
Returns attached battery array statistics in the same manner as
\fIacpi\fR(8).
.TP
.B cputemp
Exposes the current temperature reading of the CPU.
.TP
.B light
Provides a way to control the backlight of the built-in LCD by
writing \fIlcd [-+]N\fR,
where
.I N
is expressed in percentage, either as an absolute value (0-100) or
relative to the current brightness - by prefixing with a sign.
Reading
.B light
returns the current brightness.
.TP
.B pmctl
Reading
.B pmctl
gives the System Controller firmware version string, voltage (mV) of
each cell and current(mA) of the battery array.
.IP
Writing
.I power off
to
.B pmctl
will turn off all power rails, which is what \fIfshalt\fR(8) does
after halting the file systems.
.SS Shortcuts
.I shortcuts
enables LCD brightness and audio volume adjustment via keyboard
shortcuts.
.PP
The program uses Rio's
.I kbdtap
to function:
.IP
.EX
reform/shortcuts </dev/kbdtap >/dev/kbdtap
.EE
.PP
.I Super+F1/F2
decreases/increases LCD brightness,
.I Super+F3/F4
decreases/increases "master" volume,
.I Super+Escape
(un)mutes the audio.
Optionally, a single step amount can be set with
.I -l
for LCD light level (default is 5) and
.I -v
for volume (default is 3).  Values can be negative to essentially swap
.I F1
with
.IR F2 .
.SH SOURCE
.B /sys/src/cmd/reform
.SH SEE ALSO
.IR audio (3)
.SH HISTORY
MNT Reform 2 support first appeared in 9front (August, 2022).
.SH BUGS
Only 44100Hz (default) and 48000Hz sample rates are supported with
.BR audio ,
recording is not implemented.
.PP
.B Light
was chosen as a shorter alternative to
.BR brightness .
In the future it might support controlling keyboard and trackball
light levels.
.PP
Values displayed in the
.B battery
file are not precise, cell capacities are hardcoded in the System
Controller firmware.