How to install Install Portaudio for use with Linrad.
(March 20 2011)

Portaudio.

PortAudio is a free, cross platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' that will compile and run on many platforms including Windows and Linux.

Starting in version 03.09 Linrad can be compiled with portaudio. This means that Jack can be used under Linux to connect other programs to the output of Linrad.

Under Windows the inclusion of Portaudio means that ASIO and other fast drivers become available which is very important for Windows Vista and Windows 7 where output through the old Windows MME drivers is slow.

The portaudio interface in Linrad-03.09 is written for Portaudio version 19. Linrads old direct interface to the soundcards via the MME drivers is left in place and the user can select to use the old routines or to access the sound system through Portaudio.

Linrad may use four soundcard channels:

1. Receiver input (Disabled when SDR-14 or other USB devices are used.)
2. Receiver output (Can be disabled. Typically when writing the output to the network.)
3. Transmitter input (Early development stage).
4. Transmitter output (Early development stage).

Currently only the receiver output can be set to use Portaudio.

Portaudio for Linrad under Windows.

Linrad-03.09 to Linrad-03.11 have three different executables with different alternatives for portaudio. Linrad-03.12 and later have just one executable, linrad.exe It is necessary to have palir-01.dll available to Linrad in order to run Linrad-03.12 and later under Microsoft Windows. Get palir-01.dll from here palir-01.zip (485835 bytes) or here palir-01.dll.bz2 (457609 bytes) Linrad-03.23 and later are compiled with palir02.dll by default but you can re-compile with palir-01.dll if you wish. Get palir-02.dll from here palir-02.zip (493856 bytes) or here palir-02.dll.bz2 (462419 bytes)

To compile older versions of Linrad (03.09 to 03.11) for Windows you will need the files pa-lir.lib and/or pa-vclir.lib to compile linradpa.exe and linradvc.exe. They are available here: linrad-pa.zip (30595 bytes) and here linrad-pa.tbz (23914 bytes)

Portaudio for Linrad under Linux.

Portaudio must be installed after Jack in case you want to use Jack. On a 64 bit system the 32 bit version of Jack has to be installed.

