KLV Multimedia Pipewire

Moderator: Forum moderators

Post Reply
geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

KLV Multimedia Pipewire

Post by geo_c »

I'm starting this topic to share files and configs for multi-media KL's using pipewire.

I'll start by attaching .desktop files to start jack applications with pw-jack. Thanks to @MochiMoppel for giving me the sed command to edit the files in one shot.

This .gz file contains .desktop files for all stable and dependable jack applications, which I personally tested, that are found in the void repository.

The folder contains three subfolders:
/lsp-plugins (stock desktop files without the pw-jack command in the Exec: line)
/lsp-pwj-plugins (edited desktop files with pw-jack inserted in the Exec: line)
/pw-jack (all other jack apps edited with pw-jack inserted in the Exec: line)

jack_desktop.tar.gz
(33.66 KiB) Downloaded 17 times

There's not really a reason to use the first folder in a pipewire-jack setup, and jack only applications aren't very useful without a pw-jack command. There are a few applications in the third folder that can run without pw-jack, like Ardour, Calf, and Drumstick, but running with pw-jack should be more or less preferred in most cases, and those applications can choose their drivers from within the running instance.

my Void audio application package list looks likes this:

Code: Select all

xbps-install helvum qpwgraph mediainfo drumstick hydrogen jack_mixer muse lsp-plugins yoshimi amsynth padthv1 samplv1 synthv1 drumkv1 guitarix2 helm swh-lv2 libjack-pipewire alsa-plugins alsa-plugins-ffmpeg gstreamer1-pipewire Carla calf ardour

so @rockedge if you install these applications and copy the attached .desktop files into /usr/share/applications, these will all run standalone from the start menu and show up in the qpwgraph or helvum or carla graph. Only tested in Airedale so far, but should work in Spectr and Hyprland

geo_c
Old School Hipster, and Such

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: KLV Multimedia Pipewire

Post by geo_c »

@rockedge I'm combing through my all-pipewire setup and noticing that I don't have libspa-jack installed. The following page in ubuntu lists it as a pipewire package. Do you think I need to add it? https://launchpad.net/ubuntu/+source/pipewire It looks like it might benecessary for jack clients, though all my jack apps are working.

It would think pw-jack should have pulled it in if was necessry, but I have no way of knowing.

geo_c
Old School Hipster, and Such

User avatar
rockedge
Site Admin
Posts: 5711
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1990 times
Been thanked: 2097 times
Contact:

Re: KLV Multimedia Pipewire

Post by rockedge »

@geo_c I have looked at this package, and at the time we were focused on audio I did not install it. But did want to go back once the audio was okay and begin to address multimedia streams which include camera streams in real time, and install it.

Let's install it on a test platform version and see how big of a role the library plays. :ugeek:

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: KLV Multimedia Pipewire

Post by geo_c »

rockedge wrote: Sun Jan 28, 2024 12:34 am

@geo_c I have looked at this package, and at the time we were focused on audio I did not install it. But did want to go back once the audio was okay and begin to address multimedia streams which include camera streams in real time, and install it.

Let's install it on a test platform version and see how big of a role the library plays. :ugeek:

As it stands now, I have that library installed, and my camera outputs show up in pipewire, and in the graphs and Carla's graph, but I don't usually get any software inputs showing up, probably because of the software itself. So for instance in OBS I can add camera inputs just fine from within its gui, but don't have routing to OBS through graphs ability. But all seems to be working smoothly.

The audio capabilities with pipewire are far deeper than simply using pulse, or simply using jack. Though the interaction of pulse apps is a bit annoying in that whenever streams are started, they are automatically routed to the default hardware out. However I did some pretty nice manipulation using three things: a startup script for jack_mixer, carla, and parole. What I did is have the script open jack_mixer with a preset mixer config file, open carla with a preset connections config, and open parole with a chosen song file. This gives me a setup that looks like this with the click of one script, and notice parole connects automatically to the hardware output:

Image

But what's very important to do before trying to use any pulse apps in this kind of setup is first use pavucontrol and configure the default hardware. Since I have two audio cards, I disable my built-in audio, and set the fallback to the desired card:
Image
Image
Image

Then in order to use the jack_mixer to mix parole with other sources, I have to disconnect parole from the hardware output and connect it to the mixer input:

Image

And that's fine, except for the fact that parole has to be playing when this re-connection is made. As soon as it is stopped or restarts the track on loop repeat, an automatic connection is made to the hardware output again.

This doesn't happen when using musikcube, which has an internal config to use pipewire. Musikcube can't be opened with a loaded file though. It's a music library player.

