Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sound on linux is never getting easier, isn't it?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Wed Jul 03, 2024 1:32 am    Post subject: Sound on linux is never getting easier, isn't it? Reply with quote

Split from "does gnome require now pipewire?" while it was still easy to split. -- Zucca

Sound on linux is never getting easier, isn't it ?
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Wed Jul 03, 2024 8:03 pm    Post subject: Reply with quote

dmpogo wrote:
Sound on linux is never getting easier, isn't it ?


Quite. You'd think we would have cracked this, after twenty years or so. Instead, we just keep making new potential solutions to what should be a simple problem -- mixing and routing audio -- and making things harder for developers and users.

It's interesting (to me, at least) that Android reinvented this particular wheel with its proprietary "Audio Flinger'" that has all the same problems that the regular Linux audio servers do.

BR, Lars.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2538

PostPosted: Wed Jul 03, 2024 8:32 pm    Post subject: Reply with quote

lars_the_bear wrote:
dmpogo wrote:
Sound on linux is never getting easier, isn't it ?


Quite. You'd think we would have cracked this, after twenty years or so. Instead, we just keep making new potential solutions to what should be a simple problem


Simple problem it definitely is not. However this is off topic. If you want to discuss, please go to Gentoo Chat forums.

Best Regards,
Georgi
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Thu Jul 04, 2024 7:14 am    Post subject: Reply with quote

logrusx wrote:

Simple problem it definitely is not. However this is off topic. If you want to discuss, please go to Gentoo Chat forums.


Thanks, but no point -- it's been discussed to death over the last 20 years. I doubt I have anything new to say.

BR, Lars.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3805
Location: Rasi, Finland

PostPosted: Thu Jul 04, 2024 7:40 am    Post subject: Reply with quote

My experience with pipewire on just a laptop has been quite flawless.
I think I had to restart the daemon one or twice, when I have lost audio.

That's way, WAY, much better than with pulseaudio.
Pulseaudio constantly used around 4-5% of CPU cycles, and simply stopped outputting any audio.

When Pipewire was at some stage of being able to produce sound, I immediately switched to it. I disabled pulseaudio where ever I could.

Time will tell if we finally get proper solution for audio on Linux.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3477

PostPosted: Thu Jul 04, 2024 9:56 am    Post subject: Reply with quote

There is no getting easier than OSS, when you could just cat a wav file into /dev/dsp.
This said, being able to easily route sound from one application to another is a big step up, so at least the added software complexity (which is mostly hidden from users anyway) is provides real benefits it in this case.
PW take the good from JACK (virtual patch bay) and solves its problems. Like supporting multiple playback devices. Which is great. Dependency on DBUS is less great. Oh well...
Can't say much about PA, I've been using it for a while on another machine and I remember it crashing and tripping over its profiles quite a bit, but it was also a few years ago, when it was a much younger project.

You know what is truly not getting any easier? Printing. You know the joke about keeping a gun next to your printer, don't you? And apparently, people under windows don't have it any better. But that's a different matter.
Web browsing is not getting easier either, though for different reasons...

Anyway, "if you keep improving something for long enough, you're inevitably going to break it"
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Thu Jul 04, 2024 10:33 am    Post subject: Reply with quote

szatox wrote:
There is no getting easier than OSS, when you could just cat a wav file into /dev/dsp.


That was easy when we only had one sound device (if we were lucky).

ALSA at least allowed for multiple input and output devices, and an application could use the input from one device and output to another. I'm not sure OSS ever supported that (but it was a long time ago).

I have no objection in principle to audio servers being put on top of ALSA, when they provide new functionality. The problem is that they tend to be crappy. They also tend to be tied -- to some extent -- into integrated desktops and hardware detection which, I accept, isn't going to a big problem for most users.

The fact that Linux (including ChromeOS and Android) keeps spawning audio servers might suggest that there is a hard problem to be solved. But I disagree: the real problem is that we just can't agree on what such a thing should actually do, and what its scope should be. So when we get something like Pulse, which started life full of bugs, it seemed to be easier to implement something else that better satisfied the needs of some other group of people, than to fix it. To be fair, it's not that buggy these days.

The personalities of the people behind Pulse didn't help the situation much, either. It's interesting to me that Red Hat plugged Pulse hard for a while, and then moved to PipeWire in RHEL 9. Maybe Pulse will eventually end up as another dried-out carcass by the side of the Linux highway, like the Enlightenment Sound Daemon and about twenty others.

I don't really have a dog in this fight -- I don't find that I need any of them. My modest needs are perfectly well-catered by ALSA. I keep reading about how Pusle/PWD/ESD/etc were needed to allow multiple applications to output to the same sound device. But ALSA has had that capability for years, if not decades. What ALSA can't do is change output device on the fly, which I concede is a limitation.

