tompoe | 20 Sep 07:40 2014
Picon

SOLVED: low level static with Portaudio

Fiddled, and found my HDM1 sound volume was excessive.  Once I lowered 
to 50%, static disappeared.  I'm hard of hearing, so my normal volume on 
television channels is usually much higher. Thanks, much.  And, by the 
way, am impressed with Portaudio.  Good work, people.
Thanks, Tom
tompoe | 20 Sep 07:26 2014
Picon

low level static when using portaudio

Writing as a user:  I installed Linuxmint17 on a desktop.  I installed 
GUVCviewer for webcam recording.  I'm getting low level static output.  
Is this a familiar issue?  Does not appear to be connected to volume 
level.  Any help appreciated.
Thanks, Tom
Dinesh Iyer | 11 Sep 18:19 2014
Picon

PortAudio crash when attempting play audio using NComputing Virtual Desktop client

Hi all,
I am connecting to a Windows 2008 Server R2 system using an NComputing Virtual Desktop Client (vSpace client). The Windows 2008 Server does not have any sound devices. So I am playing the sound on my machine. This is similar to "Play sound on this computer" option using Windows Remote Desktop.

The screenshot of my Control Panel Sound Setting is below:


When I play a file using Windows Media Player or a youtube video on 2008 Server, I am able to hear the sound clearly on my system.

When I use Audacity to play a wav file, the sound was delivered but its completely distorted.

With my application, which uses portaudio March 26, 2011 (I am in the process of upgrading), my application crashes. I am adding a crash trace below:

[0] 0x000007fef1bd6dae C:\\Program Files\\myApp\\bin\\libportaudio.dll+00028078 Pa_Sleep+00001550\u8232 \u8232 
[1] 0x000007fee5d4f27e C:\\Windows\\system32\\dsound.dll+00193150 DllCanUnloadNow+00010430
[2] 0x000007fee5d522ca C:\\Windows\\system32\\dsound.dll+00205514 DllCanUnloadNow+00022794
[3] 0x000007fee5d50654 C:\\Windows\\system32\\dsound.dll+00198228 DllCanUnloadNow+00015508
[4] 0x000007fef1bd6ea5 C:\\Program Files\\myApp\\bin\\libportaudio.dll+00028325 Pa_Sleep+00001797
[5] 0x000007fef1bd8d5f C:\\Program Files\\myApp\\bin\\libportaudio.dll+00036191 Pa_Sleep+00009663
[6] 0x000007fef1bd2ea6 C:\\Program Files\\myApp\\bin\\libportaudio.dll+00011942 Pa_GetVersionText+00000422
[7] 0x000007fef1bd3007 C:\\Program Files\\myApp\\bin\\libportaudio.dll+00012295 Pa_Initialize+00000039
<SNIP>

Are there known issues between PortAudio and NComputing clients?

Regards,
Dinesh
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Rob | 5 Sep 23:01 2014
Picon

Portaudio bug?

In the past I encountered a problem with an application that uses portaudio (fldigi).
Now I have seen that it occurs in other applications as well and apparently is a portaudio bug.

I use a Linux system with Alsa sound.  The problem is not dependent on Linux version or distribution.

Whenever fldigi is started, other running programs that use Alsa sound directly (not via portaudio)
are affected.  The least symptom I see is that they get no input from the soundcard anymore.
Maybe the soundcard settings are affected as well.

When using a system with multiple soundcards and multiple applications running, it is a real nuisance.
After starting a program that uses portaudio, some of the other programs have to be restarted.

At first I neglected a problem thinking that it may be a bug in fldigi.   But now I noticed that exactly
the same thing happens when the example program pa_devs from the distribution is started.

I also noticed that often not all input sound devices are listed in the enumeration of portaudio.
These issues may be related.   It may be that something is done during enumeration that both
kicks off the existing program and prematurely terminates the enumeration of input devices.
(the list of output devices is complete)

Is this behaviour by design?  Isn't portaudio supposed to leave the other sound apps untouched,
especially when starting an application for which the soundcard already has been configured?

Rob
Spencer Russell | 5 Sep 16:42 2014
Picon

ALSA still complaining of underruns using PaWriteStream API