Jack can be installed with the system installer that belongs to your Linux distribution. Install these packages: (The lists may be incomplete. If you have additional information, please send a mail to:


Debian and Ubuntu
jackd
libjack0
libjack0-dev

Mandriva
jack
qjackctl
libalsa-plugins-jack
libsamplerate-progs
libbio2jack0
libjack-devel
libbio2jack-devel
jackit
arts

Fedora
jack-audio-connection-kit
qjackctl

Suse 64bit
jack-32bit
libjack0-32bit
qjackctl
alsa-plugins-jack-32bit

Fedora 64 bit
qjackctl
jack-audio-connection-kit-devel-0.116.1-4.fc11.i586

The installers take care of dependencies. The above lists might contain too many packages. I do not know what is really needed, but with the above lists I have produced working installations of Linrad with Portaudio and Jack under the specified distributions.

Download the latest portaudio source code from http://www.portaudio.com/download.html

Get root privileges (sudo su root under Ubuntu where plain su root does not work.) Place the portaudio archive in /usr/src and unpack it with tar xvfz pa_snapshot.tgz This will generate the directory /usr/src/portaudio. Descend into this directory and execute these commands:

./configure
make
make install
ldconfig


The linrad configure script has to be run after the sucessful installation of portaudio to make Linrad aware of the fact that portaudio is available. Linrad does not use the installed portaudio.h. The file pa-linrad.h which is included in the Linrad package is used instead. It is a renamed copy of portaudio.h from Portaudio V19 which was downloaded Oct 14 2009.

Portaudio for Windows when compiling from source code.

The file palir-xx.dll must be present when the configure script (configure.exe under Windows) is run. If it is missing, the resulting linrad.exe will run without the palir-xx.dll file but of course without access to soundcards through Portaudio. You may compile it from the Portaudio source code as described below, but you must then make sure that Windows will use the same .dll file at run time. That will happen automatically with the .dll file in the Linrad directory. Linrad versions up to linrad-03.21 use palir-01.dll which you can download from here palir01.dll.bz2 (457609 bytes) or here palir01.zip (485835 bytes) and extract palir-01.dll from the archive file

For Linrad-03.22 and later you may also use palir-02.dll. It is available here palir02.dll.bz2 (462419 bytes) or here palir02.zip (493856 bytes) and extract palir-02.dll from the archive file

palir-01.dll is from Portaudio snapshot Oct 19 2009 while palir-02.dll is from the stable release candidate March 02 2011.

How to generate palir-xx.dll from source code.

palir-xx.dll provides Hostapi's for MME, DirectSound, WDM-KS, WASAPI and ASIO.

The installation steps are:

1. Install MinGW/GCC 3.4.5 by downloading mingw516nasmusb.zip (23660852 bytes)
Unzip it in C:\ to get a C:\mingw directory. (DO NOT use older mingw versions or the compilation will fail.)

2. Download the latest portaudio snapshot (pa_snapshot.tgz) from http://portaudio.com/download.html
Unpack it into C:\ to get a C:\portaudio directory.
Files with extention .tgz (short for .tar.gz) may have to be unpacked in two steps.

3. Go to: http://www.steinberg.net/en/company/3rd_party_developer/sdk_download_portal/create_3rd_party_developer_account.html Register and agree to their license agreement. Then you can login as a 3rd party developer here: http://www.steinberg.net/en/company/3rd_party_developer/sdk_download_portal.html
Download the asiosdk2.2.zip file from Steinberg.
Unzip it and copy the ASIOSDK2 folder with its subdirectories to C:\portaudio\src\hostapi\asio\ASIOSDK2

4. Download portaudio_for_linrad.zip (123431 bytes)
Unzip it while preserving the path information to get a folder portaudio_for_linrad with sub-folders in it.
-Copy the folder dx8sdk from portaudio_for_linrad to the C:\portaudio directory.
-Copy the mingw-include folder from portaudio_for_linrad to C:\portaudio\src\hostapi\wdmks\mingw-include
-Copy the files
   Makefile
   make.bat
   clear.bat
from portaudio_for_linrad to the C:\portaudio directory.

5. Deprecated (recent Portaudio versions include WDMKS by default.) Activate WDMKS by editing the file C:\portaudio\src\os\win\pa_win_hostapis.c
Use your favourite editor to remove the /* and */ that surround these statements:
#ifndef PA_NO_WDMKS
       PaWinWdm_Initialize,
#endif


6. Open now a command window (DOS prompt) in Windows.
From the DOS prompt, cd to the C:\portaudio directory and enter the command
make.bat

In case there are no fatal errors you would get the palir-01.dll file in the portaudio directory. To generate palir-02.dll, use this version of Makefile (7410 bytes) Please note that a palir-xx.dll that you generate from source code has to be used at run time as well as at compile time.
The make.bat command will also generate three portaudio test programs in the portaudio directory:
pa_devs.exe
paqa_devs.exe
patest_record.exe

Notes:
5.1 If you want to keep ALL the output of the compilation proces (including error messages) you can route the output to a text file with the following command:
make.bat > make_output.txt 2>&1

5.2 The palir-xx.dll file can be generated with a debug option.
This debug option will generate debugging information in the DOS box from which you started linrad.
To activate this debug option you have to modify line 3 in Makefile by adding -DPA_ENABLE_DEBUG_OUTPUT= at the end of the line as follows:
CF1= -c -DWIN32 -D_WIN32 -DWINDOWS -DKSAUDIO_SPEAKER_DIRECTOUT=0 -DMETHOD_NEITHER=3 -DFILE_ANY_ACCESS=0 -DWINVER=0x0501  -DPA_ENABLE_DEBUG_OUTPUT=

7. If the test programs run fine, copy the palir-xx.dll file into the linrad directory and recompile Linrad. You have to run configure in between in case you did not copy palir-xx.dll to replace an older version with the same name.

All the work of interfacing Linrad to portaudio was done by Pierre, ON5GN who once again made a major contribution to the Linrad development.


To SM 5 BSZ Main Page