First things first...

Before doing anything else, make a backup of your Audrey. You can do this even if you don't have a CompactFlash card. If you mess up your Audrey, you can always go buy a card and a reader, and restore any backups you have made.

To make a backup:

The .cf image contains the filesystem, and the .ipl image contains the image loader code. You generally don't want to overwrite the image loader code on a restore, which is why it is backed up separately. You can always concatentat the .cf and .ipl files together later if you want to restore both the filesystem and image loader code.

Running shell scripts from SystemPanel

Here is a little utility (execv.zip) that allows you to execute shell scripts from the SystemPanel.init file and other locations where only executable images are allowed. To use it:
  1. put the execv file in /nto/bin and chmod +x execv
  2. put your shell script in /somewhere/shell_script.sh
  3. make a symbolic link from /somewhere/shell_script to execv
    ln -s /nto/bin/execv /somewhere/shell_script
  4. Then call /somewhere/shell_script from SystemPanel.init, and it will start up /bin/sh to execute /somewhere/shell_script.sh
The way it works is it adds ".sh" to the command name, and then uses the execv() function to run /bin/sh on this file, passing in the original command line arguments, if any.

MP3 playing

Here is a method that plays mp3s on the Audrey reliably without skips: Use phplay to stream the files from a local web server. This seems to work quite well, and works much better (for me, anyway) than using fs-cifs.

Note: phplay has problems playing 96kbps joint-stereo files that I generated using MediaMatch. I'm not sure which factor is to blame, but 112kbps joint-stereo files generated using other MPEG encoders play fine.

The way I did this was:

  1. make a set of .qpl playlist files for phplay. The create_playlists.pl file is a Perl script that will create the .qpl files for all of your directories. Run this script from what will be the base directory of your web server using the syntax "perl create_playlists.pl [basedir] [baseurl] [outputdir]" where basedir is the directory to index (use "."), baseurl is the address of your local web server (e.g. "http://192.168.0.1/" with the trailing slash), and outputdir is the directory where the .qpl playlist files will be stored. See http://www.activeperl.com for a Windows version of Perl.
  2. copy the generated .qpl files to the /nto/photon/.ph/playlist directory. You could also replace the "playlist" directory with a symbolic link to a share mounted using fs-cifs from your PC if you want to store all of the playlists on the PC and save the space on the Audrey. Storing them on the PC makes it easier to regenerate all of the playlists when necessary, but phplay loads the playlists more slowly.
  3. run a simple web server on my desktop PC serving up all of my mp3 files. Any web server should work, but I used Microsoft's sample HTTPSRV program, modified to disable the CGI support and restrict connections to the local network for security reasons, and to minimize to the system tray. Hint with the httpsvr program: save your configuration to default.hsc, and then make a shortcut in Programs..Startup to run "httpsvr default.hsc" minimized on startup.
  4. run phplay and select the "View..Edit Playlists" menu command. You will see all of the playlist files, and you can select one and press the "Activate Playlist" button to play the album.
The files are at http://www.geocities.com/mp3_playlists.zip

Improving mp3 streaming (my take)

The problem with mp3 stuttering seems to be caused by the mpegaudio program always forcing its priority back to 10, regardless of what you set it to. I've found that if I hack up the mpegaudio program so it calls "getprio" instead of "setprio", the program will run, and won't mess with its priority settings. Once you make this change, then you can run "nice -n-5 phplay" to start phplay, and mpegaudio will run and stay running at priority 15 instead of 10. On my audrey at least, this completely gets rid of the stuttering playback when streaming through HTTP!

Here is a zip file containing the hacked up phplay and mpegaudio programs: mp3fix.zip (QNX6.0 versions)

Replace your phplay and mpegaudio executables with these (be sure to chmod +x them) and then run "nice -n-5 phplay" to start phplay at an increased priority. It should stay there, and if you run "pidin" you should see the priority shown as 15r instead of 10r like it was before the hack. Here are the nice and renice executables if you don't have them already:: nice.zip

For more details, see the full description.

PhMAD

Also, here is the phmad executable compiled for QNX6.0, which will run on the Audrey if you have the proper QNX6.0 libraries available. I modified the code so that it double-buffers the input, so delays reading from fs-cifs shares don't cause pauses in the audio playback. This plays very smoothly on my machine, but it takes a lot of CPU power (more than phplay) which makes the other applications very sluggish. phmad_dbuf.zip

cmp and iscmp scripts

Here is my version of the cmp script. This one allows you to do "cmp <filename>" or "cmp *", and do "cmp -d <filename>" to decompress.
#!/bin/sh

if [ "$1" == "" ] ; then
  echo "usage: cmp       to compress"
  echo "       cmp -d    to decompress"
  exit
fi

if [ "$1" == "-d" ]; then
  shift
  while [ "$1" != "" ]; do
    echo decompressing $1 ...
    flashlzo -d "$1"
    shift
  done
else
  while [ "$1" != "" ]; do
    echo compressing $1 ...
    cp "$1" "/tmp/z-$1"
    flashlzo "/tmp/z-$1"
    mv "/tmp/z-$1" /.cmp$PWD
    mv "z-$1" "$1"
    shift
  done
fi

And an iscmp script, which reports the uncompressed and compressed sizes:
#/bin/sh

