[linux-audio-user] Portaudio...

Sampo Savolainen v2 at iki.fi
Fri Dec 10 06:01:33 EST 2004

Quoting Russell Hanaghan <hanaghan at starband.net>:

> Does anyone have portaudio functioning on their Linux box and if so, can
> you give a brief overview of how and what is required?
> eg: I read it will co-exist and work with alsa?  Does that mean it 
> co-operates with jack and can be run from the Qjackctl app?  Latency 
> issues? is it robust?

Portaudio and alsa are different sorts of beasts.

ALSA is a standard for and a set of drivers. Drivers as in hardware drivers.
They talk to the hardware devices and the OS.

Jack is a piece of software, as portaudio is, which uses the OS driver to
interface with the audio hardware.

Portaudio on the other hand, is made for porting audio software (hence the
name). It is a common programming interface (API) for audio handling. The
idea is that audio interface for the application is the same even if the end
result would be running on Windows, OSX, Linux.

Here is a layer representation. It's a bit simplified though...

| Audio application easily ported for many |
| different operating systems. For example |
|                 Audacity                 |
|                PORTAUDIO                 |
| OSS | ALSA |          | Windows   | ASIO |
|     |      |          | Audio API | (?)  |
+------------+          +-----------+------+
|  Operating |          | Operating System |
|   System   |          |   (Windows)      |
|  (Linux)   |          |                  |
+------------+          +------------------+
|  Audio HW  |          |    Audio HW      |
+------------+          +------------------+

Portaudio is designed so that applications using it have a single well
defined and easy to use API for audio. Then portaudio has operating system
specific 'drivers'. Portaudio v18 has only OSS support (=OSS driver) for
Linux, but v19 has also a driver for ALSA and JACK.

The part which gets confusing is that with jack support, portaudio doesn't
speak to the audio drivers, but to another application (jackd). So with jack
the layering is as folllows:

 Application (Audacity)->Portaudio->Jack->ALSA->OS->Audio HW

(Of course, jack can also use it's OSS drivers instead of ALSA)

The end result?

Any application written for portaudio will support all the methods of
"talking to" audio hardware that portaudio supports.

And finally, the answer to your question:

Yes ALSA and portaudio can coexist.

(Disclaimer: I am not that familiar with portaudio, so proper developers
will find many discrepancies in this text. But this description was meant
for general education)


More information about the Linux-audio-user mailing list