Bug 208598 - multimedia/qt5-multimedia: ALSA QAudioInput::suspend() doesn't suspend
Summary: multimedia/qt5-multimedia: ALSA QAudioInput::suspend() doesn't suspend
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-07 07:54 UTC by Stephen Hurd
Modified: 2016-04-16 17:30 UTC (History)
0 users

See Also:
rakuco: maintainer-feedback+


Attachments
Stops the PCM when QAudioInput::suspend() is called (494 bytes, patch)
2016-04-07 07:54 UTC, Stephen Hurd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Hurd freebsd_committer 2016-04-07 07:54:40 UTC
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.
Comment 1 Raphael Kubo da Costa freebsd_committer 2016-04-13 16:08:11 UTC
This looks like another very good candidate for upstreaming. Can you try sending that to Qt before we merge it into the port?
Comment 2 Stephen Hurd freebsd_committer 2016-04-14 18:44:16 UTC
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).
Comment 3 Raphael Kubo da Costa freebsd_committer 2016-04-14 19:18:37 UTC
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.
Comment 4 Stephen Hurd freebsd_committer 2016-04-14 19:56:46 UTC
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.
Comment 5 Stephen Hurd freebsd_committer 2016-04-15 02:36:09 UTC
Submitted to upstream Gerrit...

https://codereview.qt-project.org/155884
Comment 6 commit-hook freebsd_committer 2016-04-16 17:17:45 UTC
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
Comment 7 Raphael Kubo da Costa freebsd_committer 2016-04-16 17:18:23 UTC
I'm glad it worked out and you were proven wrong :-) Thanks for the patch!
Comment 8 commit-hook freebsd_committer 2016-04-16 17:30:51 UTC
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