Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3200

Beginners Questions • [Solved] Pipewire, ALSA, RTPMidi on Debian 12

$
0
0
Hello,

Wall of text incoming, but as I have tried sorting this on my own for over a week or two, I am waving the white flag and asking for some help!

New user to Linux and Debian, and I have been using this as an opportunity to get used to living more in the command line to host my homelab containers and, due to its location, consolidate a bunch of midi and usb devices for use in and around my studio/home.

I have a fairly minimal installation of Debian 12, as I wanted to practice grabbing correct dependencies etc. This computer does not have any GUI services installed, and Pulse isnt even in the binaries—just a single config that isnt being used within /etc/pulse. No service running.

For now, I have been using ALSA and RTPmidid to send all my midi and usb devices out to a windows/mac accessible RTP/Bonjour service session. Debian hosts this while everything else connects to it, since it is running on a low energy/quiet SBC and the location is convenient.

All of that works like a charm, except for two things:

1) RTPMidid, while its broadcast session name is configurable, forwards the name of the midi device(s) connected to it as the RTPmidi session name and not the one listed in its config file.

2) Everything works until something connects or disconnects. This is even if the newly connected devices are at a higher device ID, so it isnt like the connections are being shifted and thusly no longer routed correctly. For some reason, ALSA just pauses and requires the connections to be remade/restarted. I have done this via a shell script, but it is tedious as Gear and devices are always being added and removed—hence the whole purpose of having everything RTP based.

#1 isnt really a problem. It's really #2 that led me to Pipewire/Wireplumber, as a friend said this would solve my problems, and thusly to my questions:

1) Installation/Config: Not sure if everything is set up correctly.
2) Config Files
3) Pipewire's ability to set up Boujour discoverable RTP sessions: according to its documentation and Arch's wiki, it states it can host Bonjour accessible RTP sessions.
4) Having Wireplumber automatically reconnect everything. (A lot of the documentation on this still uses the older lua configs and not the updated config type).

1) Installation

Following the directions on the Debian Wiki: https://wiki.debian.org/PipeWire#ALSA-1, I was able to get pipewire (0.3.65), its additional modules, and wireplumber installed; however, because I have not even been using pulse, I ran into some oddities during the install process.

Wiki masks pulse audio, which I have not figured to be an issue as I have not been using pulse thus far. Not a big deal.
Wiki states that the following code should return "Default ALSA Output (currently PipeWire Media Server)".

Code:

LANG=C aplay -L | grep -A 1 default
Instead, it just says shows plus the SBC's TRS jack and HDMI out

Code:

sysdefault    Default Audio Device 
Next, it appears that Pipewire has changed how it delivers its default settings (it no longer places files under etc/pipewire, now usr/share/pipewire), and some functionality that used to be wrapped in pipewire-alsa.configs is now just placed into the client.conf/client-rt.conf. I believe I have confirmed this as the only files that have been moved into the system's etc directory are under /etc/alsa/conf.d {50-pipewire.conf 99-pipewire-default.conf} The contents appear to match the apparently depricated Pipewire-alsa setup?

With the above sorted, running systemctl status on pipewire shows that it is running, and there are two new pipewire debvices listed through <aconnect -l> Client 143: 'PipeWire-System' and client 144: 'PipeWire-RT-Event'

Checking pipewire's status returns that everything is active and enabled; however, I do have a few warnings that I suspect are from my lack of a GUI/desktop enviornment.

Code:

systemd[2982]: Started pipewire.service - PipeWire Multimedia Service.pipewire[3055]: mod.rt: Can't find org.freedesktop.portal.Desktop. Is xdg-desktop-portal running?pipewire[3055]: mod.rt: found session bus but no portalpipewire[3055]: mod.rt: RTKit error: org.freedesktop.DBus.Error.AccessDeniedpipewire[3055]: mod.rt: could not set nice-level to -11: Permission deniedpipewire[3055]: mod.rt: RTKit error: org.freedesktop.DBus.Error.AccessDeniedpipewire[3055]: mod.rt: could not make thread 3061 realtime using RTKit: Permission denied
I installed xdg-desktop-portal and ran it. Warning/errors persist.