Also a common issue with the pulse configuration is that it is not persistent on reboot. So as I look into it, I believe some of these things can be addressed in either pulse configs, or pipewire configs, although they might likely be user hardware specific.

So to sum up, using pulse based applications in a pro-audio sense can be somewhat problematic, and I'm looking into the persistent connection side of stream based audio.

Here's the script:

Code: Select all

#!/bin/bash

pw-jack jack_mixer -c /mnt/home/abox.sync.mir/a.presets/jack_mixer/2x1-stereo.xml &
pw-jack carla /mnt/home/abox.sync.mir/a.presets/Carla/Jackpipe-CARLA/MediaPlayer.carxp &
pw-jack parole /root/Ahmad\ Jamal\ -\ A\ Girl\ In\ Calico-vinyl.mp3 &

And note that I'm opening parole with the pw-jack though parole is not a jack app. It seems this command will open pulse apps. I put it there to see what would happen, but it functions identical to opening parole without the command.

Last edited by geo_c on Tue Jan 30, 2024 1:21 pm, edited 4 times in total.

geo_c
Old School Hipster, and Such

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: KLV Multimedia Pipewire

Post by geo_c »

@rockedge Here are some desktop files with cpupower commands that show up in the accessories and system menu. There is also one called cpuMON which is a command run in a terminal and monitors cpu speeds.

Also I included @fredx181's restore-sys script with a corresponding desktop file to run it from the menu, and the script should go in /root/my-applications/bin, and for the heck of it added two gtk-clock scripts and desktop files.

The cpupower desktopfiles would be super handy in RT releases especially.

util_desktop.tar.gz
(2.78 KiB) Downloaded 9 times

geo_c
Old School Hipster, and Such

Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: KLV Multimedia Pipewire

Post by Clarity »

I know @rockedge, @geo_c, @fredx181, @Sofiya, @wiak, and others may have already run across this in your testing, but it might be helpful to others making the transistion from the old way of doing audio to the simplistic manner that Pipewire is offering.

I ran across this quote while doing Google searches:

PipeWire can be used as an audio server, similar to PulseAudio and JACK. It aims to replace both PulseAudio and JACK, by providing a PulseAudio-compatible server implementation and ABI-compatible libraries for JACK clients...Dec 30, 2023

Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: KLV Multimedia Pipewire

Post by Clarity »

There has been some references in the forum on some audio "states" being preserved. This 1 year-old video suggest a manner.

Does it apply here?

User avatar
wiak
Posts: 3627
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 56 times
Been thanked: 994 times
Contact:

Re: KLV Multimedia Pipewire

Post by wiak »

multimedia in terms of streaming audio and video including for low latency is maybe the most complex scenario we must contend with. There is lots of misinformation concerning alsa, jack, pulseaudio and pipewire. People advocating alsa with actually zero real understanding of protocols and need for different layers and routing mechanisms.

Pipewire is where it is at. Alsa remains underneath. The likes of Jack and pulseaudio are being replaced by pipewire though the many jack and pulseaudio client ABIs (perhaps includes most APIs from user perspective?), which are about the protocol to communicate with the system, will remain in their pipewire implementations. Similar can be said for necessary servers - pipewire implementations, but more efficient. Pipewire can be used for networked multimedia, but not in core, but via various network support modules with different underlying tcp/ip protocols depending if low latency desired or less dropped packets. Great source of understanding (the complexity) is the FAQ: https://gitlab.freedesktop.org/pipewire ... /wikis/FAQ

So, yes, working with pipewire configurations is a key area of concern in our KL distro developments. Simple arguing about the merits of alsa only versus alsa with jack versus pipewire via claimed better results or nostalgia is a waste of time. Pipewire is where the game is and where the focus should be.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: KLV Multimedia Pipewire

Post by geo_c »

wiak wrote: Mon Jan 29, 2024 11:10 pm

Pipewire is where the game is and where the focus should be.

Yes, I totally agree, and if perhaps you misunderstand my points about pulse apps in pro-audio, what I'm basically saying is the issue is the applications themselves most likely, as jack apps do not have the same issue using the pw-jack, libjack-pipewire api. The jack apps remain connected where you put them. But the consumer apps, media players and browsers seem to be a different story currently, and they immediately route to hardware as they are designed to work with no fiddling around for day to day normal audio use.

And as I pointed out about the terminal music player musikcube, it's been upgraded with a pipewire-musikcube library of it's own, and once booted and connected , it stays put. So I anticipate as more applications migrate to pipewire api calls as opposed to pulse calls, more and more will behave similarly.

