Blame doc/README.remote

Packit c32a2d
Control interface to generic frontends
Packit c32a2d
Packit c32a2d
The generic remote interface allows frontends to easily control
Packit c32a2d
mpg123 by commands through stdin/stdout. To start the generic
Packit c32a2d
remote interface, start mpg123 with parameter -R.
Packit c32a2d
Packit c32a2d
In case of a frontend that starts mpg123 with the -s option to read the audio from stdout, the --remote-err option is automatically activated to send responses to stderr so that stdout stays clean for audio.
Packit c32a2d
Packit c32a2d
(Still the case?)
Packit c32a2d
As an example it's used by IRMP3, a tool that allows you to
Packit c32a2d
control mpg123 with a standard infrared remote control. See
Packit c32a2d
http://www.fasta.fh-dortmund.de/users/andy/irmp3/ for more
Packit c32a2d
information.
Packit c32a2d
Packit c32a2d
You can also specify --fifo <path> to create a named pipe at <path> and listen on that for commands instead stdin.
Packit c32a2d
That way, you can deliberately control mpg123 by echoing into the named pipe from any terminal / program.
Packit c32a2d
The command respones are still sent to standard out or standard error (depending on -s or --remote-err switches).
Packit c32a2d
Packit c32a2d
Packit c32a2d
COMMAND CODES
Packit c32a2d
-------------
Packit c32a2d
Packit c32a2d
You can get this info via the control command "help".
Packit c32a2d
Packit c32a2d
HELP/H: command listing (LONG/SHORT forms), command case insensitve
Packit c32a2d
Packit c32a2d
LOAD/L <trackname>: load and start playing resource <trackname>
Packit c32a2d
Packit c32a2d
LOADPAUSED/LP <trackname>: load but do not start playing resource <trackname>
Packit c32a2d
Packit c32a2d
LOADLIST/LL <entry> <url>: load a playlist from given <url>, and display its entries, optionally load and play one of these specificed by the integer <entry> (<0: just list, 0: play last track, >0:play track with that position in list)
Packit c32a2d
Packit c32a2d
PAUSE/P: pause playback
Packit c32a2d
Packit c32a2d
STOP/S: stop playback (closes file)
Packit c32a2d
Packit c32a2d
JUMP/J <frame>|<+offset>|<-offset>|<[+|-]seconds>s: jump to mpeg frame <frame> or change position by offset, same in seconds if number followed by "s"
Packit c32a2d
Packit c32a2d
VOLUME/V <percent>: set volume in % (0..100...); float value
Packit c32a2d
Packit c32a2d
RVA off|(mix|radio)|(album|audiophile): set rva mode
Packit c32a2d
Packit c32a2d
EQ/E <channel> <band> <value>: set equalizer value for frequency band 0 to 31 on channel 1 (left) or 2 (right) or 3 (both)
Packit c32a2d
Packit c32a2d
EQFILE <filename>: load EQ settings from a file
Packit c32a2d
Packit c32a2d
SHOWEQ: show all equalizer settings (as <channel> <band> <value> lines in a SHOWEQ block (like TAG))
Packit c32a2d
Packit c32a2d
SEEK/K <sample>|<+offset>|<-offset>: jump to output sample position <samples> or change position by offset
Packit c32a2d
Packit c32a2d
SCAN: scan through the file, building seek index
Packit c32a2d
Packit c32a2d
SAMPLE: print out the sample position and total number of samples
Packit c32a2d
Packit c32a2d
SEQ <bass> <mid> <treble>: simple eq setting...
Packit c32a2d
Packit c32a2d
PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 % faster)
Packit c32a2d
Packit c32a2d
SILENCE: be silent during playback (meaning silence in text form)
Packit c32a2d
Packit c32a2d
STATE: Print auxilliary state info in several lines (just try it to see what info is there).
Packit c32a2d
Packit c32a2d
TAG/T: Print all available (ID3) tag info, for ID3v2 that gives output of all collected text fields, using the ID3v2.3/4 4-character names.
Packit c32a2d
   The output is multiple lines, begin marked by "@T {", end by "@T }".
Packit c32a2d
   ID3v1 data is like in the @I info lines (see below), just with "@T" in front.
Packit c32a2d
   An ID3v2 data field is introduced via ([ ... ] means optional):
Packit c32a2d
    @T ID3v2.<NAME>[ [lang(<LANG>)] desc(<description>)]:
Packit c32a2d
   The lines of data follow with "=" prefixed:
Packit c32a2d
    @T =<one line of content in UTF-8 encoding>
Packit c32a2d
meaning of the @S stream info:
Packit c32a2d
Packit c32a2d
S <mpeg-version> <layer> <sampling freq> <mode(stereo/mono/...)> <mode_ext> <framesize> <stereo> <copyright> <error_protected> <emphasis> <bitrate> <extension> <vbr(0/1=yes/no)>
Packit c32a2d
The @I lines after loading a track give some ID3 info, the format:
Packit c32a2d
     @I ID3:artist  album  year  comment genretext
Packit c32a2d
    where artist,album and comment are exactly 30 characters each, year is 4 characters, genre text unspecified.
Packit c32a2d
    You will encounter "@I ID3.genre:<number>" and "@I ID3.track:<number>".
Packit c32a2d
    Then, there is an excerpt of ID3v2 info in the structure
Packit c32a2d
     @I ID3v2.title:Blabla bla Bla
Packit c32a2d
    for every line of the "title" data field. Likewise for other fields (author, album, etc).
Packit c32a2d
Packit c32a2d
Packit c32a2d
RESPONSE CODES
Packit c32a2d
--------------
Packit c32a2d
Packit c32a2d
Note: mpg123 returns errors on stderr, so your frontend should
Packit c32a2d
      look not only at stdout but also at stderr for responses.
Packit c32a2d
      It is a good idea to use --remote-err and just look at stderr.
Packit c32a2d
Packit c32a2d
@R MPG123 (ThOr) v7
Packit c32a2d
	Startup version message. Everything after MPG123 is auxilliary information about behaviour and command support, ID3v2 tag support is new in v3.
Packit c32a2d
Packit c32a2d
@I ID3:<c>
Packit c32a2d
	Status message after loading a song (ID3 song info)
Packit c32a2d
	a = title (exactly 30 chars)
Packit c32a2d
	b = artist (exactly 30 chars)
Packit c32a2d
	c = album (exactly 30 chars)
Packit c32a2d
	d = year (exactly 4 chars)
Packit c32a2d
	e = comment (exactly 30 chars)
Packit c32a2d
	f = genre (string)
Packit c32a2d
Packit c32a2d
@I ID3.genre:<number>
Packit c32a2d
@I ID3.track:<number>
Packit c32a2d
	Optional lines with additional ID3v1 info (if present): Genre ID and track number in set.
Packit c32a2d
Packit c32a2d
@I ID3v2.title:<text>
Packit c32a2d
	After loading a track with ID3v2 info, such lines occur for every line of the "title" data field and likewise for other fields (author, album, etc).
Packit c32a2d
Packit c32a2d
@I 
Packit c32a2d
			Status message after loading a song (no ID3 song info)
Packit c32a2d
			a = filename without path and extension
Packit c32a2d
Packit c32a2d
@I LISTENTRY <n>: <url>
Packit c32a2d
	printout of playlists loaded with LOADLIST
Packit c32a2d
Packit c32a2d
@S   ...
Packit c32a2d
	Stream info at beginning of playback, meaning
Packit c32a2d
	S <mpeg-version> <layer> <sampling freq> <mode(stereo/mono/...)> <mode_ext> <framesize> <stereo> <copyright> <error_protected> <emphasis> <bitrate> <extension> <vbr(0/1=yes/no)>
Packit c32a2d
Packit c32a2d
@S   <c> <d> <e> <f> <g> <h>  <j> <k> <l>
Packit c32a2d
	Status message after loading a song (stream info)
Packit c32a2d
	a = mpeg type (string)
Packit c32a2d
	b = layer (int)
Packit c32a2d
	c = sampling frequency (int)
Packit c32a2d
	d = mode (string)
Packit c32a2d
	e = mode extension (int)
Packit c32a2d
	f = framesize (int)
Packit c32a2d
	g = stereo (int)
Packit c32a2d
	h = copyright (int)
Packit c32a2d
	i = error protection (int)
Packit c32a2d
	j = emphasis (int)
Packit c32a2d
	k = bitrate (int)
Packit c32a2d
	l = extension (int)
Packit c32a2d
Packit c32a2d
@F   <c> <d>
Packit c32a2d
	Status message during playing (frame info)
Packit c32a2d
	a = framecount (int)
Packit c32a2d
	b = frames left this song (int)
Packit c32a2d
	c = seconds (float)
Packit c32a2d
	d = seconds left (float)
Packit c32a2d
Packit c32a2d
@P 
Packit c32a2d
	Playing status
Packit c32a2d
	a = 0: playing stopped
Packit c32a2d
	a = 1: playing paused
Packit c32a2d
	a = 2: playing unpaused
Packit c32a2d
Packit c32a2d
@E 
Packit c32a2d
	An error occured
Packit c32a2d
	Errors may be also reported by mpg123 through
Packit c32a2d
	stderr (without @E)
Packit c32a2d
	a = error message (string)
Packit c32a2d
Packit c32a2d
@J <n>
Packit c32a2d
	Jumped to frame n.
Packit c32a2d
Packit c32a2d
@RVA <mode>
Packit c32a2d
	Switched to specified RVA mode.
Packit c32a2d
Packit c32a2d
@V <volume>%
Packit c32a2d
	Set volume to specified value (float, percent).
Packit c32a2d
Packit c32a2d
@<x> : <y> : <z>
Packit c32a2d
	Set equalizer value z for band y of channel x.
Packit c32a2d
Packit c32a2d
@bass:  mid: <m> treble: <t>
Packit c32a2d
	Set simple equalizer control for bass, mid, treble.
Packit c32a2d
Packit c32a2d
@T <response from TAG command>
Packit c32a2d
	The output is multiple lines, begin marked by "@T {", end by "@T }".
Packit c32a2d
	ID3v1 data is like in the @I info lines, just with "@T" in front.
Packit c32a2d
	An ID3v2 data field is introduced via ([ ... ] means optional):
Packit c32a2d
		@T ID3v2.<NAME>[ [lang(<LANG>)] desc(<description>)]:
Packit c32a2d
	The lines of data follow with "=" prefixed:
Packit c32a2d
		@T =<one line of content in UTF-8 encoding>
Packit c32a2d
Packit c32a2d
Packit c32a2d
EQUALIZER CONTROL (History)
Packit c32a2d
---------------------------
Packit c32a2d
Packit c32a2d
WARNING: The interpretation of the command arguments changed. The channel is either 1 or 2 or 3 (left, right, both).
Packit c32a2d
It used to be 0 or 1 for left or right but the change slipped through during libmpg123 work and now it is a fact.
Packit c32a2d
Sorry.
Packit c32a2d
Packit c32a2d
Cold Feet Audio Patch for MPG123
Packit c32a2d
Packit c32a2d
10.07.2002
Packit c32a2d
Packit c32a2d
This is a dirty little hack to enable the equalizer in mpg123's
Packit c32a2d
generic_control interface.  It works like this, there are two
Packit c32a2d
different channels on the equalizer and 32 frequencys.
Packit c32a2d
Packit c32a2d
The hack just enables mpg123's built in equalizer to run real-time.
Packit c32a2d
We haven't built in any capability to save the eq, you're frontend
Packit c32a2d
will have to handle that part, and init the eq on the startup of
Packit c32a2d
mpg123.
Packit c32a2d
Packit c32a2d
K, it works like this:
Packit c32a2d
Packit c32a2d
#./mpg123 -R -  <---- This command will start mpg123 in 'frontend' mode.
Packit c32a2d
Packit c32a2d
If you want to send it some eq values you'd send it:
Packit c32a2d
eq X Y V[ENTER]
Packit c32a2d
Packit c32a2d
X = The channel.  It can be either 0 or 1.  I haven't put any error checking
Packit c32a2d
    in, so it probably wouldn't be a good idea to go out of bounds. (integer)
Packit c32a2d
Y = This is the frequency, it can be 0 to 31.  0 being closer to treble and
Packit c32a2d
    31 being closer to bass. (integer)
Packit c32a2d
V = The raw value of your equalizer setting.  I've found that the values work 
Packit c32a2d
    best between 0.00 and 3.00.  When mpg123 starts up, all of them are set
Packit c32a2d
    to 1.00.
Packit c32a2d
Packit c32a2d
OK, have fun!  If you have any questions or found some bugs, please contact
Packit c32a2d
nutcase@dtmf.org
Packit c32a2d
Packit c32a2d
Thanks,
Packit c32a2d
nut
Packit c32a2d
Packit c32a2d
Note by Thomas Orgis: The contact appears to be dead.