Pa_StopStream(..) from PaStreamFinishedCallback on ALSA

View: New views
3 Messages — Rating Filter:   Alert me  

Pa_StopStream(..) from PaStreamFinishedCallback on ALSA

by Bjoern Rasmussen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

I'm writing a VoIP application where I have an audio stream for each user. Once voice data comes in I call Pa_StartStream() and when there's no more data I return paComplete in the PaStreamCallback. I've also registered the PaStreamFinishedCallback so I can call PaStopStream(.) to pause the stream until new data arrives (afterwhich I call Pa_StartStream() again).

This all works fine with DirectSound but now that I'm porting it to Linux with ALSA I get an assertion error when I call Pa_StopStream() from inside the PaStreamFinishedCallback callback. Here's the error:

Expression 'pthread_join( self->thread, &pret )' failed in 'src/os/unix/pa_unix_util.c', line: 406
Expression 'PaUnixThread_Terminate( &stream->thread, !abort, &threadRes )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2241

The error returned by by Pa_StopStream is -9999. How come I can't call Pa_StopStream() from inside the   PaStreamFinishedCallback callback?

I'm using the latest PortAudio snapshot (V19).


-- Bjoern

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
_______________________________________________
Portaudio mailing list
Portaudio@...
http://techweb.rfa.org/mailman/listinfo/portaudio

Re: Pa_StopStream(..) from PaStreamFinishedCallback on ALSA

by Ross Bencina-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Bjoern

I'm not sure if/where it's documented, but PaStreamFinishedCallback is an
asychronous callback just like the usual audio stream callback. The same
liimitations apply to what you can/cant call there -- including not calling
any other Pa_* functions.

Ross.



----- Original Message -----
From: "Bjoern Rasmussen" <bjoern_rasmussen@...>
To: <portaudio@...>
Sent: Wednesday, June 25, 2008 5:48 AM
Subject: [Portaudio] Pa_StopStream(..) from PaStreamFinishedCallback on ALSA


>
> Hi
>
> I'm writing a VoIP application where I have an audio stream for each user.
> Once voice data comes in I call Pa_StartStream() and when there's no more
> data I return paComplete in the PaStreamCallback. I've also registered the
> PaStreamFinishedCallback so I can call PaStopStream(.) to pause the stream
> until new data arrives (afterwhich I call Pa_StartStream() again).
>
> This all works fine with DirectSound but now that I'm porting it to Linux
> with ALSA I get an assertion error when I call Pa_StopStream() from inside
> the PaStreamFinishedCallback callback. Here's the error:
>
> Expression 'pthread_join( self->thread, &pret )' failed in
> 'src/os/unix/pa_unix_util.c', line: 406
> Expression 'PaUnixThread_Terminate( &stream->thread, !abort, &threadRes )'
> failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2241
>
> The error returned by by Pa_StopStream is -9999. How come I can't call
> Pa_StopStream() from inside the   PaStreamFinishedCallback callback?
>
> I'm using the latest PortAudio snapshot (V19).
>
>
> -- Bjoern
>
> _________________________________________________________________
> News, entertainment and everything you care about at Live.com. Get it now!
> http://www.live.com/getstarted.aspx
> _______________________________________________
> Portaudio mailing list
> Portaudio@...
> http://techweb.rfa.org/mailman/listinfo/portaudio
>

_______________________________________________
Portaudio mailing list
Portaudio@...
http://techweb.rfa.org/mailman/listinfo/portaudio

Re: Pa_StopStream(..) from PaStreamFinishedCallback on ALSA

by Bjoern Rasmussen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

Thanks for your reply.

I wasn't aware of that. Also it works fine with DirectSound, so I 've never noticed.

-- Bjoern





> From: rossb-lists@...
> To: bjoern_rasmussen@...; portaudio@...
> Subject: Re: [Portaudio] Pa_StopStream(..) from PaStreamFinishedCallback on ALSA
> Date: Thu, 26 Jun 2008 19:55:04 +1000
>
> Hi Bjoern
>
> I'm not sure if/where it's documented, but PaStreamFinishedCallback is an
> asychronous callback just like the usual audio stream callback. The same
> liimitations apply to what you can/cant call there -- including not calling
> any other Pa_* functions.
>
> Ross.
>
>
>
> ----- Original Message -----
> From: "Bjoern Rasmussen"
> To:
> Sent: Wednesday, June 25, 2008 5:48 AM
> Subject: [Portaudio] Pa_StopStream(..) from PaStreamFinishedCallback on ALSA
>
>
>>
>> Hi
>>
>> I'm writing a VoIP application where I have an audio stream for each user.
>> Once voice data comes in I call Pa_StartStream() and when there's no more
>> data I return paComplete in the PaStreamCallback. I've also registered the
>> PaStreamFinishedCallback so I can call PaStopStream(.) to pause the stream
>> until new data arrives (afterwhich I call Pa_StartStream() again).
>>
>> This all works fine with DirectSound but now that I'm porting it to Linux
>> with ALSA I get an assertion error when I call Pa_StopStream() from inside
>> the PaStreamFinishedCallback callback. Here's the error:
>>
>> Expression 'pthread_join( self->thread, &pret )' failed in
>> 'src/os/unix/pa_unix_util.c', line: 406
>> Expression 'PaUnixThread_Terminate( &stream->thread, !abort, &threadRes )'
>> failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2241
>>
>> The error returned by by Pa_StopStream is -9999. How come I can't call
>> Pa_StopStream() from inside the PaStreamFinishedCallback callback?
>>
>> I'm using the latest PortAudio snapshot (V19).
>>
>>
>> -- Bjoern
>>
>> _________________________________________________________________
>> News, entertainment and everything you care about at Live.com. Get it now!
>> http://www.live.com/getstarted.aspx
>> _______________________________________________
>> Portaudio mailing list
>> Portaudio@...
>> http://techweb.rfa.org/mailman/listinfo/portaudio
>>
>

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
_______________________________________________
Portaudio mailing list
Portaudio@...
http://techweb.rfa.org/mailman/listinfo/portaudio
LightInTheBox - Buy quality products at wholesale price