GSI: General sound interface
On this page:
Applications using GSI
What needs to be done...
Example (for the 0.8.x API)
For more information:
Detailed overview of GSI
Applications included with GSI (gsifile, gsiplay).
Suggestions to improve the API or code are welcomed. Help at implementing unfinished stuff too of course..
- 2002-01-17: In speaking with Wouter, he gave me his last copy of the
code (v0.9.6). I have just place it up in the files section. Also,
people will now be able to find GSI in CVS.
Oops! I almost forgot to mention that he also provided the sample
files as well as code.
- 2001-07-12: Greetings. I (Sean Farley) have placed the last bits of this project up on SourceForge in the hope of sparking interest in this project again. Also, I have placed the last known stable version as well as the development version up on this server.
There will probably be lots of files missing, but the source as well as the GSI overview can be found here. I hope to be able to clean this page up a bit at a later date. Right now I am trying to get the hang of the SourceForget system. :)
- 2000-11-21: Due to lack of feedback/interest, 0.9.x source & info have been removed. I probably won't release the new version with software midi/hmp/mus synthesizer.
- 2000-11-12: GSI 0.8.11: Support for OpenBSD/NetBSD finished, again more cleanups, reorganizations and better connection message handling in libgsi.
- 2000-10-29: A few notes:
1. If you have problems on linux (the OSS derived drivers), mail me, as I can't test on linux.
2. Ditto for the OSS drivers on any OS.
3. ALSA will not be supported unless someone writes a bit of code to do so (not very difficult if you know a bit about the API involved).
If anyone wants to help out, or just make suggestions etc., mail me.
GSI is an easy to use audio system which can be used over a network and which gives applications, through a very simple API, sample playing with stereo, 3D, doppler effects, music playing (MIDI, HMP, MUS), cd playing and ejecting/changing.
GSI also contains a separately usable sound/music loading/saving/format conversion library libgsif (au/aiff/voc/wav/raw, midi/hmp/mus), although saving/format conversion is not completely done.
GSI runs on any unix system that has generic /dev/audio (8000Hz mono mulaw), OSS, ultrasound project drivers, or NAS (well, it did once, I need to update the NAS stuff), e.g. Linux, OpenBSD and FreeBSD. CD playing is dependant on the OS' ioctl's and structs so that probably works on Linux / *BSD only (solaris may work, as it seems to use the same ioctl's/structs as linux).
The goals of GSI are:
1. Simple to use
2. Support all audio devices
3. No compromises in functionality
This means, advanced stuff should be possible (with the least effort possible), and simple things should be very simple to set up.
Here is an detailed overview of GSI and information on the applications included with GSI (gsifile, gsiplay).
Applications using gsi
Note that these all use the 0.8.x API, not the newer API from 0.9.x.
- Descent: (samples & music)
ggi_gsi_descent (version 0.6 and above run with shareware PC datafiles).
- Doom: (samples & music)
gsi_doom 26-1-1999 (369 KB) for GSI 0.8 or later.
The doom source + gsi changes. Note:
The purpose of this version is really to show the small changes that are needed to use GSI and the new i_sound.c/s_sound.c can be used in other doom versions. These were used too by me to get sound/music in heretic...
- The wadfile is assumed to be doom1.wad (to change, see s_sound.c, i_sound.c)
- The OPL patches from doom are only used for the drums. The result is good for the OPL (see s_sound.c line ca. 240 for the choice) but not yet perfect (GUS with ultra project sounds perfect).
Original doom source: ftp.idsoftware.com/idstuff/doomsrc.zip
- Heretic: (samples & music)
gsi_heretic patch 26-1-1999 (29 KB) for GSI 0.8.1 or later.
Patch to run lheretic 0.9.1.1 with GSI. The wad file is assumed to be heretic.wad, see i_sound.c/s_sound.c to change. Rename the directory with the source to gsi_heretic and type 'patch -p < gsi_heretic-26-1-1999.patch'.
linux-heretic-0.9.5.diff2 (2.8 KB) for GSI 0.8.1 or later.
Fixes a few bugs in lheretic 0.9.5 to make it run with GSI again.
Here is the latest version of the unix port of heretic.
- Mortar (samples & music)
- Maelstrom with the GGI/GSI patch
More or less stable releases:
Install note for ultrasound drivers (linux): You must manually copy libgus_icfg.h (ultra-2.99a-devel4/src/driver/libgus/icfg/libgus_icfg.h) to /usr/local/include/ (or where you installed) after installation of these drivers.
- [ 2001-07-16 ] gsi-0.8.14.tar.gz (243 KB)
Last stable version.
- [ 2001-07-16 ] gsi-0.9.4.tar.gz (393 KB)
What I thought had been the last development version.
- [ 2002-01-17 ] gsi-0.9.6.tar.bz2 (456 KB)
Last development version.
- [ 2000-11-12 ] gsi-0.8.11.tgz (251 KB)
Lots of cleanups, better connection messages (both for the server and the interface) from 0.9.x. This gives a much better view of connection problems (like stale sockets, double starting of gsi_server etc). OpenBSD/NetBSD audio driver support.
working streams (and a test program to show how to use them); any slot can be streamed into a channel, i.e. an application can use as many streams as it wants, each with it's own samplerate etc: see test/stream/main.c, the STREAM_VERSION_2 code)
gsi_drums.sb replacement for the OSS drums.sb / drums.o3.
Note: OSS upgrade:
If you're running a linux 2.0.x kernel and use OSS, get OSS 3.8s9 (earlier OSS versions are NOT usable with GSI, see the README with GSI detailing some of the problems with OSS 3.5): oss-free
Development versions (GSI 0.9.x, largely rewritten and with better API):
Removed due to lack of feedback/interest.
- gsi_test_sample-4 (491 KB) .au samples used to test the server's format conversion + samples to test stereo loading & playing (tone on left/right channel).
- gsi_test_sample_part2-4 (1403 KB) samples in various formats (aiff, wav, voc) to test the header decoding, LSB -> MSB conversion.
- gsi_test_midi-5 (73 KB) several midi's used to test the server's midi playing.
- gsi_test_mus-5 (125 KB) mus's from heretic & doom.
- gsi_test_hmp-5 (138 KB) various hmp's from descent, slipstream 5000, frontier.
- gsi_test_hmp_part2-5 (50 KB) hmp's from abuse shareware, these are 1995 hmp format and don't work yet.. (internal format is not quite midi as earlier hmp formats).
- duke3d_atomic_midi (241 KB) Duke 3d midi's to test midi playing.
Not yet done:
Some of these I'm working on at the moment:
Mail me if you're interested in helping.
- Integrate Keith Packard's midi player for midi/hmp/mus playing on sound cards that don't have a synthesizer.
- Saving and samplerate conversion in libgsif is incomplete.
- Events (like in X and GGI) instead of callbacks. Much more programmer friendly.
- Finish SYSV shared memory use for streams etc.
- Assembler sample-mixing code?
- If you know windoze & directX, a windoze directsound port of gsi would be great (I should say: interesting ;). I don't know the low level issues involved.
- Is the (ancient 1995) OSS OPL octave bug fixed or not in OSS 3.8? From a test with musserver it seems not. Haven't had to time to test more on the OPL. Anyone out there know this?
Example (for the 0.8.x API)
gsi_init(NULL); /* connect to gsi_server on the local host (unless the environment variable GSI_HOST is set) */
/* where all files can be found by the server */
gsi_init_pcm(8000 /* samplerate */, 2 /* channels */, GSI_8BIT /* sample type */, 0 /* fragsize */);
/* note that channels = 2 means stereo, a fragsize of 0 is used to let the server determine
* a good fragsize */
/* relative path => loads the file /home/wouter/sounds/test.au in slot 0 */
/* absolute path => loads the file /usr/share/games/pool/poolball.voc in slot 1 */
gsi_play_sound_pan(-1 /* =automatic channel allocation */, 0 /* sound 0 */, 0 /* center */);
/* plays test.au centered */
gsi_play_sound_pan(0 /* channel 0 */, 1 /* sound 1 */, -256 /* left */);
/* plays poolball.voc on the left */
/* sends the above commands to the server (playing will then start immediately) */
Can it be any simpler than this ?
Note that this is only network transparent if files are used from mirrored locations (the server loads files itself to avoid sending them over the network, this is usually possible for files in e.g. /usr/share/). Otherwise the way to do this is as follows:
snd = gsif_load_sample("../../../gsi_data/sample/au/man_down.au", 0);
/* we're only sending block 0 */
gsi_send_raw_sample(19, snd->block->samplerate, snd->block->channels, snd->block->type, snd->block->data_length, snd->block->data);
This will be all made easier later by
- automatic reversal to gsi_send_raw_data by libgsi if the server couldn't load a mirrored file.
- addition of gsi_send_sample which loads all blocks (most sample formats use just one block btw.)
Old whs @ xs4all.nl (remove the spaces)
Brought to you by: