[Back to overview]

catloop --help

catloop (version 0.8 of frankl's stereo utilities)
USAGE:
  catloop --block-size=<bsize> <file1> <file2> [<file3>..]

  This program 'catloop' reads data cyclically from files <file1>, ... 
  and writes the content to stdout. 

  USAGE HINTS
  
  This can be used together with 'writeloop' which does the converse
  (reading from stdin and writing to files cyclically).

  The given files should be on a ramdisk. writeloop/catloop provide
  a buffer for data read from a hard disk or from the network.

  Alternatively, shared memory can be used instead of files via
  the --shared option. In this case the convention is to use filenames
  with empty path but starting with a slash.
  
  OPTIONS

  --block-size=intval, -b intval
      the size in bytes of the data chunks written to stdout.
      Default is 1024 bytes.

  --shared, -s
      use named shared memory instead of files. For large amounts of shared 
      memory you may need to enlarge '/proc/sys/kernel/shmmax' directly or
      via sysctl.

  --verbose, -v
    print some information during startup.

  --version, -V
      print information about the version of the program and abort.

  --help, -h
      print this help page and abort.

  EXAMPLE
  
  If you want to play an audio file (CD format) on a hard disk or on a 
  network file system, you can use writeloop and catloop as a buffer:

       sox /my/disk/cd.flac -t raw | writeloop --block-size=4000 \
                --file-size=20000 /ramdisk/aa /ramdisk/bb /ramdisk/cc &

  and 
       catloop --block-size=1000 /ramdisk/aa /ramdisk/bb /ramdisk/cc | \
             aplay -t raw -f S16_LE -c 2 -r44100 -D "hw:0,0" 

  Or similarly, using less system resources, with shared memory:

       sox /my/disk/cd.flac -t raw | writeloop --block-size=4000 \
                --file-size=20000 --shared /aa /bb /cc &

  and 
       catloop --block-size=1000 --shared /aa /bb /cc | \
             aplay -t raw -f S16_LE -c 2 -r44100 -D "hw:0,0" 

     
  In experiments I found that audio playback was improved compared to a 
  direct playing. For larger file sizes (a few megabytes) the effect was
  similar to copying the file into RAM and playing that file.
  But even better was the effect with small file sizes (a few kilobytes)
  such that all files fit into the processor cache.