Order it now! Amazon prioritizes orders on a first come, first served basis.


View Full Version : mpg123 v1.6 for iLiad


ericshliao
12-19-2008, 04:57 AM
This is a console mode mp3 player. Because of its console mode user interface, it's fast and lightweighted, and easy to be controlled from contentlister.

There are two ways to control mpg123, one is from shell, and the other is from its "Generic Control Interface". The former is what I used in the package for illustration. The later is used to provide an interface to all frontends.
Ideally, using "Generic Control Interface" is a better way to control mpg123 from contentlister, but I don't know how. I still don't know how to do it, so I can only point this out and leave it for people to study.

How to install:
1. Download and unpack the attachment to dir "programs" of your SD/MMC, and then a dir "mpg123" will emerge.
2. put a mp3 in "mpg123" dir, rename it as "test.mp3".
3. The path is not mandatory, unpack it to anywhere should be working.

How to operate:
1. Tap "play music" from contentlister, wait for music play and then you can open your favorite book.
2. In the attachment, I provide an expample to play one mp3 file, and you can't stop, pause, control volume... more control commands can be added to shell script. But I would suggest people study how to control mpg123 via "Generic Control Interface".
3. After music played, it seems that mpg123 is still in idle process, so I can't play it once more, unless after reboot. It should be fixable by using proper command.

This man doc is well formated. See it here (http://www.debian-doc.org/man/1/m/mpg123-oss.html).

There are two attachments. Just download v1.6.3pre. It works fine for remote control interface. Thanx for Thomas' help.

Added:
I mistakenly removed some static lib from 1.6.3pre package. It's re-uploaded now.

ericshliao
12-19-2008, 05:41 AM
Below is command option of mpg123. FYI.

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.6.2; written and copyright by Michael Hipp and others
free software (LGPL/GPL) without any warranty but with best wishes

usage: .. [option(s)] [file(s) | URL(s) | -]

input options

-k <n> --skip <n> skip n frames at beginning
-n --frames <n> play only <n> frames of every stream
--fuzzy Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC)
-y --no-resync DISABLES resync on error (--resync is deprecated)
-p <f> --proxy <f> set WWW proxy
-u --auth set auth values for HTTP access
--ignore-mime ignore HTTP MIME types (content-type)
-@ <f> --list <f> play songs in playlist <f> (plain list, m3u, pls (shoutcast))
-l <n> --listentry <n> play nth title in playlist; show whole playlist for n < 0
--loop <n> loop track(s) <n> times, < 0 means infinite loop (not with --random!)
--keep-open (--remote mode only) keep loaded file open after reaching end
--timeout <n> Timeout in seconds before declaring a stream dead (if <= 0, wait forever)
-z --shuffle shuffle song-list before playing
-Z --random full random play
--no-icy-meta Do not accept ICY meta data
-i --index index / scan through the track before playback
--index-size change size of frame index
--resync-limit <n> Set number of bytes to search for valid MPEG data; <0 means search whole stream.

output/processing options

