Last active
November 22, 2025 12:55
-
-
Save beli-sk/4a1885674e3139b0e76fb5c7a6a4cfa6 to your computer and use it in GitHub Desktop.
Virtual audio connection and camera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/modules-load.d/v4l2loopback-load.conf | |
| v4l2loopback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/modprobe.d/v4l2loopback-opt.conf | |
| options v4l2loopback card_label=VirtualCam exclusive_caps=1 devices=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.config/systemd/user/virtual-av.service | |
| [Unit] | |
| Description=Create pipewire virtual devices | |
| Requires=pipewire.service | |
| After=pipewire.service | |
| [Service] | |
| Type=oneshot | |
| ExecStart=%h/bin/virtual-av.sh | |
| RemainAfterExit=yes | |
| [Install] | |
| WantedBy=default.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ~/bin/virtual-av.sh | |
| CREATED=0 | |
| if ! pw-cli ls virtual-link1-in | grep Audio/Sink > /dev/null ; then | |
| echo "Creating virtual-link1-in Audio/Sink" | |
| pactl load-module module-null-sink media.class=Audio/Sink sink_name=virtual-link1-in channel_map=stereo | |
| CREATED=1 | |
| fi | |
| if ! pw-cli ls virtual-link1-out | grep Audio/Source/Virtual > /dev/null ; then | |
| echo "Creating virtual-link1-out Audio/Source/Virtual" | |
| pactl load-module module-null-sink media.class=Audio/Source/Virtual sink_name=virtual-link1-out channel_map=front-left,front-right | |
| CREATED=1 | |
| fi | |
| if [[ $CREATED -ne 0 ]] ; then | |
| sleep 1 | |
| echo "Creating links" | |
| pw-link virtual-link1-in:monitor_FL virtual-link1-out:input_FL | |
| pw-link virtual-link1-in:monitor_FR virtual-link1-out:input_FR | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment