9 ms·
I wonder how they model the energy output of the speakers. In principle you could have a function that calculates the energy of the spectrum and integrate that
by captainmuon 4y ago
I wonder how they model the energy output of the speakers. In principle you could have a function that calculates the energy of the spectrum and integrate that over time. If you put out too much energy, what do you do? Reduce the overall volume, apply a frequency cutoff, or a low-pass-filter? I feel there are so many variables here, and it is going to be hard to replicate what Apple does.
I know the Asahi-Linux people are very correct, but I'd be tempted to just throw the Apple libraries into Ghidra and see what they do.
And a completely unreleated thought, maybe it is possible to remove the safetly limits on speakers of other brands and apply the same strategy to get better sound?
- bottled_poe 4y agoThat’s a really interesting topic. I hope an audiophile shows up to give some thoughts..
- dsr_ 4y agoAn audiophile opinion: there are so many good cheap systems out there, why would you mistreat poor hardware this way? - Any number of excellent in-ear monitors under $100 - Truthear Zero ($50) - Quite a few good-to-excellent headphones under $200, and under $50 if you can run a convolver equalizer for them - Superlux 668B ($35) - Several excellent powered monitor speakers regularly on sale under $450/pair (JBL 305, 308, Kali LP8v2) Laptop speakers are for getting your attention from across the room so you can plug in something appropriate.
- izacus 4y agoMaybe we just don't want to constantly wear crap on our head?
- toastal 4y agoCounterpoint: your neighbors don't want to hear the crap on your laptop speakers
- fsociety 4y agoI’m confused - are you suggesting that people use headphones instead of small laptop speakers to not annoy their next door neighbors?
- lukas099 4y agoThey probably mean 'neighbors' as in people nearby in the same room. This is indeed a good use case for headphones/IEMs.
- toastal 4y agoBoth. A lot of folks live in apartments, condos, dorms where the walls aren't good at sound insulation. Putting in your IEMs gives you better sound and isnot going to disturb anyone.
- dsr_ 4y agoI live in a house with many rooms, and other people I am related to. If I want to listen to music or have a conversation, my selection of audio device is dependent on the time of my day and my consideration for other people, as well as the desired quality level. I have a proper home theater system, but I wouldn't use it while my wife is taking a nap. I have a nice stereo setup in the living room, but I wouldn't use that while people are talking in the kitchen unless I just wanted some background music. And I have both IEMs and over-the-ear headphones because wearing either for too long can make my ears unhappy, but in different ways.
- dgacmu 4y agoIt's often said that the best camera is the one you have with you.
- ziftface 4y agoTo be honest I'm not sure what the parent comment was expecting, this is kind of a normal audiophile response. But it shows that the engineering that apple does with their speakers is not made for audiophiles, it wows people who are used to other laptops.
- JohnBooty 4y ago> And a completely unreleated thought, maybe it is > possible to remove the safetly limits on speakers > of other brands and apply the same strategy to get > better sound? That’s a really interesting topic. I hope an audiophile shows up to give some thoughts.. Probably want an audio engineer instead of an audiophile hobbyist, for a more proper and informed opinion. =) However, as an audiophile hobbyist, getting good sound from bad hardware (or excellent sound from good hardware) via DSP is definitely a thing! In fact, it's essentially the reason why anything sounds any good at all these days, and why things like tiny laptop speakers and tiny portable Bluetooth speakers can sound halfway decent. Even inexpensive factory car audio can sound great these days, because you can throw a cheap DSP chip in front of not-very-special speakers. I would suspect that many laptop manufacturers are doing some hardware/firmware/software magic already, in order to get decent sound from their hardware. Hobbyists can do this as well. You can buy e.g. cheap speakers, measure their output with a microphone, and create a DSP profile to fix much of what they're doing wrong. The underlying principle here is that "good" sound is absolutely measurable, and it essentially is nothing more low-distortion playback that is tonally correct. The results can sound excellent. Here's an example of the process: http://noaudiophile.com/Micca_Club_3/ http://noaudiophile.com/Micca_Club_3/ However, there are some physical limitations to this. Much of the sound we hear is reflected, not direct, and therefore part of a speaker sounding "good" is that it is emitting "correct" sound in a wide enough angle. If a speaker is shooting correct sound directly at you, but various and incorrect sound off at various angles, the result will not sound great because what actually reaches your ears is going to be a mixture of good (the direct sound) and bad (the indirect, reflected) sound. If a speaker is bad at this, that is not something that can really be fixed by DSP, so you need to get some elements of the physical design correct in the first place. The software power management aspects of Apple's secret sauce ("you can dump more than max power into the speakers for x milliseconds, but after that, back off") are also beyond the limits of simple DSP solutions. There would presumably need to be some kind of stateful solution there like Asahi is doing. There are also other things that Apple does in hardware. Their 16-inch laptops actually have six drivers. Two tweeters, and two pairs of dual-opposed woofers. Dual-opposed woofers give you twice the sound pressure and drastically reduce distortion caused via vibration. This of course takes more room, more hardware engineering, more expense, and isn't something we can software our way around. You actually don't see this in commercial subwoofers until you get up around the $2000 price level, though you could also build one yourself for much less if you don't mind DIY work. https://us.kef.com/products/kf92-subwoofer https://us.kef.com/products/kf92-subwoofer
- jdiez17 4y ago> I'd be tempted to just throw the Apple libraries into Ghidra and see what they do The Asahi people usually reverse engineer things like the audio system by running macOS under the m1n1 hypervisor, which lets you inspect interactions with the hardware using a Python API
- zamnos 4y agoThe other question is how much is done in software vs hardware? I can imagine an opamp doing the integration to kick in a volume reduction to avoid damaging the speakers when there's been too much power pushed, and Ghidra could never show you that.
- pjc50 4y agoIt does appear it's done in software, this post is talking about the Free reimplementation: https://github.com/chadmed/speakersafetyd/blob/main/src/types.rs https://github.com/chadmed/speakersafetyd/blob/main/src/type... (Nobody does maths with opamps any more, it's less area and lower power to ADC the signals you want and do it in digital. It's also much easier to tune)
- povik 4y agoHi, I wrote the Linux kernel drivers for speaker output on the new ARM64 Macs, so I can shed some light on this. > I wonder how they model the energy output of the speakers. Simple. The speaker codecs (special made for Apple, but e.g. compatible to https://www.ti.com/product/TAS2764 https://www.ti.com/product/TAS2764) give you current/voltage measurements you can calculate the power from. It's what they call I/V sense. > In principle you could have a function that calculates the energy of the spectrum and integrate that over time. Right. You don't want to do the calculation in frequency domain since that would be wasteful. You can integrate the power of the samples straight away (here by multiplying the instantaneous voltage and current, if we didn't have that, we could at least estimate it by assuming a constant resistance of the speaker coils). > If you put out too much energy, what do you do? Reduce the overall volume, apply a frequency cutoff, or a low-pass-filter? You model the coil's temperature. If it comes near a dangerous level, you reduce the volume on the particular speaker. You don't need to worry too much about this since usually you don't hit the limits, you are merely guarding against especially nasty sound input. > I feel there are so many variables here, and it is going to be hard to replicate what Apple does. We don't need to replicate what Apple does. Though we are stealing the parameters for the coil temperature model Apple is using (at least for some machines).
- captainmuon 4y agoThanks for the answer! You guys are doing great work with the Linux port.
- hgsgm 4y agoYou can run some empirical tests to find a safe limit.