Bug in QtMultimedia QAudioOutput ALSA module
-
Hello,
I'm writing multimedia applications with QT and I think I have found a bug. In this function:
839 qint64 OutputPrivate::writeData(const char* data, qint64 len)
840 {
841 int retry = 0;
842 qint64 written = 0;
843 if((audioDevice->deviceState == QAudio::ActiveState)
844 ||(audioDevice->deviceState == QAudio::IdleState)) {
845 while(written < len) {
846 int chunk = audioDevice->write(data+written,(len-written));
847 if(chunk <= 0)
848 retry++;
849 written+=chunk;
850 if(retry > 10)
851 return written;
852 }
853 }
854 return written;
855
856 }If audioDevice->write ( line 846 ) returns an negative error code to chunk variable it must not be added to the written variable.
Besides of that it seems that the whole approach of using ALSA API in this module wrong and is causing ridicoulusly high CPU usage. Mainly because it uses non blocking mode and tries to write ( syscall !!! ) multiple times without at a sleep call in between. Just lik in the function above.
Who is responsible for this? Can I provide an patch?
-
Try looking if there has been a bug logged against it, or log one yourself. "bug report":https://bugreports.qt-project.org