Closed Bug 1654955 Opened 4 years ago Closed 1 years ago

[Sway] Sharing microphone with GDK_BACKEND=wayland exits with channel error

Categories

(Core :: Widget: Gtk, defect, P3)

80 Branch
Desktop
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: imyxhuang, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: wayland)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

Steps to reproduce:

Using Nightly 80.0a1 (2020-07-21) (64-bit) on Wayland (Swaywm) on Arch Linux with pulseaudio:
0. ensure that GDK_BACKEND=wayland is set (is NOT reproducible with GDK_BACKEND=x11, even on wayland);

  1. visit any site that asks to use the microphone (e.g. hangouts.google.com, or mozilla.github.com/webrtc-landing/gum_test.html);
  2. click "allow" when prompted;
  3. observe that Firefox exits.

Actual results:

Surprisingly, Firefox does not attempt to ask me to submit a crash report, nor does the crash show in about:crashes. The only information I've been able to glean through GDB (though I don't have debug symbols) is the same information that I get from running Firefox from a terminal:

$ ./firefox-nightly/firefox/firefox -P secondary
Gdk-Message: 17:56:48.925: Error 71 (Protocol error) dispatching to Wayland display.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.

Expected results:

I would expect the microphone to work on Wayland. In fact, I'm pretty sure this is a regression as I didn't notice it before and it's prevalent on a brand new profile. I can try to bisect this soon.

I'm very glad there is still a workaround, which is just setting GDK_BACKEND=x11 before running Firefox. However, this causes the UI to look weird and so far GDK_BACKEND=wayland has been otherwise seamless.

Please let me know how else I can help debug this. Thanks for all your hard work!

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Please run with WAYLAND_DEBUG=1 and attach the log here. Also note that correct Wayland env variable is MOZ_ENABLE_WAYLAND=1, not GDK_BACKEND=wayland.

Blocks: wayland-sway
Flags: needinfo?(imyxhuang)
Priority: -- → P3
Flags: needinfo?(imyxhuang)

(In reply to Martin Stránský [:stransky] from comment #2)

Please run with WAYLAND_DEBUG=1 and attach the log here. Also note that correct Wayland env variable is MOZ_ENABLE_WAYLAND=1, not GDK_BACKEND=wayland.

Thanks for the response! Log attached. If I were to take a guess, it seems that the error is actually in trying to create the sharing indicator, rather than anything to do with the actual audio input?

And I should note that regardless of if I set MOZ_ENABLE_WAYLAND to 0 or 1, what determines whether or not this bug happens is still GDK_BACKEND=wayland. Is that supposed to be set to x11 for Firefox?

[3806506.952] wl_display@1.error(xdg_surface@71, 4294967295, "Tried to set invalid xdg-surface geometry")
Gdk-Message: 14:45:06.643: Error 71 (Protocol error) dispatching to Wayland display.

Can you try nested mutter compositor please? Run on terminal:
$mutter --wayland --nested &
$WAYLAND_DISPLAY=wayland-1 MOZ_ENABLE_WAYLAND=1 ./firefox

Flags: needinfo?(imyxhuang)

I can't get the mutter nested compositor to work properly in Sway as it throws:

Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session:
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist

which causes Firefox to open in Sway even if I set WAYLAND_DISPLAY=1.

However, I managed to test this in GNOME both with and without nested mutter—I cannot find a way to reproduce there. It seems that this is only reproducible on Sway with GDK_BACKEND=wayland. Hope that helps.

Flags: needinfo?(imyxhuang)

Marking this S2 because Wayland is/will become the default, and this would seem to kill WebRTC functionality, though I'm not sure how reproducible it is.

Severity: -- → S2
Keywords: wayland
Summary: sharing microphone with GDK_BACKEND=wayland exits with channel error → [Sway] Sharing microphone with GDK_BACKEND=wayland exits with channel error

(In reply to imyxhuang from comment #0)
Does this problem still occur?

(In reply to Martin Stránský [:stransky] (ni? me) from comment #5)

[3806506.952] wl_display@1.error(xdg_surface@71, 4294967295, "Tried to set invalid xdg-surface geometry")

https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/4d634276a47e524165bc8a7f62a56d88bf404a75/types/xdg_shell/wlr_xdg_surface.c#L218

if (width <= 0 || height <= 0) {
wl_resource_post_error(resource, XDG_SURFACE_ERROR_INVALID_SIZE, "Tried to set invalid xdg-surface geometry");

bug 1608705 comment 14 also had this message.

Flags: needinfo?(imyxhuang)

(In reply to Darkspirit from comment #8)

(In reply to imyxhuang from comment #0)
Does this problem still occur?

Just tested on Firefox 113.0.1 and sway 1.8.1 and I can no longer reproduce it!

Flags: needinfo?(imyxhuang)

Thanks for testing!

Status: UNCONFIRMED → RESOLVED
Closed: 1 years ago
OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: