octl(1)

Name

octl — raw PCM playback/record and volume control using the OSS API

Syntax

oplay, orec [-MQqvw] [-B bytes] [-K pos] [-T bytes] [-V level] [-b bits] [-c channels] [-d file] [-f bytes] [-k pos] [-s bytes] [-t seconds]

orec has the same syntax.

omixer [device] [control [volume|leftvol:rightvol]]

Description

octl allows you to do simple raw PCM playback and recording via the OSS API. Volume can also be set.

Options (oplay, orec)

-B bytes
    Sets the block size (bytes to r/w at once).

-K pos
    Jump to byte position.

-M  Sets the mono flag; equivalent to specifying -c1.

-Q  Sets 4-channel output; equivalent to -c4.

-T bytes
    Maximum amount of bytes to record/play.

-V level
    Set verbosity level (default: 3). Valid levels are 0–4.

-b bits
    Sets the sample size (8/16 bit) (default: 16).

-c channels
    Sets the number of channels (default: 2).

-d device
    Uses this DSP device (default: /dev/dsp). Multiple -d options can be specified to copy output to multiple soundcards (oplay only).

-f bytes
    Sets the fragment size. (This is an OSS internal.)

-k [minutes:]seconds
    Jump to position (minutes:seconds or seconds from the start).

-q  Lower verbosity level

-s rate
    Set the samplerate (default: 44100).

-t [minutes:]seconds
    Maximum amount of time to record/play.

-v  Increase verbosity level.

If no -K/-k option is specified, orec will truncate the output file during open.

Options (omixer)

device
    A mixer specification. The first character must either be a colon (:) or an equals sign (=) to make omixer recognize it as a device. If the prefix is a colon, it will be replaced by "/dev/mixer", making ":1" equal to "/dev/mixer1" and ":" is "/dev/mixer" itself. An equals sign instead indicates that the path is complete, i.e. "=/devices/audio/mixer1" will use that specific device (/devices/audio/mixer1).

control
    Control to examine. The available controls can be printed leaving this parameter empty. The recording source can be queried using "?r" as control. (De)selecting the recording source is done using "+r" / "-r".

volume
    The volume level (0-100) to set the control to. If a number is specified, both channels will be set to the given level. "leftvol:rightvol" can be used to specify each channel's level.

oplay verbosity levels

0   no output at all

1   just print the filename

2   filename + a dot for each block that was written to the DSP device

3 (default)
    filename + time position

4   filename + time position + byte position

Examples

omixer definitely warrants examples.

Show all controls:
    omixer

Show all controls of /dev/mixer1:
    omixer =/dev/mixer1
    (or) omixer :1

Show PCM control of mixer0:
    omixer pcm

Set PCM to 50% left, 70% right:
    omixer pcm 50:70

Set PCM on /dev/mixer2 to 50% both
    omixer :2 pcm 50

Notes
oplay -Q/-c4 might yield weird results if the underlying device does not support it.

See also

hxtools(7)