"The one true way" take 4

All Linux talk goes here. Technical talk. No Distro politics, please use the "General" forum for that
Post Reply
User avatar
Naib
Site Admin
Posts: 1121
Joined: Sat Dec 19, 2020 2:20 am

"The one true way" take 4

Post by Naib »

Time and time again a decision is made to push "this is the only solution" when it isn't actually the only solution, that which is push is not ready for primetime and the fallout results in no change...

The latest one is Pipewire. Now don't get me wrong... pipewire is great! I suffered soo many problems with Pulse that it was painful (and I only went to pulse when oss4 became unmanageable and a few things "hard-depended"). I dove in one day and got pipewire running on my system and seeded the wiki and it has grown ever since.

However... it seems it is now being pushed as the "one true solution" even though the wiki has a massive WARNING
https://wiki.gentoo.org/wiki/PipeWire

https://forums.gentoo.org/viewtopic-t-1 ... ight-.html


So we had libav being aggressively pushed (gentoo and other distro) to replace ffmpeg even though libav broke things and was filled with security holes. There is Systemd and how that is pushed and also there is wayland as the "one true display" ...

common theme here in the FOSS world being enabled by gentoo
The best argument against democracy is a five-minute conversation with the average voter

Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
User avatar
RoGeorge
National Metrics Strategist
Posts: 497
Joined: Sat Dec 19, 2020 4:47 am

Re: "The one true way" take 4

Post by RoGeorge »

A week ago needed to sample at 24bits/96kHz with the soundcard to make some FFT and measure the distortions from a little Peltz oscillator I was playing with. Long story short, I ended recompiling drivers and kernels and reading about audio in Linux, which I new nothing about before.

