Version 0.1
01/03/99
rawrapper-0.1.tar.gz
RaWrapper is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2
RaWrapper is a simple program which allows to control X11-based audio stream players, like RealNetwork's RealPlayer, from the command line, without the necessity of having a regular X server running. RaWrapper is inspired by Toby Reed's <toby@eskimo.com> Traplayer v0.5 available at:
ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/traplayer-0.5.tar.gz
Launching the audio player itself is a fairly simple task by using the virtual framebuffer X server Xfvb from XFree86:
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/Linux-ix86-glibc/Xvfb.tgz
or
ftp://ftp.xfree86.org/pub/XFree86/3.3.3/binaries/Linux-ix86-libc5/Xvfb.tgz
The actual problem in controlling the player is to detect whether the player is playing the audio properly or not, so that in case it doesn't the player can be killed.
The problem I found with Traplayer is that it is doing this detection by using the error code of a 'head -c 1 /dev/dsp', i.e. if the audio player is playing, the 'head' command will return an error, since /dev/dsp can be opened by only one process at a time. This caused a problem from time to time, if the audio player was trying to open /dev/dsp in the exact time between the head's open and close, so that the audio player complained with a message "audio device not accessible".
Besides the fact that Traplayer is a shell script and RaWrapper is written in C, RaWrapper takes also a different approach in detecting whether the player is idle. Via the means of the /proc pseudo file system, RaWrapper monitors the audio player's number of used file handles and consumed cpu time.
If the number of open file handles is not what it is usually, or the cpu time is zero, the audio player is killed after a certain amount of timeout seconds.
The package rawrapper-0.1.tar.gz consists of the following files:
COPYING- GNU General Public License v2 README- This file Makefile- Simple Makefile for easier compilation rawrapper- A binary for Linux i386 rawrapper.c- The C source file
Usage: rawrapper [option] location Options (defaults shown in parentheses): -h show usage -v verbose -display <string> display for audio player (localhost:2.0) -d <int> display number (2) -xp <filespec> Xvfb path (/usr/X11R6/bin/Xvfb) -fp <dirspec> font path (/usr/X11R6/lib/X11/fonts/misc) -s <string> screen size (360x200x8) -fn <name> default font (7x14) -rp <filespec> audio player path (/opt/rvplayer5.0/rvplayer) -fd <int> fd count when playing (9) -to <int> time out in seconds (60)
-h-v-display <string>-d Is supposed to be used to specify a different display
number in case 2-xp <filespec>-fp <dirspec>-s <string>-fn <name>-rp <filespec>-fd <int>-to <int>0 - Termination without error.
1 - RaWrapper received a SIGTERM, or SIGINT.
2 - RaWrapper terminated with a timeout.