fische 4 user guide

There’s a notorious lack of documentation when it comes to running fische. I know that, and this is an attempt to improve.

This is going to be very Linux-specific, as I have close to no knowledge of Windows, and only some of OS-X. I would very much appreciate contributions of people who know.

Running fische itself is not exactly difficult. Basically you just type “fische” in a terminal and hit Enter. However when you do this, the program quits as soon as it realizes it does not have any data to process. This is normal behaviour.

Obviously, fische needs input data. Or how would you visualize music without music?

Data is fed to fische via its standard input. This means you need to pipe it into fische from some program that produces sound data like so:

data_producing_program | fische

Now, what’s a “data producing program”?

In theory – and it turns out, also in practice – you can feed a PDF document, an executable file or a jpg image into fische. The output is totally nonsensical, but this works:

cat my_document.pdf | fische
cat /dev/urandom | fische

You will see fische doing something. Nothing of interest of course. The program has no way of telling whether the data you are providing is in fact sound data. It just assumes you are not lying.

How to get real sound data?

That’s the tricky part. When I started writing fische many years ago, sound cards used to have a monitor device – one that enabled the user to record “what’s playing”. Nowadays, DRM-crazyness has led to soundcards that may have half a dozen of HDMI outputs, but absolutely no (native) way of recording the output stream.

It is often much easier to record from a line in connection or a microphone.

fische needs data in 2-channel 16-bit signed integer format. If you have never heard of such a thing, don’t worry. This format was chosen because it likely is the most widely supported one, and also the native format of CDs and many sound cards. (PS: You can probably get away with just one channel, but the bitness is important!)

Rule of thumb #1: if you can record an audio stream, you can also pipe it to fische.

Rule of thumb #2: if the animation looks a lot like the /dev/urandom example above, or the screen stays black, something is wrong.

Generally speaking, sox is often a good starting point. It records or converts just about any stream or file, and it can write all that to standard output. if you haven’t tried that yet, try:

sox -d -c2 -b16 -traw - | fische

If that doesn’t work – and it often doesn’t – you will have to do some research. Linux distributions know a handful of sound systems. Ralf has posted instructions for Pulseaudio in a comment below. For ALSA, Google produces a numer of hits. If you know of procedures for JACK or OSS, please send me an email!

Personally, I use an alsa aloop dummy soundcard, the above sox command and this .asoundrc:

pcm.!default {
  type asym
  playback.pcm "plug:both"
  capture.pcm "hw:1,1"
}

# physical intel_hda sound card
pcm.hwcard {
  type dmix
  ipc_key 1024
  slave {
    pcm "hw:0,0"
    period_size 1024
    buffer_size 4096
    rate 44100
    channels 2
  }
}

# dummy aloop card
pcm.aloop {
  type dmix
  ipc_key 1025
  slave {
    pcm "hw:1,0"
    period_size 1024
    buffer_size 4096
    rate 44100
    channels 2
  }
}

pcm.both {
  type route
  slave.pcm {
    type multi
    slaves.a.pcm "hwcard"
    slaves.b.pcm "aloop"
    slaves.a.channels 2
    slaves.b.channels 2
    bindings.0.slave a
    bindings.0.channel 0
    bindings.1.slave a
    bindings.1.channel 1
    bindings.2.slave b
    bindings.2.channel 0
    bindings.3.slave b
    bindings.3.channel 1
  }
  ttable.0.0 1
  ttable.1.1 1
  ttable.0.2 1
  ttable.1.3 1
}

One thought on “fische 4 user guide

  1. Nice program.
    Maybe you want to add this to your documentation:
    Using Fische with pulseaudio.
    Find the monitoring device of your soundcard:

    pacmd list | grep “.monitor”

    you get something like this:

    alsa_output.usb-Creative_Technology_Ltd_SB_Audigy_2_NX-00-NX.analog-stereo.monitor

    Then you can feed the fish:

    pacat -n fische -r -d alsa_output.usb-Creative_Technology_Ltd_SB_Audigy_2_NX-00-NX.analog-stereo.monitor | fische

    Greetings
    Ralf

Comments are closed.