Getting media permissions fails with Isolated Process
Categories
(GeckoView :: General, task, P2)
Tracking
(firefox139 fixed)
| Tracking | Status | |
|---|---|---|
| firefox139 | --- | fixed |
People
(Reporter: owlish, Assigned: olivia)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [sandboxing] [geckoview:2022q3] [fxdroid][geckoview])
Attachments
(1 file)
requestRecordingPermission method fails during the tests.
val isActive = mainSession.waitForJS(
"""$code
this.stream.then(stream => {
if (!stream.active || stream.id == '') {
return false;
}
return true;
})
""".trimMargin()) as Boolean
times out.
Affected tests:
- org.mozilla.geckoview.test.MediaDelegateTest#testDeviceRecordingEventVideo
- org.mozilla.geckoview.test.PermissionDelegateTest#media
- org.mozilla.geckoview.test.MediaDelegateXOriginTest#testDeviceRecordingEventAudioAndVideoInXOriginIframe
Needs investigation
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
Updated•4 years ago
|
| Reporter | ||
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Moving isolated process bugs to the new GeckoView::Sandboxing component.
| Comment hidden (Intermittent Failures Robot) |
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
|
||
Testing latest state in this try.
I'll revisit to interpret results.
| Assignee | ||
Comment 5•1 year ago
|
||
Tests enabled:
MediaDelegateTest.kt:
- testDeviceRecordingEventVideo
MediaDelegateXOriginTest.kt:
- testDeviceRecordingEventAudioAndVideoInXOriginIframe
PermissionDelegateTest.kt:
- media
Failures still occurring:
-
TEST-UNEXPECTED-FAIL | org.mozilla.geckoview.test.MediaDelegateTest#testDeviceRecordingEventVideo | org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutException: Timed out after 30000ms -
TEST-UNEXPECTED-FAIL | org.mozilla.geckoview.test.MediaDelegateXOriginTest#testDeviceRecordingEventAudioAndVideoInXOriginIframeNoAllow | org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutException: Timed out after 30000ms -
Something about enabling theses tests also seems to also be causing chaos failures in
NavigationDelegateTest? (I don't think it is in tree because I have a run on the same-day that is green.) Needs to be confirmed.
Happening in all variants.
No failures:
- media
I'll update media in bug 1698216 or bug 1698230, since those runs look clear and I'll be updating conditions in the area.
| Assignee | ||
Comment 6•1 year ago
|
||
When working on bug 1698216, I tried to open the media test. Surprisingly, it caused failures. I did not update media in that bug and will leave the investigation here.
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
•
|
||
I had thought it might just be something on the GeckoView side due to media permissions, but it seems deeper. I have the impression that the permission is granted based on logging, but something is timing out when the next part begins
Testing on Android 9 emulator.
These tests have these logs, which seem to be the root issue:
02-27 12:22:48.294 21686 21709 W ServiceManager: Service media.audio_flinger didn't start. Returning NULL
02-27 12:22:48.294 21686 21709 W AudioSystem: AudioFlinger not published, waiting...
./mach geckoview-junit org.mozilla.geckoview.test.MediaDelegateXOriginTest#testDeviceRecordingEventAudioAndVideoInXOriginIframe seems to get a little further:
02-27 12:26:02.984 22671 22718 I Gecko : [Child 22671, MediaSupervisor #1] WARNING: Did not initialize sbrandName, and not on the main thread?: 'sBrandName', file /Users/olivia/Repos/gecko/dom/media/CubebUtils.cpp:570
02-27 12:26:02.985 22671 22718 I Gecko : [Child 22671, MediaSupervisor #1] WARNING: Could not register the audio output device collection changed callback.: file /Users/olivia/Repos/gecko/dom/media/webrtc/CubebDeviceEnumerator.cpp:69
02-27 12:26:02.985 22671 22718 I Gecko : [Child 22671, MediaSupervisor #1] WARNING: Could not register the audio input device collection changed callback.: file /Users/olivia/Repos/gecko/dom/media/webrtc/CubebDeviceEnumerator.cpp:78
Unassigned myself since it seems to be deeper in the media stack than I originally hoped.
| Assignee | ||
Comment 8•1 year ago
•
|
||
Leaving here for reference - last line I see executed on these tests from GV side logging is in getAudioOutputSampleRate at final String prop = am.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE); here. (Seems to be where it get stuck.) May need to research this call more in terms of isolated processes specifically.
Comment 9•1 year ago
|
||
I think this might be similar to bug 1706656, not the original description but in comment 8 I was seeing "ServiceManager: Waiting for service SurfaceFlinger...", which is like what you're seeing with audioflinger. Presumably isolated processes don't have permissions to launch the audioflinger service, which is required by the AudioManager.getProperty() call you highlighted.
Just a drive by comment as I don't know the ins and outs of this code - but perhaps we could query and cache these values in the parent process and send them to the content process as required.
Comment 10•1 year ago
|
||
We spent quite some time there with :phersons and :padenot and the conclusion was
Presumably isolated processes don't have permissions to launch the audioflinger service, which is required by the AudioManager.getProperty() call you highlighted.*
| Assignee | ||
Comment 11•1 year ago
•
|
||
:owlish, :calu, and myself pair programmed on this today.
Locally, it appears this build define of defined(MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS) in CubebUtils.cpp is not properly triggering.
:owlish had a patch locally that fixed MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS and appeared to fix these tests. I'll run a baseline try and a try with the fix to confirm it works on CI as well.
(Note: This change only impacts the junit to not gate the test. It does not fix the underlying Cubeb remoting that has a ToDo still yet listed.)
I'll also try to determine if this build define not working as expected is a regression by looking at the history.
| Assignee | ||
Comment 12•1 year ago
|
||
Patch fixes:
- Fixes missing define of MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS
Patch opens for general availability in isolated process runs:
- MediaDelegateTest#testDeviceRecordingEventVideo
- MediaDelegateXOriginTest#testDeviceRecordingEventAudioAndVideoInXOriginIframe
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
(In reply to Olivia Hall [:olivia] from comment #12)
Created attachment 9477854 [details]
Bug 1698214 - Getting media permissions fails with Isolated ProcessPatch fixes:
- Fixes missing define of MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS
Patch opens for general availability in isolated process runs:
- MediaDelegateTest#testDeviceRecordingEventVideo
- MediaDelegateXOriginTest#testDeviceRecordingEventAudioAndVideoInXOriginIframe
I'm giving a new try to bug 1771452 with that fix arriving
Comment 15•1 year ago
|
||
| bugherder | ||
Description
•