Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A better title for this would be "Asahi introduces advanced speaker DSP to Linux" as that is the real significance of this new development.

I imagine it will be incorporated into other distros soon as a result.



Can someone ELI5 why advanced speaker DSP is a huge thing? I read the linked document and couldn't really figure out why this is important and why it differs from what we already have in Linux systems.


Manufacturers can do a lot with DSP to make small speakers sound better. But "advanced" is saying a lot here. Recent speakers in macs and macbooks are over-driven to sound better and louder, with the DSP modeling energy input to the speaker and temperature of the speaker and keeping it within its physical limits. Without this DSP, the speakers not only sound terrible but become physically damaged if you try to use them at more than a very low volume. Any modern smart speaker or smartphone you buy will use similar DSP to sound much better and louder than it ought to, given its size. I think other laptops also do something similar at the hardware level.

Rightly or wrongly, Apple does it in software on the CPU but until now this wasn't replicated in linux. So the Asahi project (which is for macs with M1/2/3 CPUs), has added this feature to linux[1] and is working on adding DSP models for each model of Mx Mac. In Asahi Linux Speakers have been disabled by default on all models until this feature as well as the specific DSP for each model is ready. Now they have reached the point where speakers are enabled for the first model, which is a huge milestone.

[1] I originally wrote "linux kernel" but it is actually done in user space, with interlocks in the kernel to fall back to simple aggressive volume limiting.


So if the DSP model were only slightly off, then it could permanently damage the speakers?


Yup. Directly outputting maximum sound energy (high-frequency high-amplitude) will permanently damage the speakers in just a few seconds.


No because you make the models conservative. In the link marcan mentions they will improve performance over time (presumably partly by making the models less conservative) and are "shipping with a hard volume reduction limit of -7dBFS to catch potential bugs or misbehavior."


If so, how are the speakers over-driven to sound better and louder?

Do they have a very very conservative profile by default?


So speakers have a worst case maximum power and sound profile. That is the bounds that if you never exceed you will be safe. But if you push past those worst case bounds, now you are entering a dynamic system where things like temperature start determining the actual bounds of the hardware and the points where stuff starts causing damage.

Apple provides a system that drives the speakers within those bounds as close to the actual bounds as possible to get the most out of the system that they realistically can.

Asahi is trying to do the same but are choosing a profile that is far more conservative than apple to start with while they get things ironed out. This profile they have is still an improvement over the worst case bounds but it has very sharp/jarring "safeties" that trigger when the system suspects it might be close to damaging the hardware (dropping immediately to a much lower, safe level vs apple's profile which gradually shifts the audio to a safe point without making it obvious that it is doing so).


You could say Asahi Linux was very conservative about this because they disabled speakers altogether until now.

It’s ok to be quite loud for any one peak for a short amount of time (let’s say 50dB for 10ms) but for indefinite time periods much less is ok (let’s say 30dB but these are totally made up numbers). There are also limits to how much energy you can put into the speaker before it overheats. There also may be some frequencies with different limits (this is total speculation on my part). So the DSP models the behavior of the speakers and tweaks the input to prevent them from overheating (in my understanding). Normally you won’t notice this unless you are trying to play a single tone at max volume. Without this advanced DSP, you would have to just limit the output to 30dB which in practice means high volume parts of your audio are clipped or you limit to a very low volume to have enough headroom to play the louder components of your audio. Considering how loud and good modern macbooks, smartphones and smart speakers sound compared to similar sized speakers from even 10 years ago I think the effect is pretty great.


The real answer to this question is yes. There’s a caveat by the devs that their safeguards make bugs unlikely, but a bug here means permanently damaged hardware.


Does Windows have this?

If it does, can we "import" it to linux?


It's not Windows itself, but vendors providing machine specific drivers.


The main reason DSP is a big thing is because Linux has never focused on it - Google has with Android and ChromeOS, as has Apple and Windows, but Linux speaker audio has always paled in comparison: https://social.treehouse.systems/@marcan/111230163766956867

That leaves it up to the laptop vendor to implement hardware to perform DSP (and the quality of this varies tremendously from poor to OK). Apple doesn't use hardware for their speaker DSP (it's all software) and their speakers sound better than anything else out there. Linux now has similar functionality thanks to Asahi, and it will only get better over time.


It's a huge thing because you can't really fit all the big speakers and audio stuff in tiny laptops and make them sound good. So we use extra steps (the DSP for example) to adjust how the speakers and amplifiers are controlled. Doing it this way allows us to have much better sound from tiny micro speakers. This is important because the alternatives are:

  - Bad sound and nothing you can do about it
  - No sound at all
  - Carry external speakers with you all the time

Where in the past it was impossible to both have physically small devices and good sound, technological advances have enabled us to do more with less. So adding that technology means we can now have better sound than in the past.


The way I understand it, the tiny speakers in laptops don't sound great. But since sound perception is somewhat relative, manufacturers use DSP to try to improve the perception of the sound.

Of course, this will never rival an actual "serious" amp and speakers, but it can drastically improve matters. Anecdotally, my HP laptop has a pretty crappy sound under Linux, but under Windows with the Realtek drivers, it sounds OK. The soundcard itself doesn't seem too bad: if I use a pair of nice headphones or plug it into my dedicated stereo, even under Linux I hear no difference compared to using an external DAC connected through USB.


But we could already do DSP with Pulseaudio and Pipewire. I guess is making the speakers DSPs "built in" and tweakable with GUI etc? As well as actually creating the speaker DSP profiles, I guess.

The speakers safety thing seems like a completely new thing, though.

All sounds like an absolute nightmare to anyone even remotely into audio. But I guess tiny speakers are occasionally useful.