2) Config Files

Next, I tried copying the example configs from the /usr/share/pipewire directory to ~/.config/pipewire (also tried ~/.config/pipewire.conf.d/) Any time these directories exist, or copies of the shipped .conf files are placed in these locations: pipewire will stop and will not restart until said files and directory are removed. I found that ~/.config/pipewire works; however, the issue persists if I copy any of the usr/share files over to it.

Where are the correct places to be placing these drop-in config files?

My understanding is that we do not necessarily need to keep all config files within a monolithic pipewire.conf, and that we should be able to create decoupled .conf files to be later merged into the main pipewire.conf. I tried setting up an RTP source, sink, and session as per Pipewire's wiki, but nothing would show up when checking with pw-cli, aconnect -l, nor wpctl status.

https://docs.pipewire.org/page_module_rtp_sink.html
https://docs.pipewire.org/page_module_rtp_source.html
https://docs.pipewire.org/page_module_rtp_session.html

Session Media values were uncommented and set to "midi" just to be safe.

Any light shed on Pipewire's config file structure would be greatly appreciated. Most of the older reddit threads, youtube videos, and arch comments either are out of date, or they all use a GUI service to do this.

While I tried creating a copy of the pipewire.conf and standalone .confs for the above rtp modules—probably shouldnt have started with those—will I need to create .conf files for each of my midi devices, and any RTP sessions hosted on the system as well?

I noticed that even copying in the additional context modules, into the appropriate context.modules[] within pipewire.conf,the service would stop as well.

3) Pipewire's ability to set up Boujour discoverable RTP sessions

As I have it set up with RTPmidid, the RTP session currently uses whatever DHCP address has been assigned, and automatically generates a random, free port within its range. Ideally, I'd like Pipewire's RTP session to function similarly, if possible.

Is pipewire capable of broadcasting this, or do I still need to be using the combination of ALSA with RTPMidid to create the discoverable rtpmidid session(s)?

If it can, what is the correct way to do this?

4) Having Wireplumber automatically reconnect everything.

Wireplumber (0.4.13) seems to be working except, it also has similar warnings/errors to wireplumber. I suspect, yet again, because I'm not running anything GUI related. Even with installing and running flagged services, errors still persist.

Code:

systemd[2982]: Started wireplumber.service - Multimedia Service Session Manager.wireplumber[3058]: Can't find org.freedesktop.portal.Desktop. Is xdg-desktop-portal running?wireplumber[3058]: found session bus but no portalwireplumber[3058]: RTKit error: org.freedesktop.DBus.Error.AccessDeniedwireplumber[3058]: could not set nice-level to -11: Permission deniedwireplumber[3058]: RTKit error: org.freedesktop.DBus.Error.AccessDeniedwireplumber[3058]: could not make thread 3062 realtime using RTKit: Permission deniedwireplumber[3058]: SPA handle 'api.libcamera.enum.manager' could not be loaded; is it installed?wireplumber[3058]: PipeWire's libcamera SPA missing or broken. libcamera not supported.wireplumber[3058]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner
Once the Pipewire .config is sorted out, does anyone have examples of wireplumber configs using the new setup? It seems like the lua method is no longer supported, even it still has /user/share/wireplumber/main.luda.d

Since this got swapped over to the config syntax, does anyone have any examples on how I route my alsa/rtp sessions? As with Pipewire, I tried creating and using ~/.config/wireplumber/ but since the only audio devices, sinks, and sources listed are the built-in audio, I have not gotten to a point to even address this part of the setup.

Thank you in advance for any help. I'm sure there are probably glaringly obvious things I am overlooking.

Statistics: Posted by Confuzzled2 — 2024-10-19 23:34 — Replies 5 — Views 139



Viewing all articles
Browse latest Browse all 3200

Trending Articles