Notification sounds cause multimedia to pause

Bug #1534776 reported by Andrew Hayzen
230
This bug affects 40 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
John McAleely
media-hub (Ubuntu)
Invalid
Critical
Unassigned
media-hub (Ubuntu RTM)
Invalid
Critical
Jim Hodapp
qtmultimedia-opensource-src (Ubuntu RTM)
Fix Released
Critical
Albert Astals Cid
qtubuntu-media (Ubuntu)
Fix Released
Undecided
Jim Hodapp
qtubuntu-media (Ubuntu RTM)
Fix Released
Undecided
Jim Hodapp
unity8 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Screenshot audio is not using alert role causing music to stop

What happened:
1) Open the music-app and play some music
2) Take a screenshot
3) Notice when the audio plays that the music stops

What was expected to happen:
At step 3 for the music to 'duck' while the alert is being played and then continue afterwards

It looks like the role is being attempted to be set here [0] but doesn't appear to be working

$ system-image-cli -i
current build number: 210
device name: mako
channel: ubuntu-touch/rc-proposed/bq-aquaris.en
last update: 2016-01-14 12:05:49
version version: 210
version ubuntu: 20160114
version device: 20160112
version custom: mako-1.1

0 - http://bazaar.launchpad.net/~unity-team/unity8/trunk/view/head:/qml/Components/NotificationAudio.qml

Related branches

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Furthermore, telegram notifications have the same affect, looking at the role they also are not using the alert role. Are they emitted from the same code?

Changed in canonical-devices-system-image:
assignee: nobody → Michał Sawicz (saviq)
importance: Undecided → Medium
milestone: none → ww08-2016
status: New → Confirmed
Revision history for this message
Michał Sawicz (saviq) wrote :

Hmm, isn't in on purpose that multimedia "duck" away from notification sounds?

Changed in unity8 (Ubuntu):
status: New → Incomplete
summary: - Screenshot audio is not using alert role causing music to stop
+ Notification sounds cause lower multimedia volume
Revision history for this message
Andrew Hayzen (ahayzen) wrote : Re: Notification sounds cause lower multimedia volume

It is, but if you look at the audio role from the media-hub.log when a screenshot/telegram notification appears, it is using the 'multimedia' role not the 'alert' role. This is what should be fixed.

Changed in unity8 (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in media-hub (Ubuntu):
status: New → Confirmed
Changed in qtubuntu-media (Ubuntu):
status: New → Confirmed
Changed in unity8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Please note that the bug is stating that the ducking does not work when notifications occur (the music stops as the audio role is incorrect).

Revision history for this message
Michał Sawicz (saviq) wrote :

Sorry, I misread the bug description.

summary: - Notification sounds cause lower multimedia volume
+ Notification sounds cause multimedia to pause
Revision history for this message
Michał Sawicz (saviq) wrote :

Oh, just realized what's happening here, we were relying on QtMultimedia 5.6 import existence alone, without checking whether the new role values are used.

We need to check also if MediaPlayer.NotificationRole is a thing.

Changed in unity8 (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Critical
Changed in qtubuntu-media (Ubuntu):
status: Confirmed → Invalid
Changed in media-hub (Ubuntu):
status: Confirmed → Invalid
Changed in canonical-devices-system-image:
status: Confirmed → Triaged
importance: Medium → Critical
Changed in unity8 (Ubuntu):
assignee: nobody → Albert Astals Cid (aacid)
Changed in canonical-devices-system-image:
milestone: ww08-2016 → ww04-2016
status: Triaged → In Progress
Changed in unity8 (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Albert Astals Cid (aacid) wrote :

The problem here is that we can not use MediaPlayer.alert since it has never really worked, see https://bugreports.qt.io/browse/QTBUG-46758 that shows that lowercase enums just do not work.

I guess prior to OTA9 this worked because the media-hub was less picky about stopping one audio while playing another.

My suggested fix is that we add the uppercase variants of the enums in src/imports/multimedia/qdeclarativeaudio_p.h of qtmultimedia-opensource-src-5.4.1and then we can fix unity8 to use MediaPlayer.Alert.

I have tried that on my phone locally and fixes the issue (though it won't fix any other place that was trying to use MediaPlayer.alert).

Is this a valid solution?

Revision history for this message
Michał Sawicz (saviq) wrote :

I propose that we backport the new roles to vivid instead, this way we do it once and forget about it.

Changed in unity8 (Ubuntu):
status: In Progress → Won't Fix
assignee: Albert Astals Cid (aacid) → nobody
importance: Critical → Undecided
Changed in qtmultimedia-opensource-src (Ubuntu):
status: New → Confirmed
importance: Undecided → Critical
status: Confirmed → Triaged
assignee: nobody → Albert Astals Cid (aacid)
Jim Hodapp (jhodapp)
Changed in media-hub (Ubuntu):
status: Invalid → Triaged
importance: Undecided → Critical
Changed in media-hub (Ubuntu RTM):
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Albert Astals Cid (aacid) wrote :

While trying to backport the use of the new roles to vivid i found that the new roles probably don't work either (or i'm not understanding some parts of the puzzle) since if you look at http://paste.ubuntu.com/14694405/ it seems to me that we're casting from QAudio::Role to media::Player::AudioStreamRole but the names of those roles don't seem to match either.

I've opened bug https://bugs.launchpad.net/ubuntu/+source/media-hub/+bug/1539497 about it.

Can someone confirm whether that is a bug or i got lost in the layers of indirection?

Revision history for this message
Albert Astals Cid (aacid) wrote :

To get the new notification roles in the vivid qtmultimedia package we have to remove the adding_media_role_property.patch patch and add this one http://paste.ubuntu.com/14695521/

I'm not really sure how to get that into the overlay ppa since i've been told Qt there doesn't use branches like the ones we use in unity8.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Replacing the adding_media_role_property.patch with the new one does not apply unfortunately:

http://pastebin.ubuntu.com/14695625/

(aside from formatting issues there are some real failures)

Reproducing:
dget https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/stable-phone-overlay/+files/qtmultimedia-opensource-src_5.4.1-1ubuntu19~overlay2.dsc
quilt pop # 5 times or so
cp -a plain debian/patches/adding_media_role_property.patch # "plain" == downloaded from paste.ubuntu.com
debuild

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Discussed and sorted out the issues on IRC. Building now via ticket https://requests.ci-train.ubuntu.com/#/ticket/939 (silo 53).

Changed in qtmultimedia-opensource-src (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Thanks Timo.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The symbols were updated yesterday. If you test it successfully, please ask me or another trainguard to rebuild the current packages once more with final version numbers and then put it forward to QA.

(although maybe the silo will pile up other related changes like media-hub?)

Changed in telegram-app:
status: New → Triaged
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
milestone: ww04-2016 → ww08-2016
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The silo with Albert's backport of the audio roles was put up to get things in sync, but the root cause of this bug might make sense to debug separately even if the overall discussion of audio roles is in progress.

The bug itself is very critical to sensible use of music playback in the background.

affects: qtmultimedia-opensource-src (Ubuntu) → qtmultimedia-opensource-src (Ubuntu RTM)
Changed in canonical-devices-system-image:
assignee: Michał Sawicz (saviq) → John McAleely (john.mcaleely)
Changed in qtubuntu-media (Ubuntu RTM):
assignee: nobody → Jim Hodapp (jhodapp)
Changed in media-hub (Ubuntu RTM):
assignee: nobody → Jim Hodapp (jhodapp)
Michał Karnicki (karni)
no longer affects: telegram-app
Revision history for this message
Jim Hodapp (jhodapp) wrote :

qtubuntu-media portion of this fix is built in silo 53 now. It appears like some apps need to be updated as they're not setting the proper audio role for the new role types that come from QtMultimedia 5.6 into 5.4 now. As far as I can tell the backends from QtMultimedia down through pulseaudio are ok now but we need to go through each audio role and make sure of this.

Changed in qtubuntu-media (Ubuntu):
status: Invalid → In Progress
Changed in qtubuntu-media (Ubuntu RTM):
status: New → In Progress
Changed in qtubuntu-media (Ubuntu):
assignee: nobody → Jim Hodapp (jhodapp)
Revision history for this message
Albert Astals Cid (aacid) wrote :

I been doing some investigation since this doesn't still work, there's 3 things that i found need fixing:
  * qtmultimedia needs to install the usr/include/*/qt5/QtMultimedia/QAudioRoleControl and usr/include/*/qt5/QtMultimedia/qaudiorolecontrol.h files
  * qtubuntu-media needs to return an QAudioRoleControl on AalMediaPlayerService::requestControl with QAudioRoleControl_iid
 * AalMediaPlayerService::setAudioRole and AalMediaPlayerService::audioRole need to properly map between media::Player::AudioStreamRole and QAudio::Role since now they're only casting directly from one to the other and http://paste.ubuntu.com/15266060/ means that is not possible.

Jim will you take care of this?

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Thanks for investigating further Albert. I've added this as a story for my team's next sprint, so yes I'll handle fixing this issue.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Making progress on this. Need to get the patch to QtMultimedia applied to install QAudioRoleControl and qaudiorolecontrol.h and then the fix should be ready for wider testing again.

Jim Hodapp (jhodapp)
Changed in media-hub (Ubuntu):
status: Triaged → Invalid
Changed in media-hub (Ubuntu RTM):
status: Triaged → Invalid
Changed in qtmultimedia-opensource-src (Ubuntu RTM):
status: In Progress → Fix Committed
Changed in qtubuntu-media (Ubuntu):
status: In Progress → Fix Committed
Changed in qtubuntu-media (Ubuntu RTM):
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Revision history for this message
Gregory Opera (gregoryopera) wrote :

I can confirm, it's fixed for me...

Thanks!

--

bq Aquaris E5 HD Ubuntu Edition:
* OS build number: OTA-10.1
* Ubuntu Image part: 20160408.4
* Ubuntu build description: Ubuntu 15.04 - armhf (20160408-211605)
* Device Image part: 20160329-a9bacdb
* Device build description: VEGETA01A-S23A_BQ_L100EN_2012_160408
* Customization Image part: 20160324--36-54-vivid

Revision history for this message
cm-t 🦄🏂🌈🎵 (cm-t) wrote :

Not fixed on OTA-10.1 E4.5

 * launch music app
 * play music
 * receive **telegram** notification
 * music stop
 * not resuming

Revision history for this message
Albert Astals Cid (aacid) wrote :

Works for me, can anyone reproduce cm-t arudy's problem?

Revision history for this message
Gregory Opera (gregoryopera) wrote :

I can't use Telegram because of the (known) password/two-factor authentication issue, but I did try to replicate @cm-t 's problem with a text message, and was unable to do so...

With my screen off and music playing, the music softened/lowered in volume ("ducked"), my notification tone was heard at full volume, then the music resumed playing as per normal.

--

bq Aquaris E5 HD Ubuntu Edition
* OS: Ubuntu 15.04 (OTA-10.1)
* OS build number: OTA-10.1
* Ubuntu Image part: 20160408.4
* Ubuntu build description: Ubuntu 15.04 - armf (20160408-211605)
* Device Image part: 20160329-a9bacdb
* Device build description: VEGETA01A-S23A_BQ_L100EN_2012_160408
* Customisation Image [art: 20160324--36-54-vivid

Revision history for this message
Stefan (boldos) wrote :

After OTA-10 this issue is no longer there for me (on E5) and I consider it fixed.
St.

Changed in qtmultimedia-opensource-src (Ubuntu RTM):
status: Fix Committed → Fix Released
Jim Hodapp (jhodapp)
Changed in qtubuntu-media (Ubuntu):
status: Fix Committed → Fix Released
Changed in qtubuntu-media (Ubuntu RTM):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.