while [ "$1" != "" ]; do
  size1=`ls -l "$1" |cut -c32-44`
  size2=`ls -l "/.cmp$PWD/$1" |cut -c32-44`
  echo "$size1 $size2 $1"
  shift
done

Getting full QNX filesystem

If you copy the full QNX filesystem onto your PC, you can use fs-cifs to mount those files on your Audrey.
  1. Download the QNX6.0 ISO image from www.audreyhacking.com
  2. Install QNX6.0 onto your PC. It works well to install it to a file on the Windows partition
  3. After setup of QNX is complete and running, log in as root
  4. Run the Package Manager and install RealPlayer and X-Windows, and any other extra packages you want to use on the Audrey
  5. Run these commands. When you do the ls command you should see the contents of your Win9x root directory. If not, then the Win9x filesystem didn't get mounted automatically and you will have to figure out how to get it mounted, probably using the "mount" command.
    cd /fs/hd0-dos
    ls
    mkdir qnx
    cd /
    cp -rD bin boot etc home lib nto opt root sbin usr var /fs/hd0-dos/qnx
    
  6. Reboot back into Windows, and share the c:\qnx directory as "qnx" with password "qnx"
  7. On the Audrey, mount this windows share using the command
    fs-cifs //winpc:192.168.0.1:/qnx /qnx guest qnx
    where winpc is the network name of your PC, and 192.168.0.1 is the local IP address. It would be useful to add this to the /kojak/boot.sh script so that this gets mounted on boot. If you do so, put a sleep 10 command before it so the Audrey has a chance to initialize the network, and add an ampersand (&) at the end of the sh boot.sh & line in the /kojak/go script so that the sleep and fs-cifs commands get run in the background, and don't delay the bootup.
  8. Make links from the Audrey to the files on the PC using the commands
    cd /
    ln -s /qnx/lib .
    ln -s /qnx/opt .
    cd /usr
    ln -s /qnx/usr/X11R6 .
    ln -s /qnx/usr/photon .
    ln -s /qnx/usr/share .
    mkdir lib
    cd lib
    ln -s /qnx/usr/lib/* .
    
    (note: ldqnx.so.1 already exists, and link will fail. That is OK because that file is a special link.)
  9. Set the environment variables as follows. It may be useful to set these in /kojak/go so they are always set
    export PATH=$PATH:/qnx/bin:/qnx/usr/bin:/qnx/usr/photon/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/qnx/lib:/qnx/usr/lib
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/photon/lib:/usr/photon/dll
    

Full RealPlayer

You can run the full RealPlayer on the Audrey using the following steps:
  1. Follow the procedure above to get the full QNX 6.0 file set mounted under /qnx on the Audrey
  2. Set up links from the Audrey to these files using the commands:
    cd /usr
    mv real real.orig
    ln -s /qnx/usr/real .
    
  3. Now you can run RealPlayer using /usr/real/bin/realplay
    Warning1: the kojak-realplayer used by the Browser uses the same plugin directory as the full RealPlayer. If you have too many RealPlayer plugins, it may make the kojak-realplayer fail.
Warning2: the startup speed and amount of memory required for RealPlayer will depend on the number of plugins in the /usr/real/plugins directory, so it is best to remove any plugins you won't need. If you leave them all in that directory RealPlayer probably will run out of memory. I got my favorate locations to play with just the following plugins:
httpfsys, rarender, rmffplin, rstlplin, sdpplin, smlffpln, smlrendr, smplfsys, xlibsite, pxcjpeg2, pxjpgff, pxjpgrnd
The px* files were only needed because one station insists on putting their logo up in the video window as a bitmap.

Slide show

Here is a perl script to create .html files for a slide show. Run the script in the directory containing all of your images using the command "perl create_slideshow.pl". To run this script you will need Perl installed. For Windows, see http://www.activeperl.com)

The first image of the slideshow is "index.shtml" so that it will run from one of the Audrey channels.

Once you have the html files generated you can put them and the JPEGS somewhere where the Audrey can access them. A good option is to mount a PC's share using fs-cifs
(e.g. fs-cifs -a //Tiger:192.168.0.3:/audrey_share /share guest guest )
You can get this to mount automatically on boot-up by putting it in your /kojak/go script. In /kojak/go, change the "sh boot.sh" line to "sh boot.sh &" (add the ampersand at the end). This makes the boot.sh script run in the background so it doesn't hang your Audrey if something goes wrong with the fs-cifs command. Then add a "sleep 10" line followed by the "fs-cifs" line to the /kojak/boot.sh script. The "sleep 10" is required to allow the network to be set up before it attempts to mount the PC share. You should also comment out all of the "ln" lines in boot.sh if you haven't done so already, so that your changes to the channels don't get cleared on reboot.

To make the slideshow run on the countertop when the Audrey starts up:

You can also make a channel run the slideshow:

Full Voyager Mail

If you leave the messages on the server, but then delete them locally, it re-downloads them from the server for some reason. May be my ISP that is causing this problem. IMAP mode seems to work OK. It also will be missing some fonts. You can copy over the fonts from the QNX6 filesystem, although you don't need them all. I copied all of the 8, 10, and 12 point fonts, and set up the fontdir and fontmap files appropriately, and then the font display in vmail was great.
Hosted by www.Geocities.ws

1