VOICE Home Page: http://www.os2voice.org
April 2001

[Newsletter Index]
[Previous Page] [Next Page]
[Features]

editor@os2voice.org

Snakes and Hammers: Ogg Vorbis

By Christian Hennecke ©March 2001

What the heck is an Ogg Vorbis... yes, I am going to explain the name! Ogg is taken from the game Nethack and means "to do something forcefully". Like the Norse god Thor who uses his hammer Mjolnir to get that sinus wave-like snake take up less space as you can see on the left. And Vorbis is the name of a person from Terry Pratchet's Discworld novels. That leads us directly to what Ogg Vorbis is: a project for sound compression like MP3 and so on. Ogg Vorbis is the only still existing part of the larger Ogg project that aims at providing a complete set of utilities for compressing multimedia data. While it is still in beta phase - though nearing GA - it has already been improved quite notably and runs well under OS/2.

You may ask why one should use Ogg Vorbis when there are already MP3 and others around, with MP3 being a de facto standard. Well, Xiphophorus.Org, the creators of Ogg, have designed it to be completely free and Open Source with parts released under GPL and parts under LPGL. First, there are no royalties to pay for using it and that's a big advantage over MP3. In case you don't know: The Fraunhofer institute holds patents for MP3 in at least the US and Germany. While nobody really seems interested in charging private users for using free MP3 encoders and decoders, commercial users have to pay, e.g., for including MP3 sound with their games or offering music on their site. But this may change in the future. Just think of Unisys and the LZW patent. Work is already under way to include Ogg Vorbis support into the ICECAST streaming server. And second, Ogg Vorbis is designed to offer better quality. More on that later.

Implementations for OS/2

So far three people have independently worked on Ogg Vorbis for OS/2. The standard distribution contains only commandline encoders and players with little extra functionality. Nick Burch ported Vorbis to OS/2 back in September/October or so, but with the main player Ogg123 missing. There is also a compiled special version of the LAME encoder with Vorbis support, but limited functionality. The distribution was sufficient for both encoding and decoding though. Sofiya has created a plug-in for PM123 that works quite well. If you download it, ensure that you select a version that works with your incarnation of PM123. The latest binaries (from February 27th) have been compiled by Brian Havard of Apache and FC/2 fame using Vorbis beta 4. Although this is not the complete distribution, there are the encoder, a simple player and the standard player Ogg123. Brian also offers a tweaked version of the plug-in for PM123.

At the moment Brian Havard's site is the one to go if you are interested in obtaining Ogg Vorbis for OS/2. Always be sure to get the latest release, since beta 4 offers huge improvements over beta 3 (and beta 5 in its time is going to offer a lot more than beta 4). Also keep in mind that the original plug-in was based on beta 2 and so it probably won't play files created by later versions properly (later versions are backwards compatible though).

Technical features

Currently input files for the OggEnc encoder must be 16-bit PCM WAV, AIFF or AIFF/C files. These may be mono, stereo or have even more channels. The supported range of sampling rates lies between 8kHz and 56kHz. OggEnc is also capable of using stdin/stdout for input and output, which is very helpful for on-the-fly encoding. You could grab audio data from a CD and directly pipe it into the encoder, and thus save the space for temporary files, for instance. Another option is to use raw PCM data which must be of 16-bit stereo little-endian format.

At the moment six different encoding modes are supported. Each of these is a full variable bitrate (VBR) mode, though they are a bit different in that you select the average desired bitrate. If you think of the LAME MP3 encoder, the result would be that of LAME's --abr option, not the -v option. The available modes are 112, 128, 160, 192, 256, and 350 kbps.

Another feature is support for tags and naming. Using commandline options you can specify a comment, the date, track number, title, album and artist to include in the file. The naming feature let's you use this data for automatically naming the resulting file(s). 

Performance

Now, how well does it perform in terms of speed, file size and audio quality? To answer this question I have used several versions of Ogg Vorbis tools starting with the first available dating from last year's October (yes, it shows that I planned to write this article a while ago) to the latest beta 4 release and compared the results to MP3s created with LAME using the average bitrate option. The two test tracks were "I surrender" (9:24 min) and "Thalhiem" (6:09 min) from the album "Dead Bees on a Cake" by David Sylvian, which both contain a good mixture of acoustic and electric instruments.

The following tables show the results for encoding the tracks with OggEnc from Vorbis beta 4 and LAME 3.86 running on an AMD K6-III 450. Options used for LAME were: -ms --abr <bitrate>

