There is an enormous amount of PC hardware available. Getting it working can be difficult whatever operating system you have. This document aims to cover the Linux-related problems you might encounter while using the abc music notation system on a GNU/Linux system. Because most of the abc programs convert abc notation to another file format, they tend to run without any problems. You are much more likely to run into problems when you want to hear your music or see it on-screen or printed out.
This document assumes you already know how to use abc notation and instead focuses on getting things up and running on your GNU/Linux system. If you need to know more about abc notation itself, you should consult the abc home page.
The traditional unix way of supplying a program for do-it-yourself installation is as source code in a compressed archive. This is uncompressed and a directory structure is retrieved from the archive. The source usually comes with a file called README or something similar containing further instructions. Typically typing make will compile the program and create an executable which you need to put in a directory on your path in order for it to become usable as a regular command.
In order to use a sound card, you need to install a kernel module or modules to handle it. Red Hat Linux provides a utility called sndconfig which may be able to do this automatically provided that it knows about your particular sound card. If this doesn't work, you will have to resort to installing the modules by hand, as described below.
First, you should check that you are using a relatively recent kernel (preferably 2.2 or newer). The command uname -a will report the kernel version. You then need to find out what address and interrupt your sound card uses. If your card follows the 'Plug and Play' scheme, you may find that the file /etc/isapnp.conf contains this information and the utility isapnp will probe your card for the same information. Here are 2 examples of how to set up sound:
modprobe mpu401 irq=9 io=0x330Once that is installed, I can play a MIDI file 'test.mid' with
playmidi -e test.midIf I shutdown Linux, I lose this configuration, so I want to arrange for the module to be loaded every time the system boots. To achieve this, I created the following file sound in directory /etc/modutils/.
options mpu401 irq=9 io=0x330Then I ran update-modules which transfers the contents of this file to modules.conf.
All this does is define the options that mpu401 takes. To load up the module on system startup, I added a file /etc/rc2.d/S21sound containing the line :
modprobe mpu401I also found that playmidi could only be run by root because of permission problems. To solve this, I executed the following commands:
chgrp audio /usr/bin/playmidi chmod 2755 /usr/bin/playmidiThis puts playmidi executable in the same group as the sequencer device /dev/sequencer and make the executable run with those group permissions.
modprobe mpu401 modprobe opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=5 dma=0 dma2=7 modprobe opl3 io=0x388 modprobe ad1848 playmidi test.midThe list of modules to install came from the sound section of the kernel module documentation and the parameters were deduced from the contents of /etc/isapnp.conf.
The startup files on this system live in /etc/rc3.d and there is already a symbolic link called S85sound which points to /etc/init.d/sound. I created this file containing suitable modprobe instructions.
Your setup will almost certainly be different to mine, so don't expect the above commands to work for you. If you install the correct modules but with the wrong parameters, you will probably find that your sound card stays silent and offers no clue as to what went wrong. If you tinker with the scripts in /etc/rcN.d and get things horribly wrong, your system may not boot up correctly at all, leaving with the problem of how to recover! For this reason, running a script to install your sound drivers is a safer option than installing them on system startup.
Documents to consult:
In the HOWTO collection (stored in /usr/doc/HOWTO/en-txt/ on my Debian system) :
http://www.linuxprinting.org/My printer is a Lexmark 1000, which is not listed as having as driver in the HOWTO, but for which I was able to find a driver at the above website. I downloaded and compiled this driver.
To get printed output, I loaded a parallel port driver into the kernel with
modprobe parportThis drives the parallel port (/dev/lp0 in my case). I am then able to print by creating a script with the following command:
gs -q -sDEVICE=ppmraw -r300 -sPAPERSIZE=a4 -dNOPAUSE -dSAFER \ -sOutputFile=- $1 | lm1100 - > /dev/lp0The program lm1100 is the printer driver that I downloaded. The script invokes gs (the ghostscript interpreter) to generate PPM images, which are processed by the filter before being sent to the printer. $1 is the name of the file to be printed.
Ideally, I'd want to arrange things so that I could use lpr, the print spooling command. Red Hat Linux has a tool called 'printool' which sets this up, but which unfortunately doesn't know about my printer and driver.
Two important references for printing are the printing HOWTOs: