PROPHET/OS

NAME

mixer: the one tool for the sound graph (R13-AUDIO-01)

SYNOPSIS

mixer                     list the sinks and the streams

DESCRIPTION

The one tool for the sound graph (R13-AUDIO-01). A sink is an output: the loopback that is always there, a codec, a USB DAC. A stream carries sound from a program or a test tone to one sink, and many streams share a sink.

Without words it lists both. A sink shows its rate, its master volume, the level of its last period, how many streams feed it, the periods its device missed and its state: off, on, runs, muted. A stream shows its sink, its volume and its home, the sink it returns to.

mixer vol <stream> <pct>       a stream's volume in percent
mixer mute|unmute <stream>     silence a stream, let it play again
mixer route <stream> <sink>    move a stream; the sink is its home now, and the next stream of its program starts there
mixer policy <program> <sink>  new streams of a program go to that sink or source; `-` forgets its rules
mixer link <stream> <sink>     play a stream on a further sink too, before its fader; prints the link's id
mixer wire <source> <sink>     play a source straight on a sink; prints the link's id
mixer eq <sink> <band> <hz> <cdb> <q100>  a peaking band of the sink's filter: centre, gain in hundredths of a dB (+-2400), quality in hundredths (30 up); band = the count adds one
mixer flat <sink>              take the sink's filter off
mixer loudness <sink> on|off   shelves below 150 Hz and above 8 kHz lift by a half and a quarter of what the volume takes away, at most 12 and 6 dB; kept under the sink's name
mixer limiter <sink> on|off    a frame past -0.3 dB of full scale is scaled under it at once and the gain returns over 50 ms; kept under the sink's name
mixer crossfeed <sink> on|off  each side gets 0.3 of the other's bass minus its own below 700 Hz, mono passes word for word; kept under the sink's name
mixer period <stream> <us>     ask a period for a stream; its sink runs at the shortest period any of its streams or the user asked
mixer master <sink> <pct>      a sink's master volume
mixer info <sink>              everything the sink's device says of itself
mixer quantum <sink> <us>      wish a sink a period in microseconds, 0 its own
mixer format <sink> <hz> <bits> [raw] run the sink's device at a rate and a width, raw: its raw-data setting (native DSD)
mixer exact <sink> <ms>        the idle pattern word for word for ms, past the mixer
mixer quiet|loud <sink>        mute a whole sink, at the device if it can
mixer off|on <sink>            switch a sink off and on while it plays
mixer cut|join <stream>        mute the stream's link only, open it again
mixer listen [source]          record a moment off an input, print its level
mixer tone <hz> [sink]         a test tone, on the default sink if none
mixer del <stream>             stop and remove a stream

A source is an input, listed with the sinks and marked in: a line in, a microphone, the monitor that hears what the loopback plays, and beside every other output its port <name>.monitor, which hears what that output plays after its volume and filter. A capture stream reads one source. Sound passes four mutes, each on its own: the stream, its link, the sink or source, and at the device where it has one.

mixer info is the readout of a device. For a USB DAC it says the path the signal takes (clock sources, terminals by their names, feature units with their mute and volume), every alternate setting with its format, width, channels and endpoints, and what the device answers when asked: the rates of its clock and the range of its volume in decibels. A master volume goes to the device where it has one, and the list of info says where it is.

A program that ends takes its streams with it. A stream carries its program's name; a link across two device clocks shows in ppm the correction its pull runs at, which holds its ring half full.

The period is how much sound a sink takes at once, and with what its device holds it is the latency the list shows, measured. A shorter period is less latency and less room for a late wake; mixer quantum sets it while the sink plays.

Sinks and sources come and go while the machine runs. A sink that is switched off, or whose device is pulled, closes; its streams move to the default sink (the first real one that is on, else the loopback) and keep playing. When it is back, the streams whose home it is return to it.

Needs the module audio; a driver adds its sink when it runs: mods start hda, mods start uac, mods start dx3.

EXAMPLE

$ mixer
SINKS
 id  name              rate   ch  vol%  peak%  strm  under  state      period us  latency us
 0   loopback          0      0   100   0      0     0      out on     0          0
 1   monitor           0      0   100   0      0     0      in on      0          0
STREAMS
 id    name          kind     sink  rate   ch  vol%  mute  peak%  starve  ppm    home          lat us    calls