So I switched my Julia wrapper over to using the PaReadStream/PaWriteStream API and it seems to be running much more smoothly and I was able to get rid of my C shim, which was a big win on the packaging / distribution side.

I still get dropouts when Julia halts to JIT compile something, or if there's a particularly long GC run. I expect to get these dropouts in the sound (for now), but I thought that if I usd the Pa*Stream calls then the underlying audio API would be insulated from the dropouts and PulseAudio would just send zeros and discard input or something. Instead I still see messages:

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

Is there a way to suppress these warnings? I'm already handling the PaError return values that come back to keep track of when I have an over/underflow, so the extra stdout prints are just clutter.

I see in 2012 there was a discussion on how to handle them[1], but I didn't see a resolution, and in the API docs I don't see anything about enabling/disabling them.

_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
ziz.root | 4 Sep 02:52 2014
Picon

pa_util.h and paex_ocean_shore.c | compilation

Hi,

I would like to use "pa_ringbuffer" and "pa_util in my project".
But i don't know how to compil it when i include pa_util.h

As an example : how can i compile ./portaudio/examples/paex_ocean_shore.c

I added pa_ringbuffer.h and pa_ringbuffer.c in my folder (it looks ok).
I added pa_util.h too but there is no pa_util.c

I read the detailled description ( 
http://portaudio.com/docs/v19-doxydocs-dev/pa__util_8h.html )
but this is not enough for me :( sorry.

How can i do to use pa_util.h in my project ?

Thanks,

Lolo Tremolo
Pierre | 27 Aug 11:34 2014
Picon

Assertion failed: FALSE, file src\hostapi\wdmks\pa_win_wdmks.c, line 1054

Hi,

I installed pa_stable_v19_20140130 and got the following error when 
running patest_mono.exe on my Vista computer.

Assertion failed: FALSE, file src\hostapi\wdmks\pa_win_wdmks.c, line 1054

The last traces of the debug output is appended to this mail.

Any idea for a  solution  ?

Thanks and best regards

Pierre Vanhoucke

BEBUG OUTPUT
---------------------
Device 18 has capture alias
Interface 18, Name: A
FilterNew: Creating filter 'ASUS Xonar D1 Digital'
FilterNew: Opening filter...
FilterUse {
} FilterUse
DumpConnectionsAndNodes: connections=4, nodes=2
   Connection: 0 - FromNode=4294967295,FromPin=1 -> ToNode=0,ToPin=1
   Connection: 1 - FromNode=0,FromPin=0 -> ToNode=4294967295,ToPin=0
   Connection: 2 - FromNode=4294967295,FromPin=4 -> ToNode=1,ToPin=1
   Connection: 3 - FromNode=1,FromPin=0 -> ToNode=4294967295,ToPin=5
   Node: 0 - {4D837FE0-C555-11D0-8A2B-00A0C9255AC1}
   Node: 1 - {DFF21FE5-F70F-11D0-B917-00A0C9223196}
PinNew {
PinNew: Creating pin 0:
PinNew: Checking 2 no of dataranges...
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: Default sample rate = 44100 Hz
PinNew: Finding topology pin...
FindStartConnectionFrom: Checking 4 connections...GetConnectedPin: 
count=2, forw
ard=0, muxPosition=-1
GetConnectionFrom: Checking 4 connections... (pTo = 00668040)
GetConnectionFrom: Returning 00668030
PinNew: Getting physical connection...
PinNew: Physical connection found!
PinNew: Creating topology filter 
'\\?\PCI#VEN_13F6&DEV_8788&SUBSYS_834F1043&REV_
00#4&345e1173&0&00F0#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\AB_Topology'
FilterNew: Creating filter ''
FilterNew: Opening filter...
FilterUse {
} FilterUse
DumpConnectionsAndNodes: connections=9, nodes=7
   Connection: 0 - FromNode=4294967295,FromPin=0 -> ToNode=0,ToPin=1
   Connection: 1 - FromNode=0,FromPin=0 -> ToNode=1,ToPin=1
   Connection: 2 - FromNode=1,FromPin=0 -> ToNode=2,ToPin=1
   Connection: 3 - FromNode=4294967295,FromPin=3 -> ToNode=6,ToPin=1
   Connection: 4 - FromNode=6,FromPin=0 -> ToNode=4294967295,ToPin=4
   Connection: 5 - FromNode=2,FromPin=0 -> ToNode=3,ToPin=1
   Connection: 6 - FromNode=3,FromPin=0 -> ToNode=4,ToPin=1
   Connection: 7 - FromNode=4,FromPin=0 -> ToNode=4294967295,ToPin=1
   Connection: 8 - FromNode=5,FromPin=0 -> ToNode=4294967295,ToPin=2
   Node: 0 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
   Node: 1 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
   Node: 2 - {DA441A60-C556-11D0-8A2B-00A0C9255AC1}
   Node: 3 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
   Node: 4 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
   Node: 5 - {2CEAF780-C556-11D0-8A2B-00A0C9255AC1}
   Node: 6 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
FilterRelease {
} FilterRelease
PinNew: Opening topology filter...FilterUse {
} FilterUse
PinNew: Checking for input endpoint pin id (0)...
FindStartConnectionFrom: Checking 9 connections...GetConnectedPin: 
count=7, forw
ard=0, muxPosition=0
GetNumberOfConnectionsTo: Checking 9 connections...GetConnectionFrom: 
Checking 9
  connections... (pTo = 006BAE60)
GetConnectionFrom: Returning 00000000
PinNew: Done with inputs.
PinNew: Input friendly name 'Input'
PinNew: Releasing topology filter...
FilterRelease {
} FilterRelease
Pin created successfully
} PinNew
PinNew {
PinNew: Creating pin 1:
PinNew: Not source/sink
PinNew: Error -9996
} PinNew
PinNew {
PinNew: Creating pin 2:
PinNew: Checking 16 no of dataranges...
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 24 bit supported
PinNew: Default sample rate = 44100 Hz
PinNew: Finding topology pin...
FindStartConnectionTo: Checking 4 connections...Assertion failed: FALSE, 
file sr
c\hostapi\wdmks\pa_win_wdmks.c, line 1054

This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application's support team for more information.

C:\Users\Pierre\Desktop\PA_mingw\portaudio_mingw_30_01_2014\pa_stable_v19_201401
30\portaudio>
Spencer Russell | 21 Aug 18:28 2014
Picon

Waiting on a file descriptor for reading?

I'm looking into the read/write API rather than the gymnastics I'm currently doing to get the callback API working in my Julia wrapper. I'm trying to figure out the best way to periodically run my audio task to process input and supply output.

I don't want to use the blocking versions because if there's no audio available to process I'd like to hand control back to the Julia event loop so other tasks can run. 

One option is to just poll on a timer and check to see if there's data to handle. This seems pretty feasible and simple but feels sloppy.

Julia tasks can wait on a file descriptor, so what I'd love to do is get a file descriptor from PortAudio that would get written to whenever there was new input data, so my task would immediately wake up and handle the new input.

It looks like exposing a file descriptor was discussed way back in 2003:

Is there a good way to do this, or should I just stick to the polling approach?

_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Sebastian Gesemann | 21 Aug 17:49 2014
Picon

Version Problem, Portaudio-Binding for Rust

Hi!

I've written a Portaudio binding for the Rust programming language.
This means, I don't use the header portaudio.h during compilation. And
that makes me a little concerned about different versions of
Portaudio. For example, if some Portaudio structs or enums change with
a newer Portaudio version, my binding will still link successfully but
probably stop working and possibly crash.

I'm open for suggestions. Ideally, these discrepancies are detected at
compile-time or at link-time of the binding. But I'm also fine with a
runtime check that simply uses Portaudio's version to tell whether
it's compatible or not. But to implement this, I would have to know
the policy around Portaudio's versioning. For example, it would be
incredibly helpful, if someone told me something along the lines of
"Every version below 2000 should be binary-backwards compatible to
programs you build using a V19 header" or something like this.

Also, is there any important difference between version 1899 and 1900?
The lbportaudio2 I have installed on my system reports version 1899 to
me while the accompanioning header says in the comments that I should
expect something like 1900 as version number.

Cheers!
sg
matthew coleman | 19 Aug 10:37 2014
Picon

Faster initialization of alsa

<at> Alan,  Thanks for your support.  I would have replied sooner had I not
been so novice at using this basic mailing list.

My ubuntu 12.04 decided to spontaneously upgrade itself to 14.04 oblivion.
 So much for LTS!  Mint cinnamon is now installed and that does not have
the alsa waiting problems.  I am still missing some bluetooth rfcomm
settings that might slow it down again.

If I get stuck again then I will investigate a software modification.

/Matt
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Stephen Blinkhorn | 18 Aug 03:07 2014

Bus error when calling Pa_StartStream

Hello,

First post here. I have adapted one of the examples with the intention of creating a pass-thru effect for an
installation on OS X. I’m using the latest stable build. I can successfully route audio from my input
source to the built-in output, however, when I attempt to address my Digidesign Mbox card I get a bus error
when calling Pa_StartStream.

I use two other PortAudio apps (PD, Audacity) and they both successfully address this hardware on this
system. So I’m wondering if anything has changed in recent builds or if there is something obviously
wrong with my code? Here’s the code I am using:

Thanks in advance for any help (and yes, I know the Mbox is rather old now :)
Stephen

Callback:
static int patestCallback2( const void *inputBuffer, void *outputBuffer,
                           unsigned long framesPerBuffer,
                           const PaStreamCallbackTimeInfo* timeInfo,
                           PaStreamCallbackFlags statusFlags,
                           void *userData )
{
	float *in = (float*)inputBuffer;
	float *out = (float*)outputBuffer;
	
	for( int i=0; i<framesPerBuffer*2; i++ )
    {
    	*out++ = *in++;
    }
    return 0;
}

PortAudio:
int main(void);
int main(void)
{
    PaStream *stream;
    PaError err;

    printf("PortAudio Test: input to output routing.\n");
    /* Initialize our data for use by callback. */
    data.left_phase = data.right_phase = 0.0;
    /* Initialize library before making any other calls. */
    err = Pa_Initialize();
    if( err != paNoError ) goto error;
	
	int numDevices;
	numDevices = Pa_GetDeviceCount();
	int inputDeviceIdx = 4;
	int outputDeviceIdx = 2;

    // setup device
	double srate = Pa_GetDeviceInfo( outputDeviceIdx )->defaultSampleRate;
	srate = 44100.0;
	unsigned long framesPerBuffer = 512;

	PaSampleFormat fmt = paFloat32 | paNonInterleaved;
	
	PaStreamParameters inputParameters;
	bzero( &inputParameters, sizeof( inputParameters ) );
	inputParameters.channelCount = Pa_GetDeviceInfo( inputDeviceIdx )->maxInputChannels;
	inputParameters.device = inputDeviceIdx;
	inputParameters.sampleFormat = paFloat32;
	inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputDeviceIdx)->defaultLowInputLatency ;
	inputParameters.hostApiSpecificStreamInfo = NULL;
	
	PaStreamParameters outputParameters;
	bzero( &outputParameters, sizeof( outputParameters ) );
	outputParameters.channelCount = Pa_GetDeviceInfo( outputDeviceIdx )->maxOutputChannels;;
	outputParameters.device = outputDeviceIdx;
	outputParameters.sampleFormat = paFloat32;
	outputParameters.suggestedLatency =
Pa_GetDeviceInfo(outputDeviceIdx)->defaultLowOutputLatency ;
	outputParameters.hostApiSpecificStreamInfo = NULL;
	
	err = Pa_IsFormatSupported(&inputParameters, &outputParameters, srate);
    if (err != paFormatIsSupported) {
    	printf("Error: stream format invalid.\n");
    	return err;
    }

	err = Pa_OpenStream(	&stream,
							&inputParameters, &outputParameters,
							srate, framesPerBuffer, paNoFlag,
							patestCallback2,
							NULL);
    if( err != paNoError ) goto error;
	
    err = Pa_StartStream( stream );
    if( err != paNoError ) goto error;

    /* Sleep for several seconds. */
    Pa_Sleep(NUM_SECONDS*1000);
	
    err = Pa_StopStream( stream );
    if( err != paNoError ) goto error;
    err = Pa_CloseStream( stream );
    if( err != paNoError ) goto error;
    Pa_Terminate();
    printf("Test finished.\n");
    return err;
error:
    Pa_Terminate();
    fprintf( stderr, "An error occured while using the portaudio stream\n" );
    fprintf( stderr, "Error number: %d\n", err );
    fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
    return err;
}

Gmane