View previous topic :: View next topic |
Author |
Message |
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3437 Location: Canada
|
Posted: Wed Jul 03, 2024 1:32 am Post subject: Sound on linux is never getting easier, isn't it? |
|
|
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 |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 523
|
Posted: Wed Jul 03, 2024 8:03 pm Post subject: |
|
|
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 |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2452
|
Posted: Wed Jul 03, 2024 8:32 pm Post subject: |
|
|
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 |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 523
|
Posted: Thu Jul 04, 2024 7:14 am Post subject: |
|
|
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 |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3734 Location: Rasi, Finland
|
Posted: Thu Jul 04, 2024 7:40 am Post subject: |
|
|
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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3448
|
Posted: Thu Jul 04, 2024 9:56 am Post subject: |
|
|
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 |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 523
|
Posted: Thu Jul 04, 2024 10:33 am Post subject: |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3437 Location: Canada
|
Posted: Fri Jul 05, 2024 5:08 am Post subject: |
|
|
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 |
|
|
NichtDerHans Apprentice
Joined: 27 Jan 2023 Posts: 177
|
Posted: Fri Jul 05, 2024 6:16 am Post subject: |
|
|
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 |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3734 Location: Rasi, Finland
|
Posted: Fri Jul 05, 2024 8:01 am Post subject: |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3437 Location: Canada
|
Posted: Fri Jul 05, 2024 5:57 pm Post subject: |
|
|
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 |
|
|
mrbassie l33t
Joined: 31 May 2013 Posts: 822 Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.
|
Posted: Fri Jul 05, 2024 6:24 pm Post subject: |
|
|
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 |
|
|
Dominique_71 Veteran
Joined: 17 Aug 2005 Posts: 1895 Location: Switzerland (Romandie)
|
Posted: Fri Jul 05, 2024 10:51 pm Post subject: |
|
|
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 |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3734 Location: Rasi, Finland
|
Posted: Sat Jul 06, 2024 6:10 am Post subject: |
|
|
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 |
|
|
ChrisJumper Advocate
Joined: 12 Mar 2005 Posts: 2400 Location: Germany
|
Posted: Tue Jul 09, 2024 8:43 pm Post subject: Re: 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 |
|
|
rab0171610 Guru
Joined: 24 Dec 2022 Posts: 427
|
Posted: Wed Jul 10, 2024 5:55 am Post subject: Re: Sound on linux is never getting easier, isn't it? |
|
|
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 |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 523
|
Posted: Wed Jul 10, 2024 6:41 am Post subject: Re: Sound on linux is never getting easier, isn't it? |
|
|
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 |
|
|
bulletbill22 n00b
Joined: 15 Oct 2022 Posts: 34
|
Posted: Wed Jul 10, 2024 9:02 am Post subject: |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6160 Location: Dallas area
|
Posted: Wed Jul 10, 2024 9:39 am Post subject: |
|
|
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.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3734 Location: Rasi, Finland
|
Posted: Wed Jul 10, 2024 11:25 am Post subject: Re: Sound on linux is never getting easier, isn't it? |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3437 Location: Canada
|
Posted: Wed Jul 10, 2024 2:40 pm Post subject: |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3437 Location: Canada
|
Posted: Wed Jul 10, 2024 2:49 pm Post subject: Re: Sound on linux is never getting easier, isn't it? |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6160 Location: Dallas area
|
Posted: Wed Jul 10, 2024 3:08 pm Post subject: |
|
|
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.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3448
|
Posted: Wed Jul 10, 2024 3:28 pm Post subject: |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6160 Location: Dallas area
|
Posted: Wed Jul 10, 2024 3:33 pm Post subject: |
|
|
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.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
|
|
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
|
|