Created attachment 169067 [details] Stops the PCM when QAudioInput::suspend() is called The ALSA plugin doesn't suspend the ALSA device when the ::suspend() method is called. This results in underrun errors when it's resumed. In ALSA, stopping a pcm doesn't close it, so the ALSA stop/start functions map to the QAudioInput suspend/resume functions. Patch attached.
This looks like another very good candidate for upstreaming. Can you try sending that to Qt before we merge it into the port?
A similar patch should likely be made to the output path as well, though IIRC, ALSA will automatically stop (with an error) when it overruns the buffers. As for upstremaing it myself, that process combined with the fact that I'm not a C++ developer and how quickly they were to mark your bug report as invalid is very off-putting. I should be able give it a couple hours this weekend, but from the process description it'll take considerably more than that (especially given that I won't be testing on Linux).
The process is actually very simple; don't be put off by that bug report, that usually happens when people send patches through their bug tracker because they cannot accept those due to their use of a Contributor License Agreement (all patches must be sent through Gerrit). I can summarize the whole process in a few steps (most of it is just your usual Gerrit setup workflow): 1. Create an account in Qt's bug tracker (http://bugreports.qt.io) 2. Log into Gerrit with the same credentials and set up your name, SSH key etc (http://codereview.qt-project.org/#settings,contact) 3. Accept Qt's CLA. 4. git clone git://code.qt.io/qt/qtmultimedia.git 5. cd qtmultimedia 6. git remote add gerrit ssh://username@codereview.qt-project.org:29418/qt/qtmultimedia.git 7. scp -P 29418 username@codereview.qt-project.org:hooks/commit-msg .git/hooks 8. git fetch gerrit 9. git checkout -b my-work-branch 10. hack hack hack, commit 11. git push gerrit my-work-branch:refs/for/5.6 12. Go to the URL that's shown to you 13. CC relevant people. You can also CC me there.
Heh, I think we have differing opinions of what constitutes "very simple". Anyway, I'll give it a shot, but I expect it to spin and/or stagnate in the Gerrit review. I'm always happy to be proven wrong though. I'll be sure to CC you when I submit the patches.
Submitted to upstream Gerrit... https://codereview.qt-project.org/155884
A commit references this bug: Author: rakuco Date: Sat Apr 16 17:17:13 UTC 2016 New revision: 413463 URL: https://svnweb.freebsd.org/changeset/ports/413463 Log: Add patch to fix underrun errors in the ALSA plugin. The ALSA plugin doesn't suspend the ALSA device when the ::suspend() method is called. This results in underrun errors when it's resumed. In ALSA, stopping a pcm doesn't close it, so the ALSA stop/start functions map to the QAudioInput suspend/resume functions. PR: 208598 Submitted by: shurd MFH: 2016Q2 Changes: head/multimedia/qt5-multimedia/Makefile head/multimedia/qt5-multimedia/files/patch-git_9047d9b
I'm glad it worked out and you were proven wrong :-) Thanks for the patch!
A commit references this bug: Author: rakuco Date: Sat Apr 16 17:29:59 UTC 2016 New revision: 413466 URL: https://svnweb.freebsd.org/changeset/ports/413466 Log: MFH: r413463 Add patch to fix underrun errors in the ALSA plugin. The ALSA plugin doesn't suspend the ALSA device when the ::suspend() method is called. This results in underrun errors when it's resumed. In ALSA, stopping a pcm doesn't close it, so the ALSA stop/start functions map to the QAudioInput suspend/resume functions. PR: 208598 Submitted by: shurd Approved by: ports-secteam (junovitch) Changes: _U branches/2016Q2/ branches/2016Q2/multimedia/qt5-multimedia/Makefile branches/2016Q2/multimedia/qt5-multimedia/files/patch-git_9047d9b