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 #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 authored and totaam committed Sep 11, 2023
1 parent d0d1fc2 commit c53a983
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 @@ -39,7 +39,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 @@ -869,6 +869,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 c53a983

Please sign in to comment.