Pipewire module-native-protocol-tcp problem

Hello Garuda users.

A have a network audio problem, let me explain.
I was using the "pactl load-module module-native-protocol-tcp port=33478" command on my speaker pc so it was used as an audio receiver.
Next i used the command "pactl load-module module-tunnel-source channels=6 source_name=frmcstr server=tcp:192.168.2.112:33478" on my pc whitout any speakers and it worked perfectly for the past 3 month or so (thats when i set my PS's up, so after installing garuda).
It was creating an audio tunnel to my other pc, but now it no longer works i always creates a tunnel with one input on my non speaker pc, but too outputs on my speaker pc.
So i went looking but there was almost nothing at least i had no idea on how to solve it.
I waned to try the "PipeWire Module: ROC source" but that is not included in pipewire, maby the "module-rtp-send" cold work but i cold not get it to work.
So hope someone has a fix for this or can tell me how to make the "module-rtp-send" and "module-rtp-recv" work together with the cli.

here the garuda-inxi output as usual

╰─λ garuda-inxi
System:
Kernel: 6.2.12-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=7c336077-248e-4bf2-8c6a-af5c3a83cfd4 rw rootflags=subvol=@
quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
resume=UUID=1b2a2c49-ae59-45a4-a5ab-e5faf0e5e217 loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.27.4 tk: Qt v: 5.15.9 wm: kwin_x11 vt: 1 dm: SDDM
Distro: Garuda Linux base: Arch Linux
Machine:
Type: Desktop Mobo: ASUSTeK model: ROG STRIX Z370-F GAMING v: Rev X.0x
serial: <superuser required> UEFI: American Megatrends v: 3004
date: 07/12/2021
CPU:
Info: model: Intel Core i7-8700K bits: 64 type: MT MCP arch: Coffee Lake
gen: core 8 level: v3 note: check built: 2018 process: Intel 14nm family: 6
model-id: 0x9E (158) stepping: 0xA (10) microcode: 0xF0
Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
L3: 12 MiB desc: 1x12 MiB
Speed (MHz): avg: 1041 high: 3700 min/max: 800/4700 scaling:
driver: intel_pstate governor: powersave cores: 1: 800 2: 801 3: 800 4: 800
5: 800 6: 800 7: 3700 8: 800 9: 800 10: 800 11: 800 12: 800
bogomips: 88796
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: NVIDIA GA104 [GeForce RTX 3070 Ti] vendor: eVga.com.
driver: nvidia v: 530.41.03 alternate: nouveau,nvidia_drm non-free: 530.xx+
status: current (as of 2023-03) arch: Ampere code: GAxxx
process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 3 speed: 8 GT/s lanes: 16
link-max: gen: 4 speed: 16 GT/s bus-ID: 01:00.0 chip-ID: 10de:2482
class-ID: 0300
Device-2: Logitech HD Pro Webcam C920 type: USB
driver: snd-usb-audio,uvcvideo bus-ID: 1-14:5 chip-ID: 046d:082d
class-ID: 0102 serial: <filter>
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.1
compositor: kwin_x11 driver: X: loaded: nvidia unloaded: modesetting
alternate: fbdev,nouveau,nv,vesa gpu: nvidia display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 3840x2160 s-dpi: 159 s-size: 613x352mm (24.13x13.86")
s-diag: 707mm (27.83")
Monitor-1: HDMI-0 res: 3840x2160 dpi: 160 size: 610x350mm (24.02x13.78")
diag: 703mm (27.69") modes: N/A
API: OpenGL v: 4.6.0 NVIDIA 530.41.03 renderer: NVIDIA GeForce RTX 3070
Ti/PCIe/SSE2 direct-render: Yes
Audio:
Device-1: Intel 200 Series PCH HD Audio vendor: ASUSTeK
driver: snd_hda_intel bus-ID: 1-14:5 v: kernel alternate: snd_soc_avs
chip-ID: 046d:082d bus-ID: 00:1f.3 class-ID: 0102 chip-ID: 8086:a2f0
serial: <filter> class-ID: 0403
Device-2: NVIDIA GA104 High Definition Audio vendor: eVga.com.
driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
link-max: gen: 4 speed: 16 GT/s bus-ID: 01:00.1 chip-ID: 10de:228b
class-ID: 0403
Device-3: Logitech HD Pro Webcam C920 type: USB
driver: snd-usb-audio,uvcvideo
API: ALSA v: k6.2.12-zen1-1-zen status: kernel-api tools: N/A
Server-1: PipeWire v: 0.3.70 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: kernel
port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15b8 class-ID: 0200
IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-2: Intel driver: N/A pcie: gen: 2 speed: 5 GT/s lanes: 1 port: N/A
bus-ID: 03:00.0 chip-ID: 8086:093c class-ID: 0280
IF-ID-1: nordlynx state: unknown speed: N/A duplex: N/A mac: N/A
Bluetooth:
Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: USB
driver: btusb v: 0.8 bus-ID: 1-11:3 chip-ID: 0a12:0001 class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:
Local Storage: total: 5.01 TiB used: 2.99 TiB (59.7%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 970 PRO 512GB
size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
lanes: 4 type: SSD serial: <filter> rev: 1B2QEXP7 temp: 41.9 C scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: Hitachi model: HUA723020ALA641
size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
type: HDD rpm: 7200 serial: <filter> rev: A840 scheme: MBR
ID-3: /dev/sdb maj-min: 8:16 vendor: Western Digital
model: WD30EZRZ-00GXCB0 size: 2.73 TiB block-size: physical: 4096 B
logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
rev: 0A80 scheme: GPT
Partition:
ID-1: / raw-size: 234.5 GiB size: 234.5 GiB (100.00%)
used: 44.44 GiB (18.9%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
used: 576 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p5 maj-min: 259:5
ID-3: /home raw-size: 234.5 GiB size: 234.5 GiB (100.00%)
used: 44.44 GiB (18.9%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
ID-4: /var/log raw-size: 234.5 GiB size: 234.5 GiB (100.00%)
used: 44.44 GiB (18.9%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
ID-5: /var/tmp raw-size: 234.5 GiB size: 234.5 GiB (100.00%)
used: 44.44 GiB (18.9%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: partition size: 3.91 GiB used: 0 KiB (0.0%)
priority: -2 dev: /dev/nvme0n1p7 maj-min: 259:7
ID-2: swap-2 type: zram size: 31.28 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 40.0 C mobo: N/A gpu: nvidia temp: 49 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
Processes: 330 Uptime: 21m wakeups: 0 Memory: 31.28 GiB
used: 3.65 GiB (11.7%) Init: systemd v: 253 default: graphical
tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: 1728
pm: pacman pkgs: 1705 libs: 446 tools: gnome-software,octopi,pamac,paru
pm: flatpak pkgs: 23 Shell: fish v: 3.6.1 default: Bash v: 5.1.16
running-in: konsole inxi: 3.3.26
Garuda (2.6.16-1):
System install date:     2023-02-18
Last full system update: 2023-04-25
Is partially upgraded:   No
Relevant software:       snapper NetworkManager mkinitcpio nvidia-dkms
Windows dual boot:       Probably (Run as root to verify)
Failed units:

So update i have changed literally all my network audio to rtp-send / rtp-recv it was a pain to get working and i had to google a lot but i made it mostly work.
How did I do it, well first used the

pactl load-module module-rtp-recv sink=reciveon latency_msec=50 sap_address=0.0.0.0

command to load the rtp receiver. Keep in mind that a sink with the name reciveon has to exist, the point of this is to first get rid of all audio send and than just handle the audio with with a script similar to qpwgraph. Than i have to check if my other PC is active for that i use

aw=1
while [[ $aw == 1 ]] #Wait for other pc to become active
do
    ping -W 1 -c 1 192.168.2.112 > /dev/null
    aw=$?
    sleep 5
done

After that I have to check if my audio connection is already there, for that i use

if [ $(pw-cli ls | awk '/node.name = "rtp_session.margamgar"/' | wc -l) == 0 ]
then
    pactl load-module module-rtp-send source=media.monitor destination_ip=192.168.2.112
    sleep 1
fi
if [ $(pw-cli ls | awk '/node.name = "rtp_session.margamgar"/' | wc -l) == 1 ]
then
    pactl load-module module-rtp-send source=them.monitor destination_ip=192.168.2.112
    sleep 1
fi

where margamgar ist the hostname of the other pc. For some reason it sometimes is not loading the receiver correctly at startup so i had to use

pactl unload-module module-rtp-recv
pactl load-module module-rtp-recv sink=reciveon latency_msec=50 sap_address=0.0.0.0

To reload the reciver. Finaly I use

./pipewire-script.sh load 2>/dev/null

this is my script for saving and loading pipewire connections, if you curious you can look at it and / or download it here: marvin1099/Pipewire-save-load: Unclean script to save and load your pipewire wires also name to id function is included since its nice to have. - Pipewire-save-load - Codeberg.org
The reason why a extra script and not qpwgraph is that it will conect all recivers to the same nodes since the have the same name, the script will just do the first result. There was something I had added to the script that was supposed to support occurrence but it is not working yet.

Also the rtp module cannot do more than 2 channels it seams so i have to create multiple senders. If you have a solution better than this its still wellcome.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.