-o <o> --output <o> select audio output module
--list-modules list the available modules
-a <d> --audiodevice <d> select audio device
-s --stdout write raw audio to stdout (host native format)
-S --STDOUT play AND output stream (not implemented yet)
-w <f> --wav <f> write samples as WAV file in <f> (- is stdout)
--au <f> write samples as Sun AU file in <f> (- is stdout)
--cdr <f> write samples as raw CD audio file in <f> (- is stdout)
--reopen force close/open on audiodevice
-g --gain set audio hardware output gain
-f <n> --scale <n> scale output samples (soft gain, default=32768)
--rva-mix,
--rva-radio use RVA2/ReplayGain values for mix/radio mode
--rva-album,
--rva-audiophile use RVA2/ReplayGain values for album/audiophile mode
-0 --left --single0 play only left channel
-1 --right --single1 play only right channel
-m --mono --mix mix stereo to mono
--stereo duplicate mono channel
-r --rate force a specific audio output rate
-2 --2to1 2:1 downsampling
-4 --4to1 4:1 downsampling
--pitch <value> set hardware pitch (speedup/down, 0 is neutral; 0.05 is 5%)
--8bit force 8 bit output
-d n --doublespeed n play only every nth frame
-h n --halfspeed n play every frame n times
--equalizer exp.: scales freq. bands acrd. to 'equalizer.dat'
--gapless remove padding/junk on mp3s (best with Lame tag)
This is on by default when libmpg123 supports it.
--no-gapless disable gapless mode, not remove padding/junk
-D n --delay n insert a delay of n seconds before each track
-o h --headphones (aix/hp/sun) output on headphones
-o s --speaker (aix/hp/sun) output on speaker
-o l --lineout (aix/hp/sun) output to lineout
-b <n> --buffer <n> set play buffer ("output cache")
--smooth keep buffer over track boundaries

misc options

-t --test only decode, no output (benchmark)
-c --check count and display clipped samples
-v --verbose increase verboselevel
-q --quiet quiet mode
-C --control enable terminal control keys
--title set xterm/rxvt title to filename
--long-tag spacy id3 display with every item on a separate line
--utf8 Regardless of environment, print metadata in UTF-8.
-R --remote generic remote interface
--remote-err force use of stderr for generic remote interface
--aggressive tries to get higher priority (nice)
-T --realtime tries to get realtime priority
-? --help give compact help
--longhelp give this long help listing
--version give name / version string

See the manpage ..(1) for more information.

As to the "Generic Control Interface", here is some hint:
use "mpg123 -R" to start, and tranfer command through pipe.

ericshliao
12-19-2008, 08:41 AM
use this command to scan a directory for mp3 recursively and play randomly:
find your_mp3_dir ./ -name "*.mp3" | mpg123 -Z -@ -

I learned from here (http://dannyman.toldme.com/2004/12/28/howto-mpg123-random-mp3s/)

ericshliao
12-19-2008, 12:55 PM
I tried to execute the following command in console:
mkfifo /tmp/pipe
mpg123 -R < /tmp/pipe &
echo "load test.mp3" < /tmp/pipe &
From the output on screen, it seems that the command "load test.mp3" was actually sent to mpg123. mpg123 did load the mp3 file and print ID3 tag contained in the mp3 file. Then, mpg123 stopped. What's the problem? :blink:

-Thomas-
12-19-2008, 04:06 PM
The FIFO control doesn't work on my PC either, but if you compile it with --enable-fifo=yes, then you can do the following:mpg123 -R --fifo /tmp/fifo &
echo "load file.mp3" > /tmp/fifo

ericshliao
12-19-2008, 04:12 PM
Ah! thanx for this info. But it's strange. According to help info, fifo should be auto enabled on Linux. Anyway, I'll give it another try.

ericshliao
12-19-2008, 04:26 PM
I have checked it. Compile option "fifo" is auto enabled.
Which mpg123 version are you using on your PC? It seems that command option "--fifo" is not available for v1.62.

Added:
I was wrong. I should use "mpg123 -R --fifo /tmp/fifo &" instead of "mpg123 -R --fifo=/tmp/fifo &". It works now.
Thanx again.

-Thomas-
12-19-2008, 07:20 PM
I'm using version 1.4.3. The syntax you posted is right, I just corrected the little typo in my post.

Finally, was fifo support really auto-enabled or did you set the option manually? And why didn't --fifo show up in the command options?

ericshliao
12-20-2008, 03:09 AM
Finally, was fifo support really auto-enabled or did you set the option manually? And why didn't --fifo show up in the command options?

I guess it's a bug in mpg123's configure script. In the final report produced by configure, it showed that fifo was enabled even though I didn't manyally enable it. But it's not actually enabled until manually enabled. That's why "--fifo" command option not shown.