So to sum it up, what I currently have in KLV-airedale-RT-pwJ is the best of both of worlds, and what I'm striving for is the perfect scenario where every applications is a "pipewire" application as opposed to a "pulse" application.

Pipewire is running my jack apps better than jack did so far. The latency is better, and non-jack apps can mix with jack apps. Life's never been this good for me in linux audio.

I'm simply looking to understand the current state of the playing field, and as you point, there's a lot of mis-directed info out there right now, and it's hard to find the information I'm looking for.

geo_c
Old School Hipster, and Such

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: KLV Multimedia Pipewire

Post by geo_c »

Clarity wrote: Mon Jan 29, 2024 7:46 pm

There has been some references in the forum on some audio "states" being preserved. This 1 year-old video suggest a manner.

Does it apply here?

I'd say the takeaway from that video is two things. One is what I just said to @wiak , the pipewire and jack apps maintain stable connections, and the pulse apps don't. I didn't see he offered a solution for that aspect.

Two is that wayland is necessary for routing video streams like audio. And that cleared up that question for me.

He likes qpwgraph, but I found it difficult to use and seemingly unstable. I've had it in states where it won't make any connections at all. But I should probably keep working with it until I figure it out.

To me the Carla graph is way more stable, easier to manipulate, saves connections, and is in addition an audio plugin host. So I've been using Carla instead of Helvum or qpwgraph. (Btw, qpwgraph was designed by the developers of qjackctrl, which had a built in graph that was always a bit goofy in how it behaved, again I always used Carla running native jack, because the qjackctrl graph was buggy at times. Carla rarely gets wierd.

geo_c
Old School Hipster, and Such

Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: KLV Multimedia Pipewire

Post by Clarity »

Edit: An updated finding 3 posts down, below this post.
Maybe, ATM, Carla should be in KL and recommend so. That way, the community works together in what works and how to manipulate for 'wiring' in Pipewire. To me, as KLs continue to bring us into the present-future, is that we have a stable visualization tool for the internal 'wiring' that Pipewire offer system resource. That visualization is KEY, IMHO!

I have been using QPWgraph, but am in agreement to use the best tool for our needs.

Lastly, I offer: To use a visualization tool that provides a community forum where we can field questions/findings to their development/support from time to time. We all know the value of that.

Last edited by Clarity on Tue Jan 30, 2024 9:17 am, edited 1 time in total.
User avatar
wiak
Posts: 3627
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 56 times
Been thanked: 994 times
Contact:

Re: KLV Multimedia Pipewire

Post by wiak »

I'm very biased about cherrytree notebook since, as I've admitted, a large chunk of my memory is there...
I like cherrytree in preference to the likes of markdown solutions because you can simply cut and paste from most web pages into cherrytree notes (or subnotes, since it is hierarchical notetaker).

I really wish there was a communal cherrytree developers notebook, which included a topic like Pipewire, which we gradually added subnotes to (basically the sort of thing I tend to use for my own dev work notes). I'm not any kind of expert at all with pipewire so when I start checking it out in more detail I will be re-inventing many wheels, discovering already discovered information, and of course find myself scanning threads such as this one for some information.

Of course, others may not use cherrytree at all, and so my idea then helps no-one because cherrytree is what I use and probably won't use anything else... ;-)
Cherrytree can export to html and thus onwards to markdown of course, but not import from markdown I think [EDIT: turns out Cherrytree also has many import filters, including from Markdown, though I don't know how good the import works].

I've played with Joplin and similar, but truly none of them keeps my attention; I just love cherrytree user friendly cut and paste simplicity and simple export to html when necessary (rarely). Regarding Joplin import found this interesting link info tho:

https://discourse.joplinapp.org/t/conve ... st/1925/13

I migrated my CherryTree database to Joplin by doing the following half-manual process:

Exported CherryTree to HTML
Served the exported HTML packages using NodeJS server:
https://jasonwatmore.com/post/2016/06/2 ... web-server 72
Used Joplin browser plugin to import the pages one by one.
Bad news - I had to go through all pages and import them manually.
Good news - everything, including images, tables and formatting was imported.
Took about an hour for importing about 100 pages.

Anyway, this post is neither about cherrytree nor joplin specifically - just wish we had a developers notebook we kept updated (pipewire being in mind) since easier than browsing threads for info.
I really mention Joplin, because it is the only note taker app I'm really tempted to move too from Cherrytree. It's pretty big but since can use an AppImage and also works from mobile phone - Joplin might be the most universal open-source note taker around (and Markdown does have its attractions of course). Okay, so Joplin is pretty interesting because that web-clipper browser extension (Firefox, chrome or chromium) is working for me (chromium).
However... no webclip browser extension needed for Cherrytree - it is just MUCH more convenient - long may it live. The reason I don't go for all the markdown hype is, for one, I used markdown many years ago - it's fun, but the inability to easily copy and paste from browsers and word documents makes it a pain in the end... Also if I need a cherrytree note page or a complete hierarchical note in markdown it really works to just export to html, which cherrytree does fine and the likes of Joplin can import from that (at least on a per page basis - I haven't tried anything more complex since I have no real need for markdown version or Joplin). Xournal++ looks very inviting and pretty, but in practice I find it almost useless for my purposes.

Last edited by wiak on Tue Jan 30, 2024 11:00 am, edited 8 times in total.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: KLV Multimedia Pipewire

Post by Clarity »

+1

Or maybe a POSTing area on the forum for Wayland-PipeWire-Wireplumber-visualization tools. Of course, for first few months, moderators will have to guide/move member posts to this new area, if created. This is a way of corralling posts into a common area making searches focused on these subsystems, there.

For at least 2024, we should anticipate a rise in the need for the various reports by members as they find uses and answer questions relating to this combination of widely use within distros in the forum; especially the special efforts afoot here in KLs.

This thread's title, "KLV Multimedia Pipewire", makes plain what it is about. Its easy to find for the discussion it raises.

BUTT, its a single thread. A "Wayland-PipeWire-Wireplumber" topic area containing this thread and others would/should not only attract attention, but also contributions as our world evolves. And such a topic area has the potential of attracting more talents to both KLs and those looking for distros with clear implementations of this family of Linux subsystems. This is in light that, for now, the info would be broadly applicable across the forum's distro offerings.

Just some thoughts for consideration.

Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Re: KLV Multimedia Pipewire

Post by Clarity »

Hello @geo_c I have this response from my local AI specialist: :)

Does Carla graph for pipewire have a forum?

Unfortunately, Carla graph for PipeWire, also known as qpwgraph, doesn't have a dedicated forum in the traditional sense. However, there are several places where you can find discussions, resources, and help related to the tool:

  1. qpwgraph GitHub Page:
    The project's GitHub page (https://github.com/x64dbg/x64dbg/releases) acts as the central hub for information and communication. Here, you can find:

    • Issue tracker: Browse through reported issues and discussions to learn from other users' experiences and potential solutions.

    • Discussions tab: Though not a traditional forum, this section allows users to raise questions, share tips, and discuss qpwgraph-related topics directly with the developer.

  2. Online Communities:
    Several online communities cater to PipeWire and related tools, where you can find discussions and ask questions about qpwgraph:

  • Reddit's r/PipeWire subreddit: This active community frequently discusses various aspects of PipeWire, including qpwgraph. You can post questions or search for existing threads related to your specific needs.
    www.reddit.com
    Reddit r/PipeWire

  • Forum.Cockos.com: This forum frequented by users of REAPER, a popular digital audio workstation, has dedicated sections for PipeWire and qpwgraph discussions. You can find helpful insights and troubleshooting tips from experienced users.

    forum.cockos.com
    Forum.Cockos.com

Edit: This post is related to my post; 3 post above.

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: KLV Multimedia Pipewire

Post by geo_c »

I accomplished two things last night.

First, I tweaked pipewire configs to set my buffer rates in jack environment and audio interface from 1024 to 512, and I'll keep pushing that lower as I experiment, though many jack applications can set the pw-jack buffer internally.

Second, I figured out a way to use LibreWolf and Parole, in other words pulse audio apps/browsers in conjunction with jack mixing tools and keep them connected easily. Though it might be thought of as a "workaround" it nevertheless allows me to use them as source audio in a "pro-audio" multiple connection scenario.

In order to do that, instead of disabling my built-in sound card in pavucontrol as I did earlier, this time I kept it opened and muted. This way autoconnecting applications connect to the muted card, and my saved Carla connections route where I want them, to the jack_mixer in this case. When a media player or browser opens a stream and auto-connects or reconnects when a new file is opened, I simply load the Carla connection file a second time, and my preset connections are re-established.

Of course to make this work two audio cards are involved. In the case of Parole or a video stream from LibreWolf, pausing and rewiinding to the start position before the stream has concluded and closes maintains the connection to the mixer, and also loading the Carla preset again reconnects to my desired nodes.. So these apps becomes useable as an audio source without manually patching in a graph. A step in the right direction.

Image

Interesting that pw-top shows no buffer/sample rate info for my Presonus Interface while the streams are running, though audio is clearly being pumped through it indicated by the wait and busy rates.

geo_c
Old School Hipster, and Such

Post Reply

Return to “KL-Dev_Work”