My understanding was the software layers are like this
- hardware driver (chipset/CODEC specific, usually a loadable kernel module)
- HDA Intel driver (High Definition Audio, from Intel but it's a SW standard, replaces the former AC97 standard)
- ALSA (Advanced Linux Sound Architecture, usually part of kernel, replaces former OSS aka Open Sound System)
- PulseAudio (replaced the former JACK, to be replaced probably starting this year with PipeWire)

About CODEC driver and HDA driver, usually there is no choice for a given soundcard, but for the upper layers, it is. Fun fact, my FreeBSD install is using OSS and nothing else on top. It works, though that's not the daily desktop.

- ALSA and OSS can not coexist, but ALSA has an OSS compatible mode which often tricks old programs into running without a proper OSS, but not on all of them can be tricked that way (for example the free version of 'baudline' was made for OSS, didn't work with the OSS-compatible layer of ALSA, I had to record with arecord then pipe the soundstream into baudline)
- JACK and PulseAudio can coexist (with some inconveniences), usually one can switch at runtime which one to use, but the choice is global and they can not run simultaneously (not very sure about the last one, might be an workaround to start JACK and still have sound through PulseAudio).
- about PipeWire I know nothing, booted from a live Ubuntu with PipeWire and didn't noticed anything special at it. Didn't dig much, but underneath PipeWire is the usual ALSA.

No idea why all the hype with PipeWire.
¯\_(ツ)_/¯

What I've noticed is the must have is up to the ALSA layer inclusive, then the upper layers are not needed. Applications can work with ALSA (at least those that I am using, they work OK when PulseAudio was stopped, except the automatic rerouting - stopped with "systemctl --user stop pulseaudio.{socket,service}", but not uninstalled). In fact, I hate the automatic reconfiguration of the sound (i.e. when plugging the headphones and the sound suddenly switch from speakers to headphones, switching the other way around when accidentally unplugging the headphones can be even worst, or the automatic resampling or filtering when I usually want to sample at rates offered by the hardware, not the fake rates offered by PulseAudio, or the automatic rerouting the sound when I plug an USB soundcard, and so on.


My question as a noob in Linux sound is why do you need PulseAudio or PipeWire? What functionality that you need only works with one of those, and can not work directly from ALSA?
Ralphred
Creator of Opportunities
Posts: 205
Joined: Tue May 11, 2021 4:22 pm

Re: "The one true way" take 4

Post by Ralphred »

RoGeorge wrote: Wed Aug 03, 2022 9:26 amJACK and PulseAudio can coexist ... they can not run simultaneously
... snip ...
why do you need PulseAudio or PipeWire?
I'll answer the last part first, mixing multiple sources (clients) and pushing it through a single sound card.
Now, I need jack, because reasons, but very little supports it client wise, but what you can do is gimp pulseaudio, so no auto detection, no udev, no connecting to hardware, just sinks/sources into jackd, why, because nearly everything supports pulseaudio, browsers, de backends, nasty web apps like discord and telegram, so if you go through the "applied laziness" of taming pulseaudio it makes for an easy life late down the road. There are also some nice little features when you use it with kmix, like moving clients to different outputs etc.

I don't understand the pipewire fascination myself, but the conversation went like this:
>So it supports jack
>yes
>So i can just start it instead of jackd and all my clients will connect
>yes
>So I can still use qjackcontrol to do all the routing between the lv2 plugins
>erm
>Right, so when you say it supports jack, you mean it mimics a jackd server for a dumb client to connect to
>erm
>OK, can I make it connect to a jackd server and do the same thing as PA
>yes
>How do I define multiple sinks/sources
>erm
>K, fanks, bye.

Maybe it'll work one day...

EDIT: Oh yeah, the other think pulse can do which is quite useful is filter in the low frequency out and dumping it on the LFE channel, this works well because I have to boost certain channels of the 5 in 5.1 to get the right balance, and because the rear channels have to be louder without filtering the low freqs out before boosting people walking up behind you in games have very bass heavy foot steps. Because it gets "filtered" before I do the distance levelling, no bassy boot steps.
Were Dante alive today, he would agree that the tenth circle of hell is reserved for people who have non-ANSII characters in online usernames.
User avatar
otw-refugee
Director of Sandbags
Posts: 750
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: "The one true way" take 4

Post by otw-refugee »

pulseaudio, like systemd came with a buttload of promises, most of which went unfulfilled.

It does some things ok, but it's still a half-baked product, and now that people have seen the emperors new clothes, pipewire is the new goto.
Though I must admit that pipewire is more ambitious, video as well as sound (replacement for pulse).

I don't use pulse, I've steered clear of it, tried jack once upon a time, but have gone to just alsa, as I have limited use for anything soundwise beyond the system the sound card is on.
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
Ralphred
Creator of Opportunities
Posts: 205
Joined: Tue May 11, 2021 4:22 pm

Re: "The one true way" take 4

Post by Ralphred »

otw-refugee wrote: Wed Aug 03, 2022 4:38 pmpulseaudio, like systemd came with a buttload of promises, most of which went unfulfilled.
I'd settle for accurate and full documentation, but apparently I'm an "edge case".
Were Dante alive today, he would agree that the tenth circle of hell is reserved for people who have non-ANSII characters in online usernames.
awillserver
Oxford Comma Destroyer
Posts: 55
Joined: Mon Jan 11, 2021 5:55 am

Re: "The one true way" take 4

Post by awillserver »

RoGeorge wrote: Wed Aug 03, 2022 9:26 am My question as a noob in Linux sound is why do you need PulseAudio or PipeWire? What functionality that you need only works with one of those, and can not work directly from ALSA?
Pulseaudio, pipewire, and JACKd are bandaids for the inherent flaws in the design of ALSA. ALSA will not do application sound mixing and mixing sources in ALSA or even configuring it without a GUI that 'knows" what it is doing is a PITA and you essentially have to learn how C and shell scripting works to configure it a little. ALSA also does not assure realtime so you need a driver component in ALSA that userland software then has to use to get closer to realtime.

Here's a history lesson. OSS version 3 was in mainline linux kernel for a few years in the 199*'s. OSS v3 was slated to be removed from the mainline linux kernel because redhat devs wanted something linux specific e.g Advanced Linux Sound Architecture in 1998. Thing is that oss v3 far superiour to alsa back then, and even now partially. So redhat made some shitty drivers that were nutoriously buggy and missing features even to this day, i'm looking at you hda-intel. Also ossv3 went from being open source to closed, then back to open between 2000 and 2006.

OSSv4 which existed in about 2006 does in kernel application sound mixing and source mixing. OSSv4 has a far superiour software sampler in performance and sound quality then alsa. Fun fact, the sound sampler you get with alsa depends on your hardware driver, some have better software implementations then others. With OSSv4 everyone gets the same super awsome high performance sampler. OSSv4 has better/existing documentation going back to 2006, ALSA still doesn't have very good docs to this day.

Oh did I mention that OSSv4 does all of that and still performs better then *just* alsa in kernel? That's not even tacking on pulse/pipe/jack to alsa to make it even slower. OSSv4 has better realtime performance then alsa to this day. Oh and OSSv4 has been on maintenance mode and not developed for over a decade, and is still better then alsa.

ALSA and pulse/pipe/jack are just trojan horses from redhat to ruin unix sound. The non linux unices still use ossv4 because its much easier to code for, maintain, and is well documented. Its been community members making patches to make it work with upstream linux for over a decade now as opposed to sound devs from the companies making the hardware.

The only reason I don't use ossv4 full time is because I haven't figured out how to embed it in a no module kernel as its a out of kernel module at this point. OSSv4 also embeds a mini-kernel for the sound system so there's some weird dosymbol fuckery going on which works fine with shared modules but not with everything built in. Almost all software still supports oss if you compile from source, its mostly community patches in their respective bugtracker that never get merged. I've found tons of community patches for oss that just never get merged. Whatever doesn't work you can use an alsa to oss daemon in the background. The thing I really like about oss is the sound quality though. Same hardware alsa vs oss and oss always wins in sound quality.
User avatar
otw-refugee
Director of Sandbags
Posts: 750
Joined: Fri Dec 18, 2020 12:01 pm
Location: Dallas area

Re: "The one true way" take 4

Post by otw-refugee »

I used to use oss4, but the last 2 motherboard sound chipsets, it didn't support, along with never working for hdmi, I gave it up.

Alsa will do multi-source sound, but you pay the price in sound quality for that as you have to use the dmix module.
As far as realtime, never looked at that aspect as I don't run a RT kernel.

Edit to add: oss4 did indeed make it so that multiple sources could be used at the same time (if desired) and the sound quality was much better than alsa w/default config, but they (oss people) seem to lack developer resources, at least with the free version, never used the pay version so have no idea about that.
Understanding is a three edged sword: your side, their side, and the truth.

Local portage repo, opentmpfiles copy
List of wayland apps/compositors
saellaven
Creator of Opportunities
Posts: 385
Joined: Fri Dec 18, 2020 10:15 pm

Re: "The one true way" take 4

Post by saellaven »

I remember the switch from OSS3 to ALSA, and just how painful it all was and still is.

Everything just worked with OSS3. To this day, I still have quirky issues with ALSA that are just a pain to deal with - for example, I had a game that I needed to set the sample rate for, but that sample rate wouldn't allow my browser to play audio.

In fact, I would say that audio, and in particular, ALSA, is my number one headache in Linux. Pulseaudio and Pipewire are just an additional kludge on top of the problem, that, in turn, add new problems.

I'm at least able to avoid all the Poetteringware, but ALSA is the thorn in my side...
Post Reply