2
votes

I am trying to create a PortAudio application on Debian Wheezy 64 bit GNU/Linux. I read the documentation on how to do add the library and it compiles without errors.

Now when I want to initialize PortAudio using this script:

#include <stdio.h>
#include "portaudio.h"

int main(){
    PaError err = Pa_Initialize();
    if(err != paNoError){
        fprintf(stderr, "Pa_Initialize error: %s\n", Pa_GetErrorText(err));
        return 1;
    }
    return 0;
}

I get the following output: Pa_Initialize error: Host error.

When I try to run Audacity, which is also based on PortAudio I get the following errors:

ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
audacity: symbol lookup error: audacity: undefined symbol: Pa_GetStreamHostApiType

And when I try to call this function:

const PaHostErrorInfo* hostError;
hostError = Pa_GetLastHostErrorInfo();

I get the following error: Undefined reference to 'Pa_GetLastHostErrorInfo'

How can I initialize PortAudio the correct way, and what is wrong with my host; does PortAudio requires me to do something with PulseAudio?

I already tried the bottom solution of this topic http://ubuntuforums.org/showthread.php?t=1756822, because I thought it had something to do with the configuration of the library files. But that also didn't work and it doesn't change the error.

2
Yes I did but it didn't help me solve the problem, it doesn't clarify the error.tversteeg
Reading `symbol lookup error: audacity: undefined symbol̀, it sounds like there is a problem with library files - like if audacity was compiled with PortAudio headers which don't match the .so files in /usr/lib (maybe a different version ?)...neodelphi
@Thomas Sorry I wish I could help you but I have no idea I search in documentation but impossible to me...You can mail them.Grijesh Chauhan
@GrijeshChauhan No problem, I will mail them if I can't find an answer myself. @neodelphi It indeed sounds like a library issue, but I used the default Debian apt-get install method to install Audacity so any errors in incompatible versions should be raised that way.tversteeg

2 Answers

2
votes

The audacty error looks like something is misconfigured. To get to the bottom of your issue, try calling this function to find out what the host error was:

const PaHostErrorInfo* Pa_GetLastHostErrorInfo ( void )

http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html#aad573f208b60577f21d2777a7c5054e0

1
votes

After some time researching the problem I gave up, and tried reinstalling PortAudio from source by removing it and building it again. And thankfully this time it worked!

So I guess it was a bug by that got resolved in the new version.