I'm not saying that ALSA is perfect -- far from it; but our attempts over the last twenty years to improve on it have not been an unqualified success.

BR, Lars.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Fri Jul 05, 2024 5:08 am    Post subject: Reply with quote

I did not mean really to start the discussion (it is pretty much deja vu), but I find amusing that when I have some issues now, such as disappearing sound I need to look at least in five or more different places.
Everybidy and their dog seems trying to control my audio devices. Audio can be be muted at Youtube level, at a browser level in the tab, at kmix level, some mix up with devices at pulseaudio level where you need to go to pavucontrol-qt, once I have to restart pipewire service, at last there are physical buttons on laptop (this already more than 5 levels) I am interested to know if anybody in this thread could claim that they can describe the architecture of playing a song in the browser in, say KDE desctop ? How things are related to each other ?

And yes, printing, especially with propagation of bonjour is an unstable mess. Even on Mac it is not very stable. I would say in lpd times we had a solid networking server. We had issues with particular printers drivers, later ppds, but postscript printers over lpd were a pretty solid setup. Now even that part is flaky.
Back to top
View user's profile Send private message
NichtDerHans
Apprentice
Apprentice


Joined: 27 Jan 2023
Posts: 178

PostPosted: Fri Jul 05, 2024 6:16 am    Post subject: Reply with quote

OT: If I want to print something, I take my USB stick out of the house and go to a local copy shop. It costs a few cents per page, I don't have to worry about printershit.
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3805
Location: Rasi, Finland

PostPosted: Fri Jul 05, 2024 8:01 am    Post subject: Reply with quote

szatox wrote:
There is no getting easier than OSS, when you could just cat a wav file into /dev/dsp.
Oh, the times...
szatox wrote:
You know what is truly not getting any easier? Printing. You know the joke about keeping a gun next to your printer, don't you? And apparently, people under windows don't have it any better. But that's a different matter.
Web browsing is not getting easier either, though for different reasons...

Anyway, "if you keep improving something for long enough, you're inevitably going to break it"
Indeed.
I constantly go drifting in flea markets and similar places, but also on the net too. I look for all kinds of tools for my little workshop. Because
  • I save money
  • Older tools usually were made to last longer
    • How about a Black & Decker drill from 60's for 4 euros? All metal, none the plastic.
  • Older tools were made to be fixed
... and this all can also be seen in PC hardware, but also in software. Have a giant blob of bad code that needs fixing, yet again? You just better start from scratch. I wonder if that is what happened to PA..?
I just hope PW will keep its things polished. It looks (sounds) good now.

Printing on Linux hasn't been a problem for me. But I've always made sure to buy a printer that's Linux friendly. So that's Brother most of the time. Canon lasers seem to be impossible with Linux.

But at this point in time... I really cannot complain. My audio works, my printing works.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Fri Jul 05, 2024 5:57 pm    Post subject: Reply with quote

Zucca wrote:
[
Printing on Linux hasn't been a problem for me. But I've always made sure to buy a printer that's Linux friendly. So that's Brother most of the time. Canon lasers seem to be impossible with Linux.

But at this point in time... I really cannot complain. My audio works, my printing works.


I have a bug opened against cups-browsed which simply segfaults semi-randomly on my setup. My home has a desktop, which has two queues, one locally attached printer, and one networked printer with fixed IP, configured via socket (although it can be also seen with bonjour). This desktop supposed to serve queues to my laptop and, possibly, to my wife laptop, running OSx (at least the local printer).
IIt looks like if I use CUPS for queue sharing it is OK (but my wife cannot use it on MAC), and if I add DNSSD to CUPS, cups-browsed on laptop segfaults from time to time and queues disappear.
So I never now whether I have a printing or not when I open my laptop, and my wife gave up on me, stuck USB cable in that netwroked printer which is her office and attaches it to her laptop if she needs to print :)


The printers (both HP) themselves work fine when the job gets to them. I would understand printer drivers are not up to par on Linux for some proprietary models etc. But that networking part is flaky, where Liux always excelled, is a disappointment.
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 826
Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.

PostPosted: Fri Jul 05, 2024 6:24 pm    Post subject: Reply with quote

Why do you get extremely bad audio stuttering with pipewire when eg listening to whatever in the background at the same time as moving a file from one filesystem to another with checksumming going on (fletcher4 in my case)? Doesn't happen with pulseaudio or pure alsa.
_________________
I spent a christmas in Vienna twenty something years ago. It was a beautiful city. Everyone was so friendly.
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1895
Location: Switzerland (Romandie)

PostPosted: Fri Jul 05, 2024 10:51 pm    Post subject: Reply with quote

lars_the_bear wrote:
szatox wrote:
There is no getting easier than OSS, when you could just cat a wav file into /dev/dsp.


That was easy when we only had one sound device (if we were lucky).

