Peter Lukac
2010-05-05 11:53:14 UTC
Hello all,
I have litte problem with portaudio library on my ARM linux device...
I need run more program which use different API at the some times (portaudio,
old OSS , and ALSA) therefore i set dmix plugin for mixing audio.
Every combination with portaudio program make problem
portaudio - OSS
portaudio - ALSA( aplay )
portaudio - portaudio
Sometimes when sound is playing (with "portaudio program") and my CPU is
overload on very little time ( when i run another application which playing
sound) sound stop playing and when i want quit application, application is
"lock" on joining thread. I'm not sure if CPU overload is reason why this
problem occured maybe it is when second application initialize audio or do
something else...
This problem occured on daily snapshot too..
created Tuesday, 04-May-2010 21:37:03 PDT
here is log with enabling debug output:
PA message: Stopping callback
PA message: PaUnixThread_Terminate: Joining thread 1026
I look at source and i found where problem occured.
file: portaudio/src/os/unix/pa_unix_util.c
method: PaError PaUnixThread_Terminate( PaUnixThread* self, int wait, PaError*
exitResult )
line: PA_ENSURE_SYSTEM( pthread_join( self->thread, &pret ), 0 );
btw: 9 line up is nice comment :)
/* TODO: Make join time out */
ok this is only consequence with problem which occured here:
file: portaudio/src/hostapi/alsa/pa_linux_alsa.c
method: static void *CallbackThreadFunc( void *userData )
I don't know how portaudio exactly works but in this method (thread) is call
method:
PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) );
and sometimes never end because loop inside this method never end.
while( pollPlayback || pollCapture )
{
...
}
i suppose this is point where loop should be end
/* check the return status of our pfds */
if( pollCapture )
{
PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->capture, capturePfds,
&pollCapture, &xrun ) );
}
if( pollPlayback )
{
PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->playback,
playbackPfds, &pollPlayback, &xrun ) );
}
if( xrun )
{
break;
}
but when ? Can me somebody help what i should be check and found problem?
Some information on my system:
[root at device pjproject]# cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.17.
[root at device pjproject]# aplay --version
aplay: version 1.0.14 by Jaroslav Kysela <perex at suse.cz>
1.What implementation are you using? WMME, DirectSound, ASIO, etc.
ALSA
2.What OS are you using? Win98, Mac OS8, Linux, etc.
LINUX it's ARM device
3.What audio device are you using? SoundBlaster Live, MOTU408, etc.
4.Are there any error messages to report?
here is all portaudio log...
***INITIALIZATION***
PA message: before paHostApiInitializers[0].
PA message: BuildDeviceList: Ignoring ALSA plugin device cards of type unknown
PA message: BuildDeviceList: Found plugin front of type unknown
PA message: BuildDeviceList: Found plugin rear of type unknown
PA message: BuildDeviceList: Found plugin center_lfe of type unknown
PA message: BuildDeviceList: Found plugin side of type unknown
PA message: BuildDeviceList: Found plugin surround40 of type unknown
PA message: BuildDeviceList: Found plugin surround41 of type unknown
PA message: BuildDeviceList: Found plugin surround50 of type unknown
PA message: BuildDeviceList: Found plugin surround51 of type unknown
PA message: BuildDeviceList: Found plugin surround71 of type unknown
PA message: BuildDeviceList: Found plugin iec958 of type unknown
PA message: BuildDeviceList: Found plugin spdif of type unknown
PA message: BuildDeviceList: Found plugin dmix of type unknown
PA message: BuildDeviceList: Ignoring ALSA plugin device dsnoop of type
unknown
PA message: BuildDeviceList: Found plugin modem of type unknown
PA message: BuildDeviceList: Found plugin phoneline of type unknown
PA message: BuildDeviceList: Ignoring ALSA plugin device hw of type hw
PA message: BuildDeviceList: Ignoring ALSA plugin device plughw of type plug
PA message: BuildDeviceList: Ignoring ALSA plugin device plug of type plug
PA message: BuildDeviceList: Ignoring ALSA plugin device shm of type shm
PA message: BuildDeviceList: Ignoring ALSA plugin device tee of type file
PA message: BuildDeviceList: Ignoring ALSA plugin device file of type file
PA message: BuildDeviceList: Ignoring ALSA plugin device null of type null
PA message: BuildDeviceList: Found plugin default of type plug
PA message: BuildDeviceList: Found plugin vystup of type dmix
PA message: BuildDeviceList: Found plugin dsp0 of type plug
PA message: Default input device: UCB1400: (hw:0,0)
PA message: Default output device: UCB1400: (hw:0,0)
PA message: FillInDevInfo: Adding device UCB1400: (hw:0,0): 0
PA message: FillInDevInfo: Adding device vystup: 1
PA message: GropeDevice: Limiting number of plugin channels to 128
PA message: FillInDevInfo: Adding device dsp0: 2
PA message: FillInDevInfo: Adding device dmix: 3
PA message: GropeDevice: Limiting number of plugin channels to 128
PA message: Default output device: default
PA message: FillInDevInfo: Adding device default: 4
PA message: BuildDeviceList: Building device list took 0.410387 seconds
PA message: after paHostApiInitializers[0].
***PLAYING SOUND***
PA message: AlsaOpen: Opening device vystup
PA message: PaAlsaStreamComponent_DetermineFramesPerBuffer: The determined
period size (320) is less than minimum (1024)
PA message: PaAlsaStream_Configure: Playback period size: 1024, latency:
0.256000
..now sound is broken
...i want quit application...
PA message: Stopping callback
PA message: PaUnixThread_Terminate: Joining thread 1026
...and waiting..
Advice or hint is welcome :)
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://music.columbia.edu/pipermail/portaudio/attachments/20100505/97085009/attachment.html>
I have litte problem with portaudio library on my ARM linux device...
I need run more program which use different API at the some times (portaudio,
old OSS , and ALSA) therefore i set dmix plugin for mixing audio.
Every combination with portaudio program make problem
portaudio - OSS
portaudio - ALSA( aplay )
portaudio - portaudio
Sometimes when sound is playing (with "portaudio program") and my CPU is
overload on very little time ( when i run another application which playing
sound) sound stop playing and when i want quit application, application is
"lock" on joining thread. I'm not sure if CPU overload is reason why this
problem occured maybe it is when second application initialize audio or do
something else...
This problem occured on daily snapshot too..
created Tuesday, 04-May-2010 21:37:03 PDT
here is log with enabling debug output:
PA message: Stopping callback
PA message: PaUnixThread_Terminate: Joining thread 1026
I look at source and i found where problem occured.
file: portaudio/src/os/unix/pa_unix_util.c
method: PaError PaUnixThread_Terminate( PaUnixThread* self, int wait, PaError*
exitResult )
line: PA_ENSURE_SYSTEM( pthread_join( self->thread, &pret ), 0 );
btw: 9 line up is nice comment :)
/* TODO: Make join time out */
ok this is only consequence with problem which occured here:
file: portaudio/src/hostapi/alsa/pa_linux_alsa.c
method: static void *CallbackThreadFunc( void *userData )
I don't know how portaudio exactly works but in this method (thread) is call
method:
PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) );
and sometimes never end because loop inside this method never end.
while( pollPlayback || pollCapture )
{
...
}
i suppose this is point where loop should be end
/* check the return status of our pfds */
if( pollCapture )
{
PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->capture, capturePfds,
&pollCapture, &xrun ) );
}
if( pollPlayback )
{
PA_ENSURE( PaAlsaStreamComponent_EndPolling( &self->playback,
playbackPfds, &pollPlayback, &xrun ) );
}
if( xrun )
{
break;
}
but when ? Can me somebody help what i should be check and found problem?
Some information on my system:
[root at device pjproject]# cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.17.
[root at device pjproject]# aplay --version
aplay: version 1.0.14 by Jaroslav Kysela <perex at suse.cz>
1.What implementation are you using? WMME, DirectSound, ASIO, etc.
ALSA
2.What OS are you using? Win98, Mac OS8, Linux, etc.
LINUX it's ARM device
3.What audio device are you using? SoundBlaster Live, MOTU408, etc.
4.Are there any error messages to report?
here is all portaudio log...
***INITIALIZATION***
PA message: before paHostApiInitializers[0].
PA message: BuildDeviceList: Ignoring ALSA plugin device cards of type unknown
PA message: BuildDeviceList: Found plugin front of type unknown
PA message: BuildDeviceList: Found plugin rear of type unknown
PA message: BuildDeviceList: Found plugin center_lfe of type unknown
PA message: BuildDeviceList: Found plugin side of type unknown
PA message: BuildDeviceList: Found plugin surround40 of type unknown
PA message: BuildDeviceList: Found plugin surround41 of type unknown
PA message: BuildDeviceList: Found plugin surround50 of type unknown
PA message: BuildDeviceList: Found plugin surround51 of type unknown
PA message: BuildDeviceList: Found plugin surround71 of type unknown
PA message: BuildDeviceList: Found plugin iec958 of type unknown
PA message: BuildDeviceList: Found plugin spdif of type unknown
PA message: BuildDeviceList: Found plugin dmix of type unknown
PA message: BuildDeviceList: Ignoring ALSA plugin device dsnoop of type
unknown
PA message: BuildDeviceList: Found plugin modem of type unknown
PA message: BuildDeviceList: Found plugin phoneline of type unknown
PA message: BuildDeviceList: Ignoring ALSA plugin device hw of type hw
PA message: BuildDeviceList: Ignoring ALSA plugin device plughw of type plug
PA message: BuildDeviceList: Ignoring ALSA plugin device plug of type plug
PA message: BuildDeviceList: Ignoring ALSA plugin device shm of type shm
PA message: BuildDeviceList: Ignoring ALSA plugin device tee of type file
PA message: BuildDeviceList: Ignoring ALSA plugin device file of type file
PA message: BuildDeviceList: Ignoring ALSA plugin device null of type null
PA message: BuildDeviceList: Found plugin default of type plug
PA message: BuildDeviceList: Found plugin vystup of type dmix
PA message: BuildDeviceList: Found plugin dsp0 of type plug
PA message: Default input device: UCB1400: (hw:0,0)
PA message: Default output device: UCB1400: (hw:0,0)
PA message: FillInDevInfo: Adding device UCB1400: (hw:0,0): 0
PA message: FillInDevInfo: Adding device vystup: 1
PA message: GropeDevice: Limiting number of plugin channels to 128
PA message: FillInDevInfo: Adding device dsp0: 2
PA message: FillInDevInfo: Adding device dmix: 3
PA message: GropeDevice: Limiting number of plugin channels to 128
PA message: Default output device: default
PA message: FillInDevInfo: Adding device default: 4
PA message: BuildDeviceList: Building device list took 0.410387 seconds
PA message: after paHostApiInitializers[0].
***PLAYING SOUND***
PA message: AlsaOpen: Opening device vystup
PA message: PaAlsaStreamComponent_DetermineFramesPerBuffer: The determined
period size (320) is less than minimum (1024)
PA message: PaAlsaStream_Configure: Playback period size: 1024, latency:
0.256000
..now sound is broken
...i want quit application...
PA message: Stopping callback
PA message: PaUnixThread_Terminate: Joining thread 1026
...and waiting..
Advice or hint is welcome :)
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://music.columbia.edu/pipermail/portaudio/attachments/20100505/97085009/attachment.html>