Free Download
Order OSS
OSS Forum
Technical Support
Contact 4Front
OSS Programming
Sound Card Support
Application Support

4Front Virtual Synthesizer (SoftOSS)


Until today a special wave table soundcard has been required to play high quality MIDI music. SoftOSS by 4Front Technologies is a kernel module which permits doing the same using any inexpensive16 bit soundcard together with a sufficiently fast CPU (see the System requirements section).

SoftOSS is 100% compatible with the existing wave table API of OSS which has earlier been used by the Gravis Ultra Sound (GUS) driver. This means that all Linux applications work without modification with SoftOSS.

Technical Background

SoftOSS is a virtual wave table engine that is tightly integrated with MIDI and audio functionality of OSS. SoftOSS engine uses CPU cycles to mix prerecorded audio samples in control of MIDI information coming from any application using /dev/sequencer or /dev/music (formerly known as /dev/sequencer2) device files. The resulting 16 bit stereo audio data stream is then played using an ordinary (16 bit) soundcard (support for 8 bit soundcards will be introduced later).

Since the mixing is done inside kernel it doesn't suffer from other processing activity in the system. For this reason it is possible to perform CPU intensive tasks at the same time when using SoftOSS. Sound quality is as good as in a lightly loaded system (other tasks just run slower depending on number of currently active SoftOSS voices/notes).

SoftOSS is fully compatible with the sound sample loading API originally developed for the GUS driver of OSS. This means all applications which support loading samples to GUS will work with SoftOSS without any changes.

OSS includes a library called OSSlib which permits "on demand" loading (aka patch caching) of wave table samples from any programs using the /dev/music (/dev/sequencer) API of OSS. Together with changes made to sys/soundcard.h this library permits adding patch caching to existing applications using /dev/sequencer and /dev/music with very minimal changes.

First release of this OSSlib library will permit loading samples from .PAT format (GUS) instrument files and from standard audio files (.au, .wav). Later versions will support other patch file formats such as SoundFont (.sf2). You will need the GUS compatible patch set to run SoftOSS.

A freeware version of this library has been released too to permit developing OSS compatible applications with OSS/Free. In addition the freeware library will permit using applications written for OSS to work also with OSS/Free without recompiling.

Specification of new /dev/music API will be released after development of OSSlib is complete.

Applications of SoftOSS Technology

SoftOSS is mainly designed for playing MIDI music but it's well suited for some other applications too, including:
  • Sound effects in games (not necessarily background music). Since the "mixing" is done at real time priority inside kernel, it's possible to get timing precision and reliability that is not possible with any kind of process based mixing. With SoftOSS sound effects will play perfectly even in slightly underconfigured machines. In addtion sound effects programming using SoftOSS and OSSlib is "fire and forget". After an effect is started the application itself doesn't need to worry about it. Of cause the same is possible with a wave table card too. The best thing is that SoftOSS is perfectly compatible with hardware wave table devices so compatibility with SoftOSS ensures compatibility with wave table cards too.
  • Sound effects in simulators and similar applications. SoftOSS technology permits loading practically unlimited amount (currently there is an artifical limit of 8M) into the memory (it's limited just by amount of RAM installed in the system). Starting sounds is easy and it's even possible to change it's volume and panning (3D support planned in future). As with games SoftOSS can later be replaced by a hardware wave table card without any changes to the application. However with limited number (4 to 8) of simultaneous voices there is no benefit in using an expensive hardware wave table card.
  • Playback of prerecorded messages, alerts, time signals and similar sounds. Future versions of SoftOSS will even permit triggering this kind of special sounds from many different applications at the same time.

System Requirements

Due to high processing power requirements of "software mixing" SoftOSS is targeted to fast machines only. With current (rather nonoptimized) version it's possible to play 32 simultaneous voices using 32 kHz sampling frequency using a P120 machine (figures for PPro200 are not available yet). However even this is better than the sampling frequency that is possible at 32 voices using a popular wave table card (19.2 kHz). With a 100 MHz PowerPC processor (RS6000/AIX) it's possible to get almost 32 simultaneous voices at 44.1 kHz.
  • For the above reason at least a P120 processor is recommended. However one can use SoftOSS with any 486 class (or above) machine by decreasing the sampling frequency. OSS 3.8 permits selecting a SoftOSS version which matches your CPU while configuring the device.

CPU power requirements of SoftOSS depends on concurrently playing notes (voices). You can use 44.1 kHz sampling frequency with any 486 class CPU as long as number of voices remains low. For example playing a .MOD file using gmod should be possible with any machine.

Even in low end 486 class machines SoftOSS gives better MIDI playback quality than the standard FM synth.

Using SoftOSS with too slow CPU is not dangerous. Playback just becomes distorted (it jumps like a broken vinyl record) and system becomes rather unresponsive. However the situation returns back to normal after playback is stopped/interrupted or number of concurrently playing notes decreases below the system dependent limit.

  • At least 16M of RAM is required (32M recommended)

SoftOSS stores the instrument samples on systems (physical) RAM. This means that there must be enough "spare" RAM on the system. Current version of SoftOSS permits loading up to 8M of samples which means that using it on machines with less than 16M RAM may not produce the desired performance. It is possible to use SoftOSS on systems with less than 16M of RAM but care must be taken that too many samples are not loaded. The final 3.8 version of SoftOSS will permit configuring the maximum memory size which makes it safer to use in underconfigured machines.

Limitations of SoftOSS

There are few limitations in using SoftOSS. However in most cases they are not significant:
  • SoftOSS allocates the first audio device (/dev/dsp0) for itself always when /dev/sequencer or /dev/music are open. This means that it is not possible to play audio at the same time with MIDI on machines with just one soundcard. /dev/dsp0 is still accessible when /dev/music and /dev/sequencer are not open.
  • SoftOSS uses CPU time which may make it useless in some applications. It's for example not recommended to use it for playing background MUSIC in games. Depending on the degree of polyphony (number of simultaneous notes) it may slow down the game seriously. Note that this is not true with playing sound effects of games which is a well suited task for SoftOSS.
  • Most "GUS compatible" applications would be very confused if they detect two "GUS compatible" devices on the same system. However this is not a problem since GUS (particularily GUS PnP+8M RAM) does everything that SoftOSS. Ie you don't need to use SoftOSS if you have GUS.

Getting SoftOSS

SoftOSS is included in the standard OSS software (currently there is no extra fee).

Getting the Sound Patches

To use SoftOSS you will need to use a "GUS compatible" Linux application such as mplay or gmod. You can get them from the OSS Applications page.

With mplay, you need to copy the public-domain MIDIA instrument files.

Now uncompress and extract the MIDIA patch files as follows: tar -zxvf instruments.tar.gz and this will extract 8-9MB of music instrument patches under a directory called "instruments". You need to move the instruments directory to /usr/local/lib/midia/instruments - (you may need to create the directory by typing mkdir /usr/local/lib/midia and then type mv ./instruments /usr/local/lib/midia

Configuring SoftOSS

Configuring SoftOSS is very easy. Run soundconf and you will be presented with a menu that looks something like this:

    Save changes and Exit
    Cancel changes and Exit
    Add new card/device
    Remove a card/device
    Verify configuration
    Exclude IRQ and DMA numbers
    Autodetect soundcards
    Security setup
    Manual configuration
    Install license file

If you have not added any soundcards yet (they should be listed above this menu), you should configure it first by activating the "Add new card/device".

To add SoftOSS you just need to activate the "Add new card/device" function and select one of the "4Front Tech. SoftOSS (for XXX) " entries wherehe XXX matches (roughly) your CPU. If you can't decide between two or more entries, select the "highest" one. If it doesn't work (playback jumps), you can start soundconf again to remove this one and to select a lower one.

After adding the SoftOSS engine and a 16 bit soundcard, save the configuration and start OSS using soundon command. Then execute cat /dev/sndstat and verify that there is at least one audio device and the SoftOSS synth listed (just like below).

    Audio devices:
    0: Crystal audio controller (CS4236) (DUPLEX)

    Synth devices:
    0: SoftOSS

Now use mplay program supplied with OSS (default is /usr/lib/oss/mplay) to play MIDI files. Type mplay # midifile.mid (where # is the synth number under the Synth Devices heading in the /dev/sndstat output.

Future Plans

Doesn't the above sound excellent? Not exactly. This version of SoftOSS is just a preview release. It doesn't contain all features which are planned to be included in future versions. The following are some examples:

Support for sample distribution formats used for distributing commercial instrument samples and sound effects. SoundFont 2 will be the first format supported. Support for streaming instruments. Streaming instruments permit playing of very large audio files or computer generated sounds together with ordinary (shorter) samples which fit completely in memory. Using streaming instruments will require some form of support by the application but most of it will be handled by OSSlib. Support for 3D voice position and various special effects (will require faster (MMX?) CPUs than the ones available this year).