Tab.1: Results for encoding track 1 (playing time: 9:24 min, size: 97.238kB)

Encoder
Mode (kbps)
Elapsed Time
File size (kB)
OggEnc
128
8:39
8394
LAME
128
5:35
8141
OggEnc
256
9:46
16727
LAME
256
4:14
17236

Tab.2: Results for encoding track 2 (playing time: 6:09 min, size: 63.607kB)

Encoder
Mode (kbps)
Elapsed Time
File size (kB)
OggEnc
128
5:05
5500
LAME
128
3:44
5333
OggEnc
256
5:38
10859
LAME
256
2:46
11238

While OggEnc produces files of about the same as similar MP3s, it takes much longer to accomplish the job than LAME. Currently that is. As I pointed out before, Vorbis is still in beta phase and therefore it hasn't been optimised in terms of CPU usage.

To play Ogg Vorbis encoded files you can use the commandline utilities from the Vorbis distribution or PM123 with the above mentioned plug-in. Generally speaking, playing Ogg Vorbis files imposes more CPU load on your system than playing MP3s. However, significant improvements can be expected. This already shows in Brian Havard's tweaked version of Sofiya's plug-in for PM123. While the latter created a load of about 17-18% on my system with the analyzer turned off, the latest version has arrived at 15%. The commandline tools perform slightly better at 14% load. Compared to a rate of 11-12% for MP3s on PM123 this looks very promising. (Note: Other MP3 players for OS/2 like WarpAMP, z! (both 10% load) or the QU player (8% load) are less resource-hungry, but aren't suitable for comparison here.)

Of course all the above would be completely obsolete if the sound wasn't good. My machine is connected to a nice stereo and I cross-checked the results of Ogg Vorbis and MP3 against the original, all played via a Terratec Maestro 32/96 soundcard. I did the MP3 encoding with LAME, because it is considered as the best MP3 encoder around, meanwhile better than Fraunhofer's original MP3ENC.

As it turned out, an average bitrate of 128 kbps is not the way to go if you really want to listen to the music, neither with MP3 nor Ogg Vorbis. However, I think that Ogg Vorbis produces the better result, if you use an up to date version - the old ones from last year showed some audible artifacts. Choosing an average bitrate of 256 kbps gives much better results in both cases. To me Ogg Vorbis sounds superior to MP3 at 256 kbps, too, though the difference is smaller than at 128 kbps.

Generally the following can be observed: MP3 seems to literally compress the sound more and adds a certain harshness while taking away more details. This especially showed if I turned my attention to the celli and the flute in the tracks. The celli's snaring and the sound of the flute's mechanics was more present with Ogg Vorbis. MP3 made the singer sound more strained than on CD. Ogg Vorbis seems to preserve more room, i.e. instruments are not only located in the plane between the speakers, but also in the space behind.

Please note that these descriptions are somewhat exaggerated to clarify the differences. MP3 is not as bad as the above sentences "sound". Nethertheless I think that Vorbis is better, but the difference is not that huge.

Conclusion

Ogg Vorbis is a really promising free, OpenSource sound encoding system capable of streaming. Produced files are of similar size as those of MP3, though the encoding process takes much longer. Playing Vorbis files requires more CPU power than for MP3 files. The sound quality is equal to or a bit better than that of MP3, especially at lower bitrates. Once Vorbis goes GA, we can expect some optimization for lower CPU usage.

If you are interested, always be sure to get beta 4 binaries and beta 5 when it's available, since they offer huge improvements over older versions.

Hopefully we'll see more players for OS/2 with Ogg Vorbis support soon. I have asked Dink about including it in z!, but he's not interested in doing so. Of course a plug-in for MMOS2 would be nice, since it would enable all MMOS2 players to use this format.

Article References:
Ogg Vorbis homepage: http://www.vorbis.com
Port by Nicks Burch: http://users.ox.ac.uk/~magd1113/mpeg/
Port and PM123 plug-in by Brian Havard: http://silk.apana.org.au/vorbis/
PM123 multimedia player: http://www.teamos2.sci.fi/pm123
PM123 plug-in by Sofiya: http://www.din.or.jp/~sofiya/soft/soft_e.html
Xiphophorus homepage: http://www.xiph.org


Features
editor@os2voice.org
[Previous Page] [Index] [Next Page]
VOICE Home Page: http://www.os2voice.org