Closed
Bug 1332887
Opened 8 years ago
Closed 8 years ago
Webrtc microphone not found with Dell XPS 13 Linux 9350
Categories
(Core :: Audio/Video: cubeb, defect, P2)
Tracking
()
RESOLVED
DUPLICATE
of bug 1337328
People
(Reporter: sbird4, Assigned: achronop)
References
Details
Attachments
(5 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161209093710
Steps to reproduce:
Visit https://test.webrtc.org/ on a Dell XPS 13 9350 running Ubuntu 16.10 (using gnome 3.22).
Actual results:
Prompt appears to share camera, and camera tests pass, but no microphone is found and the microphone test fails.
Expected results:
Prompt appears to share microphone, and microphone test passes.
I have checked that the same thing happens for firefox 52, the current developer edition, and that it happens with both wayland and x11. I also tried a clean firefox profile. Multiprocess windows are enabled, but disabling does not change behaviour.
The test passes correctly in chrome and pulseaudio correctly uses the microphone. Any help debugging would be appreciated - I am willing to use gdb or strace.
Component: Untriaged → WebRTC: Audio/Video
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86_64
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(achronop)
Assignee | ||
Comment 1•8 years ago
|
||
It would be useful to capture some traces/logs with the latest Nightly version of firefox. In order to do that download Nightly. export the following env var before run it, and run it.
export MOZ_LOG=cubeb:4
./path/to/nightly/firefox
Logs will appear on screen (stdout), please copy and paste them to a file and attach them here.
Flags: needinfo?(achronop)
Log attached - the card printed is I think the correct output device.
Assignee | ||
Comment 3•8 years ago
|
||
I see that your microphone is reported correctly by the audio backend. Can you please capture more logs for me? Using the Nightly activate the env as follow:
export MOZ_LOG=timestamp,cubeb:4,GetUserMedia:4
Moreover I would like take logs from the following test page:
https://mozilla.github.io/webrtc-landing/gum_test.html
using the Audio option.
The output printed on the audio section of
https://mozilla.github.io/webrtc-landing/gum_test.html
is:
"getUserMedia Test Page
Main webrtc demo page
NotFoundError: The object can not be found here."
and the attached log is printed to console.
Looks like the default input device is returning -1 for some reason?
Assignee | ||
Comment 5•8 years ago
|
||
Your input devices are reported as disabled: state 0x0.
In a working scenario it is reported as enabled: state 0x2
Firefox get the state information from pa_context_get_source_info_list() PulseAudio api call checking the field pa_source_info::active_port::available.
Can you please verify if your device is not enabled and why?
As far as I know it is enabled - I tried toggling mute
in pulseaudio's settings and that didn't make a difference.
And as I said, it works in chrome.
http://0pointer.de/lennart/projects/pulseaudio/doxygen/introspect_8h_source.html
suggests that pa_source_info::active_port (type pa_source_port_info) has name,
priority and description fields, but no available field. Do you really mean pa_source_info::active_port::available?
Assignee | ||
Comment 7•8 years ago
|
||
https://freedesktop.org/software/pulseaudio/doxygen/structpa__source__port__info.html
available member added after version 2.0
This is https://github.com/kinetiknz/cubeb/issues/149
I confirm that setting media.navigator.audio.full_duplex = false in about:config fixes the problem.
Looking at media/libcubeb/src/cubeb_pulse.c, I think it is not correct that firefox is checking pa_source_info::active_port::available - if pa_source_info::active_port::available == PA_PORT_AVAILABLE_NO it returns CUBEB_DEVICE_STATE_UNPLUGGED, which is 0x1. Instead it is returning 0x0, which is CUBEB_DEVICE_STATE_DISABLED, implying that pa_source_info::active_port is NULL.
I think checking for active_port == NULL is the wrong thing to do, as it just means that the device is inactive, ie, asleep, no?
Would a better check be pa_source_info::n_ports > 0, and then using pa_source_info::ports[0]?
Chrome ( see chromium/media/audio/pulse/audio_manager_pulse.cc:315) just calls pa_context_get_source_info_list and adds all found devices to the audio manager's backend,
which seems the most reliable option.
Assignee | ||
Comment 10•8 years ago
|
||
Yeah, maybe is wrong to check the active_port for availability. I will try to work with PulseAudio developers to see if your suggestion or something else is better. In the mean time I will make a quick build to return enable when there is no active port. Can you do a few test for me with that build to verify that it works well?
Assignee | ||
Updated•8 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 11•8 years ago
|
||
My first suggestion won't work, actually. For this laptop, n_ports is always zero.
I can check this with pacmd list-sinks.
I'm happy to test a build for you.
Assignee | ||
Comment 12•8 years ago
|
||
When the build is ready I will copy the link for the binaries here:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2a0ef5e3773762566fd83212c42627fcd6c2be3b
Updated•8 years ago
|
Assignee: nobody → achronop
Status: NEW → ASSIGNED
Rank: 25
Component: WebRTC: Audio/Video → Audio/Video: cubeb
Priority: -- → P2
Assignee | ||
Comment 13•8 years ago
|
||
Here is the link of the build:
https://queue.taskcluster.net/v1/task/RGdHLwTMSEqj9eldPBdkmQ/runs/0/artifacts/public/build/target.tar.bz2
Reporter | ||
Comment 14•8 years ago
|
||
Hm. That build produces the exact same result.
Guess I was wrong about the cause of the bug.
Assignee | ||
Comment 15•8 years ago
|
||
Did you capture new logs?
Reporter | ||
Comment 16•8 years ago
|
||
I did, but they were exactly the same as the last ones
Reporter | ||
Comment 17•8 years ago
|
||
I noticed that a standalone checkout of the cubeb git has the following test output:
% ./test_record
Running main() from gtest_main.cc
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from cubeb
[ RUN ] cubeb.record
there are input devices, but they are not available, skipping
[ OK ] cubeb.record (4 ms)
[----------] 1 test from cubeb (4 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (4 ms total)
[ PASSED ] 1 test.
but with a similar patch to the one discussed above I get the (better):
% ./test_record
Running main() from gtest_main.cc
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from cubeb
[ RUN ] cubeb.record
stream started
stream stopped
[ OK ] cubeb.record (534 ms)
[----------] 1 test from cubeb (534 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (534 ms total)
[ PASSED ] 1 test.
Are you sure the build included the correct patch?
Reporter | ||
Comment 18•8 years ago
|
||
This patch fixes the cubeb test cases for me.
Reporter | ||
Comment 19•8 years ago
|
||
(In reply to sbird4 from comment #18)
> Created attachment 8832690 [details] [diff] [review]
> Proposed patch to cubeb git for pulse audio ports.
>
> This patch fixes the cubeb test cases for me.
I can submit it as a github pull request if you prefer
Assignee | ||
Comment 20•8 years ago
|
||
Wait a minute, this is what I did in the custom build created for you BUT I did it just for sink. I should have done it for source as well. I am pushing a new build to test. I'll post the link here when it is ready.
Assignee | ||
Comment 21•8 years ago
|
||
Reporter | ||
Comment 22•8 years ago
|
||
That one works!
Assignee | ||
Comment 23•8 years ago
|
||
Do you get the prompt which ask for permissions and all your device (if you have more than one) are reported correctly?
Reporter | ||
Comment 24•8 years ago
|
||
I do - I also checked that the audio tests on gum and test.webrtc.org work.
Reporter | ||
Comment 25•8 years ago
|
||
The only thing that is not perfect is that firefox picks the 'microphone monitor' device as the default one, rather than the real microphone. But I have no idea how to avoid that - I can't see anything in the pulse output that distinguishes that, except that the alsa properties contain 'device.class=monitor' and I don't know if that is universal.
Assignee | ||
Comment 26•8 years ago
|
||
Cool, I will land it soon, thanks for your co-operation.
BTW, since you helped a lot, if you want to put your name on it, create a PR against me in cubeb repo. This is the final version of the patch:
https://hg.mozilla.org/try/rev/5af04325788caf8c3bfbbcb17651850174469ee0
(note the patch above is from Firefox repo not cubeb where the PR will be created)
Assignee | ||
Comment 27•8 years ago
|
||
This is the default device set in your sound settings. If you execute the test: test_devices you will get the full list of the audio devices for your system. The devices which have state enabled will be added in the list. The one that is reported as PREFERRED is the default. By changing your laptop audio settings you can change the default device.
Assignee | ||
Comment 28•8 years ago
|
||
PR in cubeb repo.
Reporter | ||
Comment 29•8 years ago
|
||
Thanks, I'm happy for you to commit it.
test_devices shows the correct device as PREFERRED - I don't know why firefox chooses the wrong one.
Assignee | ||
Comment 30•8 years ago
|
||
Sorry you cannot commit it now, I have started pushing it, I found some automated tests error that need to be fixed along with that patch. I will be happy to help you an other commit if you want to get involved.
About the new issue, can you post new logs to check it out?
Reporter | ||
Comment 31•8 years ago
|
||
Here are the new logs - notice that cubeb correctly labels the PREFERRED device as the one which isn't the monitor, but then picks -1 as the default later.
Assignee | ||
Comment 33•8 years ago
|
||
I pushed a new commit in cubeb repo about the preferred device error.
Assignee | ||
Updated•8 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•