Skip to content

Feat: add PipeWire-ALSA audio backend, drop PulseAudio dependency - #129

Open
Urbaner3 wants to merge 1 commit into
agarciadom:masterfrom
Urbaner3:master
Open

Urbaner3 wants to merge 1 commit into
agarciadom:masterfrom
Urbaner3:master

Conversation

@Urbaner3

Copy link
Copy Markdown

Replaces PulseAudio calls (pactl) with PipeWire native tools (pw-cli, pw-dump).
This is a model code generated by duck.ai, gpt 4o-mini, but it aims at my same goal of switching to Pipewire.
Audio pipeline: souphttpsrc → alsasink device=ipwebcam; the PipeWire-alsa plug-in routes the stream into a null-sink named “ipwebcam” whose monitor port appears as a normal microphone in any PipeWire-aware application (pavucontrol-qt, Helvum, OBS, Zoom, etc.).
Video path, v4l2loopback, ADB/Wi-Fi, crop/flip, FPS, … are unchanged.
Removes the old “only video on PipeWire” guard so audio+video works on modern Ubuntu/Kubuntu out-of-the-box.
Tested on:
Ubuntu 25.04 (PipeWire 1.0.5, wireplumber 0.5) – video OK, audio visible as “IP Webcam” source.
Known gaps (future PRs):
Echo-cancel module not loaded (most apps do AEC internally).
pw-node command removed – used pw-dump | jq instead; requires jq.

Instead of PulseAudio, this patch suits PipeWire-ALSA.

This patch keeps everything else (video, v4l2loopback, adb/wifi, crop/flip, …) untouched.
The key idea: PipeWire’s pipewire-alsa plug-in exposes the same ALSA device names that PulseAudio used to, so we can do four things:
First, Skip every pactl call (no Pulse sinks, no echo-cancel module, no default-source switching). (line 147)
Second, Replace pulsesink device=ipwebcam with alsasink device=ipwebcam. (line 604)
Third, Create the only object we still need: a PipeWire null-sink called “ipwebcam” so that the phone’s audio appears as a normal microphone you can select in any PipeWire-aware application (or in pavucontrol-qt / helvum). (line 550)
Foutth, Do the whole thing with pw-cli / pw-link instead of pactl.(line 638,

Notice, `pw-node: command not found`, maybe it's deprecated at my version of kubuntu. I can't reach the package on my computer.
The script, `run-videochat-origin.sh`, is generated by your script,`install-videochat.sh`, whose execution. And you may compare it under the same environment.

Here is my enviroment brief description.
Static hostname: urbaner-laptop
       Icon name: computer-laptop
         Chassis: laptop 💻
      Machine ID: a9e10aa601454188abdcbd97580c5e2f
         Boot ID: 989b9d5983a84cdf8291c86581b9ba7d
Operating System: Ubuntu 25.04
          Kernel: Linux 6.14.0-37-generic
    Architecture: x86-64
 Hardware Vendor: Framework
  Hardware Model: Laptop _13th Gen Intel Core_
Firmware Version: 03.04
   Firmware Date: Wed 2023-05-24
    Firmware Age: 2y 6month 3w 3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant