Skip to content

Commit

Permalink
Create Xpra-Mic-Source pulseaudio remapped source for Chromium
Browse files Browse the repository at this point in the history
Applications like Chrome and Chromium do not accept to record from a
monitor device, like "Monitor of Xpra Microphone" device, as reported
at Xpra-org#1221
or werman/noise-suppression-for-voice#29
and so they report that no microphone is connected.

A remapped device resolves this issue by creating a normal (non-monitor)
source device.

The name of the remapped device is **Xpra-Mic-Source** and not
**Xpra-Microphone-Source** because the `get_pulse_device` function from
the `xpra/audio/gstreamer_util.py` file expects to find exactly one
sink device match when looking after the **Xpra-Microphone** name.
  • Loading branch information
Behnam Momeni committed Sep 11, 2023
1 parent 3aebb0c commit 5ff47fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xpra/platform/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
DEFAULT_SSH_COMMAND : str = "ssh -x"
DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS : tuple[tuple[str, str, str], ...] = (
("pactl", "set-default-sink", "Xpra-Speaker"),
("pactl", "set-default-source", "Xpra-Microphone.monitor"),
("pactl", "set-default-source", "Xpra-Mic-Source"),
)

SOCKET_OPTIONS : tuple[str, ...] = (
Expand Down
1 change: 1 addition & 0 deletions xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ def get_default_pulseaudio_command() -> list[str]:
"--exit-idle-time=-1", "--load=module-suspend-on-idle",
"'--load=module-null-sink sink_name=\"Xpra-Speaker\" sink_properties=device.description=\"Xpra\\ Speaker\"'",
"'--load=module-null-sink sink_name=\"Xpra-Microphone\" sink_properties=device.description=\"Xpra\\ Microphone\"'",
"'--load=module-remap-source source_name=\"Xpra-Mic-Source\" source_properties=device.description=\"Xpra\\ Mic\\ Source\" master=\"Xpra-Microphone.monitor\" channels=1'",
"'--load=module-native-protocol-unix socket=$XPRA_PULSE_SERVER'",
"--load=module-dbus-protocol",
"--load=module-x11-publish",
Expand Down

0 comments on commit 5ff47fc

Please sign in to comment.