In this, our modern world, tiny speakers are what most people listen to most things on, except maybe in their cars.

Phones, laptops, tablets. The tiny speakers built into TVs, much smaller than even built-in speakers on CRT TVs used to be. Ear buds of various sorts, and smallish headphones. That’s most audio-listening accounted for (except in cars).

Hell, I’ve got a good hi-fi setup and (separately) a probably-top-couple-percent 7.2 home theater audio situation (in one room… but not on the other TV) and even so I listen to things on tiny speakers more than on big ones.


> In this, our modern world, tiny speakers are what most people listen to most things on, except maybe in their cars.

Hmm... I think you're probably right, but the one thing that gives me pause is the enormous market for Bluetooth speakers. I see Bluetooth speakers everywhere! I suppose most Bluetooth speakers are still "small" in the grand scheme of things, but they're certainly larger than phone and laptop speakers.

Earbuds are similarly omnipresent. I'm not sure it's accurate to classify those as "tiny speakers"; the physics are different, because they only need to be loud enough to hear when they're next to your ears.


Good bluetooth speakers also use similar DSP to sound way better and louder than they would without it so I am not sure this is a counterpoint. The unique thing here is Apple does it on the main CPU, presumably because "why not", so you couldn't safely power the speakers of your mac while running linux until the related features were added.


At this point even "bigger" speakers make heavy use of DSP, too - from household commodities like Sonos to higher end hi-fi powered speakers like the KEF LSX series, almost everyone in the industry making an active-amplified product has wised up to the idea that some processing can make use of clever acoustic tricks or compensations to make their products sound better (by whatever definition of better their brand sells) than they would being drive flat from the source. When you provide the whole integrated package its a no brainer.


Compensating physical limitations to create a neutral sounds profile is useful regardless of the size of the speaker.

I have a custom-made subwoofer that can hit 12Hz (measured), and creating a DSP profile to compensate for my room + speaker acoustics has significantly improved the listening experience.[1][2]

[1] https://www.hifiberry.com/shop/boards/beocreate-4-channel-am... [2] https://github.com/hifiberry/hifiberry-dsp/blob/master/doc/r...


Is this more than just EQ? I think AVRs do some latency compensation too, although that's probably only a problem in multi-channel set ups.


It's primarily EQ calibrated via a frequency sweep of the room + speaker acoustics.

The hifiberry DSP does primarily three things: - equalization for speaker + room acoustics - customizable crossover frequency for speakers (in my case a 2.1 setup) - loudness equalization across speakers

There may be a latency compensation module, but that's not something I needed in my case.

None of this is rocket science, but audio does sound significantly better after compensation. Specifically, my living room geometry was causing standing waves in the ~200 Hz range, making the low-end sound unpleasantly boomy. The calibrated compensation pretty much eliminated this, without needing to invest in physical sound traps and the like.

This is a fun little project for really not much money. I recommend it to everyone who likes tinkering, all you need is a <$100 measurement mic, REW, and a tiny bit of patience.


If your standing waves mean you only need to attenuate frequencies with EQ then you're very lucky! A standing wave means there will be some parts of the room that are too loud (antinodes) and some that are too quiet (nodes). Bass traps are to eliminate standing waves such that you won't have this variance around the room. The bigger problem is when your sitting position is in a node meaning you will completely lose a bass frequency. You can't EQ that back.

EQing out bass if you sit in an antinode is definitely better than nothing, though.


You're right that you can do DSP everywhere, but if you implement this in user space you give everybody rights to damage the speaker.

It's not only useful for tiny speakers: everything from home audio to big PA installations for concert halls can benefit from DSP optimisations. It's a way to squeeze more sound from the same speakers.


I think it's supposed to be a kind of in-kernel equivalent to Pulseaudio and Pipewire, meant to keep the sound output below the limit where it would risk blowing the speakers. That's a nice idea, and you could even pick a cool name for it, like Advanced Linux Sound Architecture. It could even support things like the hardware mixing channels, filter chains, sample-based synthesizers etc. that some soundcards have, instead of leaving it all to software.


I do use DSP under Linux with easyeffects. I found a preset called "Laptop Unsuck" which works ok-ish, but I can't find the original URL after a quick search. It works OK for my needs, but easyeffects does add some latency, which isn't great for videoconferencing for example.

However, most people will probably not go out of their way to use this, and also, having a DSP tailored to the specific speakers and enclosure is nice. But I agree there should be a way to completely disable this, at least when using the line out jack, be it for headphones or an external audio system.

> But I guess tiny speakers are occasionally useful.

They are to me. My laptop is much easier to carry on planes than my audio system, and I don't always like having headphones on, for example when watching a movie in bed.


> But I agree there should be a way to completely disable this, at least when using the line out jack, be it for headphones or an external audio system.

According to Marcan on mastodon, the DSP is only enabled when you use the internal speakers.


I think the idea with the M-series laptops in particular is that you can drive the speakers at volumes that actually damage them very quickly ( see https://github.com/AsahiLinux/linux/issues/53 ). The idea AIUI is that you can use a DSP along with a physical model of the voice coil to get better sound than you would if the speakers were volume-limited.

I don't know how common this arrangement is in other laptops, but it's the kind of hardware/software integration that Apple is known for.


It is just dynamic range audio compression to simulate loudness. It is not a new thing.


It isn't just dynamic range compression. This is actually driving the speakers beyond their safe limits for sustained output as long as the temperature estimate (a function of the specific speaker's characteristics and the recent history of the signal it's been fed) is safe. "Dynamic range compression" doesn't imply any of that.


Indeed, I didn't think much of the work until it dawned on me the effort needed to accomplish this behind the scenes. Interesting post.



This is more than just EQ.


So is alsa. You can chain as many steps as you want.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: