Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**

Sunday, March 28, 2021

umix for TV volume control

I use a separate miccus bluetooth transmitter connected by a headphone cable and RCA adapter so that I can listen to my television or pc.  Presently I have adapted a bit of magic that modified my original setup which had two outputs reaching the transmitter but that had a side-effect (60-cycle?) hum and was a mild hassle in general.

Instead of connecting the output of the headphone jack of my 4k PiP-capable monitor to the transmitter, I attach it to the mic port on my PC.  The line out port of my motherboard remains attached to the transmitter by way of an RCA adapter as it had originally. The final piece of the puzzle is a very cool utility called umix which is a simple non-graphical audio mixer.

The manual page gives the necessary information on how to use this application, including what I used as the mute toggle key (x).
UMIX(1)                         Sound Utilities                        UMIX(1)

NAME
       umix - adjust soundcard mixers

SYNOPSIS
       umix [channel volume|left:right][R|P][+|-] device] [-r driver] [-f
       configpath] [-ghilqsv]

DESCRIPTION
       umix is a program for adjusting soundcard mixers.  With it you can
       adjust your soundcard volumes, balances and recording sources.  It can
       be used flexibly from the command-line, or from an interactive user
       interface.

       You can save your soundcard volumes to a file, and load them
       afterwards, for example when when booting the machine.

       Channel names are used to specify the volume you want to adjust. You
       can check what channels are supported with the -q option. Channel names
       can also be shortened if they have enough distinctive letters to
       identify the channel, eg. 'volume' can be shortened to 'vol'. If
       channel name is specified as all , all available channels are set to
       the specified value.

       For each channel specified, volume is the volume you want to set, with
       both left and right specified as the same, or in left:right format.

       You can also specify optional + or - after the volume for increasing or
       decreasing the volume for channel, with amount volume.  The optional
       R or P at the end of the channel argument sets the channel as a current
       recording source or normal play, respectively.  You can use both upper-
       and lowercase letters.

       You can slide volumes smoothly in steps from one point to another.  The
       format is following: startvol,endvol,steps,delay.  Here startvol is the
       volume you want to slide the volume from, and endvol is the volume you
       want to increase or decrease in steps to.  Optional parameter steps
       specifies the number of steps between the two volumes, and delay the
       delay between two steps. Default values for steps is 20, and 20ms for
       delay.  The optional + or - have no effect when sliding volumes.

       The delay can be between 0 and 5 seconds, specified in milliseconds.
       Maximum value for steps is the difference between the starting and
       destination volume, so that the minimum raise or decrease in one step
       is always 1.

       All volume settings are parsed the same, so you can use sliding in your
       config file too, you just have to edit the config manually.  For
       example the line

       pcm 0,100,25,50

       in your config file would slide the volume of 'pcm' from 0 to 100 in 25
       steps and with a 50 ms delay when loading settings.

       Umix needs read and write permissions to the mixer device. I suggest
       that you create a group for this and change permissions so that group
       has write and read access to the devices, then add necessary users to
       that group.

OPTIONS
       -q, --query
              Query and print all active channel volumes and stats from all
              available devices. Interactive UI is not started.

       -l, --load
              Load previously saved settings from configpath.  If configpath
              is specified as '-', settings are loaded from standard input.
              Clears the -i option.

       -s, --save
              Save current mixer settings to configpath.  If configpath is
              specified as '-', settings are printed to standard output.
              Clears the -i option.

       -f configpath, --file=configpath
              Specify the file used to read and save settings.  Defaults to
              /etc/umixrc.  Sets the -i option.

       -d device, --device=device
              Specify the device used. Defaults to /dev/mixer.  Sets the -i
              option.

       -r driver, --driver=driver
              Specify the driver used. Defaults to OSS.  Sets the -i option.

       -i, --interactive
              Start interactive user interface after processing non-
              interactive command-line options.

       -g, --globals
              Print current global options. This is useful for finding out
              what is the default device etc.

       -h, --help
              Display help and exit.

       -v, --version
              Display version information and exit.

EXAMPLES
       umix -q
              Prints all volumes of active channels and their stats.  The
              output should be self-explanatory.

       umix volume 100 bass 88 treble 80 pcm 94
              Sets the volume to 100, bass to 88, treble to 80 and PCM to 94.

       umix vol 100:80 syn 90:30
              Here channel names are shortened and stereo settings are used.
              Sets volume`s left to 100, right to 80 and synth`s left to 90
              and right to 30.

       umix bass 20- pcm 20:10+ ogain 40:45-
              Here volumes are incremented or decremented from their original
              values. Decreases bass by 20, increases PCM`s left by 20 and
              right by 10 and the last one decreases output gain`s left by 40
              and right by 45.

       umix mic R synth 20P line 10p-
              This sets the mic as a recording source, synth as normal play
              with volume 20 and line as normal play with volume decreased by
              10.

       umix pcm 0,60,30,25 vol 100,70 synth 50:50,25:50
              Here sliding is demonstrated. The first slides pcm from 0 to 60
              with 30 steps and a 25 ms delay, then slides vol from 100 to 70
              with default steps and delay and the last one slides synth from
              50:50 to 25:50.

       umix -f /some/path/umixrc -l
              Here the config path is specified as /some/path/umixrc and
              settings are loaded from that file.

       umix -d /dev/mixer2 -f /somepath/umsettings
              The device that is used for mixing is specified as /dev/mixer2,
              config path is set as /somepath/umsettings and the interactive
              user interface is automatically started, because.  -f and -d set
              the -i option.

NCURSES USER INTERFACE
       The (n)curses based user interface. Designed to be used from a console
       or x-terminal.

   USAGE
       On the left side is the channel menu, which consists of channel names,
       stats and volumes.  On the right side is the balance menu.  The
       currently chosen channel is indicated with highlighting its name and
       drawing arrows around the chosen menu.  You can move around with
       default vi/emacs/arrow keys.

       Moving up and down selects the current channel, moving left and right
       adjusts the volume or balance, depending on which menu you are in.  Tab
       toggles between volume and balance menus.

       If the channel does not support stereo mixing (it`s left and right
       values cannot differ), then a '|' at center of the balance is drawn.

   KEY BINDINGS
       j / ^n / arrow down
              Move down.

       k / ^p / arrow up
              Move up.

       h / ^b / arrow left
              Decrease volume / balance left.

       l / ^f / arrow right
              Increase volume / balance right.

       ] / .  Increase volume by fifth of maximum amount.

       [ / ,  Decrease volume by fifth of maximum amount.

       Tab    Toggle between volume and balance menus.

       Space  Toggle play / record source.

       L      Load settings.

       S      Save settings.

       f      Specify the config path. This presents a dialog in the lower
              border. If no string is given, the path remains unchanged.

       e      Enter channel volume manually for the current channel.  Same
              rules apply as with command-line channel settings, so you can
              set balances and recording sources too.

       n      Cycles through available mixer devices. You can see the
              currently active mixer and the total number of initialized
              mixers in the top border.

       m      Mutes all those channels that are not already mute. If pressed
              again, returns volumes back to the state before muting.

       x      Excludes the current channel. Same as m but only with the
              current channel.

       H      Displays the help.

       q      Exit the program.

       ^l     Refresh the screen.

CONFIG FILE
       The config consists of global options and mixer settings.  Global
       options come after the keyword [global].  Global options are read
       before loading any mixer settings or parsing command-line options.
       Global options are the defaults to use if no command-line options are
       given.

       Mixer settings come after the keyword [mixers].  The mixer device that
       settings are loaded for is specified with the keyword mixer.  The
       string after mixer= is the path of the mixer device. Then comes the
       settings for that mixer. These are parsed like command-line options.

       Comments and all other characters are ignored.

FILES
       /etc/umixrc
              The default configuration file.

       $HOME/.umixrc
              Used as the config file if exists.

BUGS
       When used with terminals that have columns below 35, the output is not
       optimal with the ncurses UI.

       If the number of channels is greater than number of lines on screen,
       you cannot adjust channels that exceed the number of lines in the
       ncurses UI (rare, but to be fixed soon)

AUTHOR
       Sakari Lehtonen <sakari@ionstream.fi>

                                  08 Jun 2002                          UMIX(1)

Now if I switch sources entirely on my monitor, or use the picture-in-picture function to watch a TV show (or hockey game) in the smaller window, I can hear both the TV and my PC if I so choose, as long as I set the audio source of my monitor properly such as to tell it to use the source port for the small picture as audio source.  This also allows me a much easier method to silence (or adjust the volume) of the television program while in a commercial break by use of the mixer application instead of needing to toggle it on the monitor itself which I might move slightly out of reach.  Additionally, I can easily mute all of my application sound when I choose to only view a TV program.

No comments:

Post a Comment

Thank you for your interest!

Frequently viewed this week