ALSA at least allowed for multiple input and output devices, and an application could use the input from one device and output to another. I'm not sure OSS ever supported that (but it was a long time ago).


JACK can do that, but it is no out of the box solution. You would have to make your own .asoundrc file for that, which can be a complex things to do. Also, when using multiple sound cards, if they are not in sync by a world clock (only a few high-end cards provide it), it can be jitter and associated xruns. As pipewire is mean to be jack compatible, it must be possible to do the same with it.

JACK can also interface the ALSA applications into the JACK graph with the jack alsa plugin. Combined with a custom .asoundrc where that jack plugin is the default ALSA card, all the ALSA applications will appear into the JACK graph automatically. It's a one time config and you get all the pulseaudio advantages, but with a constant latency which is a must for serious audio work. I don't use pipewire, but if it is really jack compatible, this should work into pipewire as well. When I see the simplicity of the JACK<=>ALSA plugin, and how well it work, I consider pulseaudio as a waste of time and efforts. That's just my biaised point of vue as an electronics engineer specialized in all kind of audio electronics - from vacuum tubes to DSP, and as a musician.
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3805
Location: Rasi, Finland

PostPosted: Sat Jul 06, 2024 6:10 am    Post subject: Reply with quote

mrbassie wrote:
Why do you get extremely bad audio stuttering with pipewire when eg listening to whatever in the background at the same time as moving a file from one filesystem to another with checksumming going on (fletcher4 in my case)? Doesn't happen with pulseaudio or pure alsa.
I'd check if pipewire has enough priority.
There was somewhere (on the net) a mention of rtkit being required... Although I don't have it installed and pipewire doesn't have USE rtkit -flag either.
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
ChrisJumper
Advocate
Advocate


Joined: 12 Mar 2005
Posts: 2400
Location: Germany

PostPosted: Tue Jul 09, 2024 8:43 pm    Post subject: Re: Sound on linux is never getting easier, isn't it? Reply with quote

dmpogo wrote:
Split from "does gnome require now pipewire?" while it was still easy to split. -- Zucca

Sound on linux is never getting easier, isn't it ?


I am not sure if it is.. but. pipewire is a big step forward from oss, alsa, jack and pulseaudio to the future is pipewire. So try to migrate to pipewire!
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 445

PostPosted: Wed Jul 10, 2024 5:55 am    Post subject: Re: Sound on linux is never getting easier, isn't it? Reply with quote

ChrisJumper wrote:

I am not sure if it is.. but. pipewire is a big step forward from oss, alsa, jack and pulseaudio to the future is pipewire.

Pipewire is clearly different than ALSA. It essentially serves the same function as PulseAudio. It is a sound server that sits on top of ALSA.
Developers have essentially abandoned Pulseaudio and started from scratch with Pipewire.

Whether or not Pipewire is an improvement over PulseAudio is subjective. It is definitely shiny and new. Other than that, in what way is it a big step forward from PulseAudio?
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 537

PostPosted: Wed Jul 10, 2024 6:41 am    Post subject: Re: Sound on linux is never getting easier, isn't it? Reply with quote

rab0171610 wrote:

Developers have essentially abandoned Pulseaudio and started from scratch with Pipewire.


As we did with every audio server before it.

I wonder if the problem here is conflicting requirements? Perhaps the needs of a person who wants bit-perfect audio streaming to a DAC, and a person who wants his audio to switch on-the-fly when connecting a Bluetooth headset, are not compatible?

FWIW I've found PipeWire to be more reliable that Pulse. By that I mean that it is less prone to run 100% CPU or just stop working for no good reason. But, as you say, that is subjective. I try to avoid all of them and, for the most part, I can.

BR, Lars.
Back to top
View user's profile Send private message
bulletbill22
n00b
n00b


Joined: 15 Oct 2022
Posts: 34

PostPosted: Wed Jul 10, 2024 9:02 am    Post subject: Reply with quote

Everyone can see the problems of the existing audio services, but no one has the experience with audio development to be able to actually manage the project to produce a quality result. The people who do have those skills are being paid 6 figure salaries to work on some other project, and they're not giving that up so that you can listen to music. The developers, who can see the obvious problems of previous projects, don't have the time or experience to run that sort of project. You wind up with lots of volunteers adding features, which add bugs, which add hacky fixes, and finally the project gets released in a bloated / messy / unfinished / buggy state like all the others before it. Its either that, or eternal development as features get added too slowly to keep up with hardware changes.

I use ALSA. It works for me, so I don't need to switch or need anything new.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6181
Location: Dallas area

PostPosted: Wed Jul 10, 2024 9:39 am    Post subject: Reply with quote

Pipewire is audio AND video, not just a sound server.

You can use rtkit or just set the nice priority, and set the pipewire executable
Code:
$ getcap /usr/bin/pipewire
/usr/bin/pipewire cap_sys_nice=eip


