pmaplay is a rudimentary MP3 stream player for the Archos
PMA430.
By rudimentary I mean
that it has an impoverished user interface, no proxy or authentication
support,
and limited error reporting, among other things.
pmaplay is designed to play ShoutCast and IceCast
streams. These streaming formats are widely
used by Internet radio operators. It may play other streams that are
MP3-based as well, but I can't make any promises.
pmaplay has elementary
support for ShoutCast playlist files (.pls files), and can be
integrated with the Opera Web browser to play these files through
the browser. This means, for example, that you can click on any `Tune in' link
on the ShoutCast home page (www.shoutcast.com), and get playing
immediately (with a bit of luck).
Documents directory and run the
package manager). You should find an icon for the program on
the Application tab of the Launcher. Needless to say, you'll need to
make sure you have a working Internet connection from the PMA
before trying to play a stream.
pmaplay supports other bookmark operations (but don't
hold your breath...). At present,
the user interface provides no mechanism to delete or organize
bookmarks.
pmaplay can play streams defined in ShoutCast playlist (.pls)
files.
Most websites that provide access to ShoutCast streams do so by linking
to one or more .pls files. These files can, in principle, reference
multiple streams but, in practice, few do. Consequently, pmaplay
will only play the first stream referenced in the file.
pmaplay when you select a .pls file. From the
Opera `Preferences' menu, select `File types'. Click the button
`Add new MIME type'. For the type, enter `audio/x-scpls'. Then choose
`Use external program', and enter the program name pmaplayui.
The click `OK'. That should do the trick.
# pmaplay_feeder [url]For example:
# pmaplay_feeder http://64.236.34.196:80/stream/2008
pmaplay has four major parts:
pmaplay_feeder) which slurps up data
from the server by HTTP, and feeds the decoder. This component communicates
stream data (title, etc) with the graphical user interface.
Communication is through a file /tmp/pmaplay.log, which is
cleared whenever a new stream is selected, and then written as
IceCast headers are retrieved from the server. The format of this file is
understood by the user interface. The feeder invokes the decoder internally,
and feeds the stream data into its standard input channel through
an anonymous pipe.
pmaplay_madplay). This is based on
madplay, which in turn is based on the MAD decoder
library. To reduce CPU load, MAD is compiled for speed rather than
accuracy. I have therefore linked the MAD library directly into the
decoder so it doesn't interfere with any other version of MAD you
may have installed. The madplay version used in this
project is pared to the bone to reduce memory size and CPU load, and
most of its usual features are absent. In particular, I have removed
all the audio output and file handling features. The audio output
doesn't work on the PMA430 anyway, and no file handling is needed since
the stream feeder pipes the data into the decoder directly.
pmaplay_bplay). This takes
decoded audio samples from the decoder, buffers them, and feeds the
the PMA's audio driver. In fact, the sample player consists of
two processes, a reader and a writer, communicating through
shared memory blocks.
pmaplayui) to tie all
the other parts together
pmaplay have either been written
specifically for the application, or are heavily modified versions of
open-source projects. Because there is considerable scope for these
modified versions to clash with unmodified versions that may already
have been installed on the PMA, everything is statically linked.
There should therefore be no dependencies on other packages.
As every file installed by the installer has a name that begins
with `pmaplay', there should be little scope for bits of this
program to clash with other things.
pmaplay uses
a relatively complex system of inter-process communication to
improve throughput. When you change streams, all these processes have
to be torn down and new ones established. Then the new stream has to
be pre-buffered to allow for intermitted transmission.
This will usually take a
second or two. If you click on a bookmark and nothing happens, please
wait a second or two before clicking again. If you see ``(busy...)''
in the title bar, the program is thinking. Note that stream information
(title, etc) may not appear for a few seconds after playback starts.
This is normal -- the user interface only checks for new information from
the stream feeder every three seconds.
pmaplay_bplay: semget: No space left on deviceThis error message is caused by the sample player not tidying up semaphores correctly. At present, I'm not sure whether the limitation is in the software or in the PMA's Linux implementation. I don't see the same problem when running this sofware on a workstation, so I'm inclined to suspect the latter. I'm not even sure what circumstances cause the problem. In any event, the PMA doesn't have the software built in to tidy up semaphores, so the only solution is to reboot. If you experience this problem, please let me know.
pmaplay, because like all Qtopia applications it
doesn't get a taskbar icon when it is launched this way. This means that
if you switch to a different application while pmaplay is
running, you won't be able to get back. I should stress that this is
a consequence of the way Opera works, and not something that can be
corrected in pmaplay. If you use this software to play
a .pls file through Opera, make sure you close pmaplay
before switching back to Opera or another application. If you forget,
there is a last desparate measure you can take, which is to shutdown
pmaplay from the console. Get a console prompt, and
type:
# pmaplay_kill
pmaplay will play most 128 kbits/sec, 44,100 Hz streams without
too much clicking provided you're not doing anything else. This
only applies if the stream itself is stable, that is, capable of delivering
data at a more-or-less constant rate. If you want to play streams with
higher sample rates or bitrates, or you want to multitask, you should
consider downsampling. To enable downsampling, select the
`Downsample' option from the `Settings' menu. The effect is to
reduce the sample rate of all streams to 22,050 Hz. Because the sample
buffer stays the same size, this means that it takes twice as long
for the audio output buffer to run out of data, so it can tolerate
somewhat longer pauses in sample delivery. With downsampling,
you should general get click-free operation (provided that the source
is not generating its own artefacts), even with limited multitasking.
However, the trade-off is that the overall sound quality will
be degraded.
pmaplay
can be configured to prevent the PMA430 going to sleep. To do this,
select `Delay suspend' from the `Settings' menu. In order to prevent
the battery being drained, this mode is self-cancelling after one hour,
upon which the PMA will suspend if there is no user activity.
pmaplay buffers about 10 kB of data from the source, which
is enough to accomodate a pause in transmission of a few seconds, depending
on the bitrate. If the playback breaks up completely, most likely
the bottleneck is in the source or the network infrastructure, rather
than this software.
pmaplay.
pmaplay gets as
far as displaying a
stream name and bitrate on the `Info' page, but no sound is playing,
most likely the server is active, but transmitting silence. This
is not a bug :)
pmaplay,
please include the following information in your report.
0.01h -- March 2005:
* Added a `delete bookmark' menu option
* Added facility to defer going into suspend mode
* Reluctantly modified the program to use the standard Qtopia
method of saving settings. The PMA overwrites the files in
/media/pda/Settings on a shutdown, so reading and writing this
area directly is fruitless
0.01g -- March 2005:
* Set pre-buffering size to 32kB for all bitrates
* Converted mono streams to stero by duplication, to avoid problem
with PMA430 audio hardware (selecting mono operation on the
audio driver causes the hardware to product no output at all)
0.01f -- March 2005 -- first public release
pmaplay is distributed according to the GNU Public Licence.
In short, you may do whatever you wish with this code, provided that the
original authors continue to be acknowledged, and source code is made
available. If you would like the source code for this software,
please ask me.
Please send bug reports, suggestions for new features, etc.,
to me.
©1994-2006 Kevin Boone, all rights reserved