REFORM(1)                                               REFORM(1)

     NAME
          audio, pm, shortcuts - MNT Reform 2 support utilities

     SYNOPSIS
          reform/audio [ -1 ] [ -D ] [ -m mountpoint ] [ -s service ]

          reform/pm [ -D ] [ -m mountpoint ] [ -s service ]

          reform/shortcuts [ -l light_step ] [ -v vol_step ]

     DESCRIPTION
          These programs provide support for certain functions of MNT
          Reform 2 computing device.  Some of them also make control-
          ling file systems available under /dev.

        Audio
          audio initializes the DAC (Digital-to-Analog Converter) on
          the platform and provides a standard audio(3) interface to
          control volume and other parameters.  With -1 only the ini-
          tialization is performed and the program exits immediately.

          The following files are provided by the program:

          audioctl
               Shows the current status (on or off ) of the three
               "outputs" - master, hp and 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 - on , off or toggle , accordingly.

               DAC can be reinitialized by writing a single reset.

          volume
               Provides an interface for volume control (see
               audio(3)).  For ease of use, volume supports relative
               adjustments by prefixing a number with a sign.  master
               +1, for example, will increase the volume on master by
               1%, which is 0.5dB for this particular output. For hp
               and spk one percent is 1dB.

               Enhanced stereo separation can be enabled by writing
               3d, followed by desired percentage of the effect.

        Power and monitoring
          pm presents a file system consisting of the following files:

          battery
               Returns attached battery array statistics in the same
               manner as acpi(8).

     Page 1                       Plan 9             (printed 4/19/24)

     REFORM(1)                                               REFORM(1)

          cputemp
               Exposes the current temperature reading of the CPU.

          kbdoled
               An uncompressed Plan 9 image can be written to the file
               to display on the keyboard OLED.  Zero-length write
               clears the display.

          light
               Provides a way to control the backlight of the built-in
               LCD by writing lcd [-+]N or kbd [-+]N, where N is
               expressed in percentage, either as an absolute value
               (0-100) or relative to the current brightness - by pre-
               fixing with a sign.  Reading light returns the current
               brightness.

          pmctl
               Reading pmctl gives the System Controller firmware ver-
               sion string, voltage (mV) of each cell and current(mA)
               of the battery array.

               Writing power off to pmctl will turn off all power
               rails, which is what fshalt(8) does after halting the
               file systems.

        Shortcuts
          shortcuts enables LCD brightness and audio volume adjustment
          via keyboard shortcuts.

          The program uses Rio's kbdtap to function:

               reform/shortcuts </dev/kbdtap >/dev/kbdtap

          Hyper+F1/F2 decreases/increases LCD brightness,
          Hyper+F7/F8/F9 skips to the previous track, (un)pauses or
          skips to the next track in zuke(1), Hyper+F10 (un)mutes the
          audio, Hyper+F11/F12 decreases/increases "master" volume.
          Optionally, a single step amount can be set with -l for LCD
          light level (default is 5) and -v for volume (default is 3).
          Values can be negative to essentially swap the decrement and
          increment keys.

     SOURCE
          /sys/src/cmd/reform

     SEE ALSO
          audio(3)

     HISTORY
          MNT Reform 2 support first appeared in 9front (August,
          2022).

     Page 2                       Plan 9             (printed 4/19/24)

     REFORM(1)                                               REFORM(1)

     BUGS
          Only 44100Hz (default) and 48000Hz sample rates are sup-
          ported with audio, recording is not implemented.

          Light was chosen as a shorter alternative to brightness.

          Current keyboard light level reading is only an indication,
          there is no way to get the actual value from the keyboard.

          Values displayed in the battery file are not precise, cell
          capacities are hardcoded in the System Controller firmware.

     Page 3                       Plan 9             (printed 4/19/24)