Code:
setcap 'cap_sys_nice=eip' /usr/bin/pipewire


I run pipewire with alsa and bluetooth, no jack or pulse.
I can still access alsa whether pipewire is running or not, though you shouldn't try to do both at the same time.

I like using the builtin equalizer in pipewire, improves the sound (over straight alsa) on my system.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3805
Location: Rasi, Finland

PostPosted: Wed Jul 10, 2024 11:25 am    Post subject: Re: Sound on linux is never getting easier, isn't it? Reply with quote

lars_the_bear wrote:
FWIW I've found PipeWire to be more reliable that Pulse. By that I mean that it is less prone to run 100% CPU or just stop working for no good reason.
My exact experience right there.
Anon-E-moose wrote:
Pipewire is audio AND video, not just a sound server.
... Exactly.
A multimedia server if I may say so.
Anon-E-moose wrote:
You can use rtkit or just set the nice priority, and set the pipewire executable
Code:
$ getcap /usr/bin/pipewire
/usr/bin/pipewire cap_sys_nice=eip


Code:
setcap 'cap_sys_nice=eip' /usr/bin/pipewire
Thanks. @mrbassie Try this?
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Wed Jul 10, 2024 2:40 pm    Post subject: Reply with quote

What I do not understand is that before pipewire I did not have to run pulseaudio daemon (it was compiled with -daemon flag) and everything was working. But now I have to run wireplumber, which is doing what ?
Session management ? I though I have polkit and elogind to do that, not to mention I do no use any multiple sessions.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Wed Jul 10, 2024 2:49 pm    Post subject: Re: Sound on linux is never getting easier, isn't it? Reply with quote

Zucca wrote:
lars_the_bear wrote:
FWIW I've found PipeWire to be more reliable that Pulse. By that I mean that it is less prone to run 100% CPU or just stop working for no good reason.
My exact experience right there.
Anon-E-moose wrote:
Pipewire is audio AND video, not just a sound server.
... Exactly.
A multimedia server if I may say so.


So what does it actually do for video in the current setup (I guess remote desktop is related) ? And what does it mean to use it as multimedia server, does is cast to TV or anything ?

If I read the description on the website
Quote:

PipeWire is a project that aims to greatly improve handling of audio and video under Linux. It provides a low-latency, graph-based processing engine on top of audio and video devices that can be used to support the use cases currently handled by both PulseAudio and JACK. PipeWire was designed with a powerful security model that makes interacting with audio and video devices from containerized applications easy, with support for Flatpak applications being the primary goal. Alongside Wayland and Flatpak, we expect PipeWire to provide a core building block for the future of Linux application development.

Capture and playback of audio and video with minimal latency.
Real-time multimedia processing on audio and video.
Multiprocess architecture to let applications share multimedia content.
Seamless support for PulseAudio, JACK, ALSA, and GStreamer applications.
Sandboxed applications support. See Flatpak for more info
.

I can't say I understand much. Not to mentiion that living is the world of containerized applications is not my life goal :)
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6181
Location: Dallas area

PostPosted: Wed Jul 10, 2024 3:08 pm    Post subject: Reply with quote

Wireplumber is the part of pipewire that handles interfacing to alsa and bluetooth for sound and elogind/systemd for session mgmt.

Pipewire/wireplumber is useful for containers, though that's not the primary use for it.

The video/audio sharing is part of desktop portals, ie sharing your desktop, or window with other people.
I don't use this part of it, at this time, as I'm not part of a group that needs to share my desktop.

It's not necessary to use pipewire/wireplumber for most cases, short of an individual application requiring it. just like pulse is required for some apps.

Don't want to use pipewire/wireplumber, most of the time there's a use flag to ignore it, for most apps.
If an app requires it, then it's your choice as to whether to use that app and the associated pipewire/wireplumber.

Pipewire consolidates alsa, bluetooth, pulse and jack in one place.
It was mostly a plug and play setup for me, emerge pipewire/wireplumber with use flags, and it was good to go.
I did spend some time messing with getting the equalizer set up properly, according to my listening preferences, but that's all.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3477

PostPosted: Wed Jul 10, 2024 3:28 pm    Post subject: Reply with quote

Pipewire moves data in data streams from sources to sinks. Wireplumber tells it which sinks consume data from which sources.

Anon-E-moose, what do you use for equalizer?
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6181
Location: Dallas area

PostPosted: Wed Jul 10, 2024 3:33 pm    Post subject: Reply with quote

The reason people are not using alsa so much, is pretty much the same reason people don't write apps in assembler anymore.
They prefer to write to a higher level app and let it talk to alsa.
All this from a developer view point, which is who writes apps, not end users.

I hate to think of the number of threads I've seen over time about how to get an alsa device to work properly,
or having bluetooth work seamlessly with alsa.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum