by esjeon · 3y ago · 0 comments
Unfortunately, this isn't shippable for distros. The biggest issue is acquiring proper impulse-response data. In theory, it has to be tuned per-model, and turning basically requires pro-grade equipment and a recording studio. However, apparently many people assume Dolby is using the same profile for all laptops, so just copy-paste the same file here and there. Not really sure which is the real case.
Anyways, Asahi can ship DSP turned on by default because the distro is specific to Apple. That's how Apple boosts the quality of its hardware, and the same applies to a distro dedicated to it.
[1]: https://github.com/wwmm/easyeffects
[2]: https://stackoverflow.com/questions/27122564/which-version-o...
And the system needs to be fail-safe, so that the speakers don't get blown out if the daemon crashes or hangs.
---
As a separate topic, I disagree that this isn't shippable for distros. Distros already have a bunch of hardware-specific stuff. Libinput, for example, has a hardware database to correctly handle or work around quirks for all sorts of input hardware.
There's absolutely nothing which would prevent Ubuntu from providing speakersafetyd's hardware database, either as an optional package, or, if out-of-the-box Mac support is important, as a package that's installed by default.
As a complete aside unrelated to the broader discussion, libinput is my nemesis and it has degraded my user experience of Linux.
I hate, hatehatehatehate one finger tap to click. It's a huge misclick generator, and libinput used to have it off by default for good reason.
However, libinput gates all actually useful and not very error-prone gestures like two and three finger taps to right and middle click and multifinger swipes behind having one finger tap to click enabled. You either take it all or you get nothing.
This is a huge regression from the old Synaptics interface which let the user freely assign different actions to taps with different amounts of fingers.
The worst is that it's completely intentional and has been the case for over five years because the old maintainer didn't want to write tests.
I also dislike how there's no global libinput config file. I get that it's supposed to be a library, and the user of the library (GNOME, KDE, Sway, whatever) is supposed to expose those options, but in practice, a lot of useful options aren't exposed to the user. GNOME is especially bad about that.
There are also weird choices, like: when you press down with two fingers and then move those fingers together (double click and drag), the cursor moves at twice the normal speed.
Linux input isn't universally better now than it was a decade ago and that sucks.
Aww, so you don't think other distros will ship this even once upstream is figured out?
Kernels already ship hardware-specific drivers, but I suppose that just comes with the Linux kernel, whereas this needs support on both the kernel and userspace sides...
If a distro is expecting you to install onto the rando asus gaming laptop you got at staples? not going to work.
The thing about M-series apple macs is there are only like 10 models total to record profiles for. You can't realistically do that and ship profiles for every x86 laptop under the sun.
You maintain profiles in a repo and package them like anything else. No one has indicated how this cannot usually be zero config via hardware probing.
That means sitting down in front of every single model with decent measurement equipment and running a test. This doesn't scale, especially not for a distro with limited resources.
it seems like precisely the contrary to an Apple-specific distribution.
There are a fuck of a lot of rando x86 laptops, and you need to record a different profile for every single one of them. That means sitting down in front of every single laptop model you want to ship a profile for and running tests with a measurement-grade microphone and equipment.
Marcan did that for the handful of M-series mac laptops that exist. Good luck physically testing even 0.01% of the x86 laptops that exist.
I’ve been waiting decades for a Linux distro that just buys a few commonly produced laptops that are likely to be produced for a few years, and then tests the crap out of them and applies this sort of polish.
Current gen thinkpads probably would have fit the bill for the last ~30 years, for example. I was hoping the pinebook pro would be this, but it has a few severe hardware issues (suspend battery life, DSP noise) that don’t look like they’ll be fixed. Similarly, the XPS line has the capacitor whine problem, and are based on Intel (which has been exclusively shipping power hungry hot messes for the last 10 years).
If the M[1-3] end up being the models where Linux finally gains stable support for reasonable laptop hardware, then so be it.
There are companies that buy and build hardware that supports Linux, and sell it to you with support. Why not just buy from them?
Of course, it lacked Linux support on launch, but that's why the Asahi project is so great. It's providing that missing component of system integration.
Framework, System76, etc. are producing some cool laptops, and I'd consider them if I were looking to buy a new laptop today - but I'm not. I have an M1 Pro MBP in my hands right now, and I have no need to upgrade it any time soon.
nearly every major distribution does this to some degree and has had for years and years; whether or not you're happy with that level of 'polish' is another thing, though.
I suspect that the laptop market is far too fragmented to make this worthwhile
They make for cheap pickups on the secondhand market too. And Dell already does a bunch of testing/fixing for free as they ship them with Ubuntu.
Top 6 vendors by number of units shipped, 2022
1 Lenovo 24.1%
2 HP 19.4%
3 Dell 17.5%
4 Apple 9.8%
5 Asus 7.2%
6 Acer 6.5%
Others 15.5%
https://en.wikipedia.org/wiki/Market_share_of_personal_compu...So who is going to do all that work?
I bought a laptop that has RGB LEDs in the keyboard. I didn't particularly mind not having control over them on Linux but the problem was they defaulted to the brightest purest blue color imaginable. Booting Windows just to run the shitty manufacturer's software was unsustainable so I reverse engineered it and made a Linux user space driver with libusb.
That took a significant amount of time and effort. Just a bunch of LEDs, it seemed like a simple task. I actually had to record the USB messages with wireshark and then figure out what they meant, correlating the bits sent with my physical inputs. Hundreds of LEDs.
I simply can't fathom what it would take to apply polish like speaker safety to my own laptop. I honestly didn't even know there was a safety risk involved before I read this thread. Do these Linux distributions really have so much money in the bank that users can expect them to buy hardware to test stuff like this on? It's hard enough to ship software that works at all.
You can start that if you want to!
And you don't need a recording studio to enable it on more hardware. marcan did the measurements for the MacBooks with a cheap measurement mic.
So you can have great audio on any hardware by just doing the measurements and including them in the asahi-audio package, _in upstream fedora_.
Source: marcan on mastodon[1]
[1]: https://social.treehouse.systems/@marcan/111398502380681345
EDIT: Also, about recording IRS: both the mic and the room environment impact the response data. Using cheap mic in your room does introduce distortion.
However, I realized I was kinda making an assumption that IRS was being recorded for effects. If you're just flattening the response curve, they should work mostly fine. This can become an issue if it's used for effects (e.g. mimicking 2ch Dolby Atmos) because the distortion can be amplified by the environment.
Also, in the long term, using a standardized setup helps with maintaining the quality of IRS. You really want to be able to reproduce the setup, so that you can further improve the data. It's better than subjectively keep fiddling with EQ sliders.