09-11-2012 06:05 AM
Is there any documentation regarding how thread priority/policy is affected of the application when it is sent to background.
E.g. application declares 'run_when_backgrounded', it is playing some audio content by decoding MP3 file and using sub-set of snd_pcm_... functions from QNX audio API. snd_pcm_write() is used in blocking manner, with total number of fragments (frags) around 16 (around 250 ms latency). The audio decoding phase is fast enough.
Whe application stays in the foreground in its own UI then audio playback is stable but once it is sent to background by swiping from the bottom of screen and when some other application is opened, like internet browser then audio starts sluttering.
The interesting thing is that SND_PCM_STATUS_UNDERRUN is not reported, it means that audio core of application is able to deliver data on time.
The audio rendering core is running under highest thread priority (63).
It looks like when backgounded the priority of application processes is changed to something else (to make UI and other front apps more responsive?) that is lower than usual and application does not receive enough CPU time. If SND_PCM_STATUS_UNDERRUN is not set then does it mean that audio core of QNX is suffering from priority degradation of background task?
Are there any tricks to improve situation?