smj-edison 3 days ago

Huh, I didn't realize pipewire had builtin support for this! I've been using a different piece of software called Easy Effects[1] on my framework laptop.

To equalize my laptop, I ended up buying a umik-1, and using REW to calculate all the filter coefficients (you can import REW's filter export right into Easy Effects). It's a subtle difference at first, but it's much cleaner (I also usually have a compressor and loudness effect enabled, as the framework speakers are pretty quiet).

[1] https://github.com/wwmm/easyeffects

userbinator 3 days ago

I couldn't find any mentions of what audio codec it uses in an initial search, but I see "HD Audio" and other sources online say it's a Realtek, so this seems to be a standard Intel HD Audio codec. What's lesser-known is that most if not all of them have a built-in EQ function which can be used to accomplish this (and perhaps the original vendor's Windows drivers already do), but it's not well-documented. Linux has some code for that too (search for EQ in here):

https://raw.githubusercontent.com/torvalds/linux/master/soun...

  • manawyrm 3 days ago

    It's an AMD platform, so it's the native AMD HD Audio Controller (17h/19h/1ah), with a Realtek ALC245 codec behind it. I have no idea what other hardware is involved, presumably an external Class-D amplifier IC (but I don't know as there doesn't seem to be a datasheet for the ALC245 available).

  • v-yadli 3 days ago

    Note, this is not all about EQ. A lot of other techniques are also used, e.g. limiter, exciter (to shift the energy from mid to low), and some psychological tricks to make you believe it's making a fat bass sound, etc.

ahub 3 days ago

Ho wow, the sample video shows incredible results, I'd love to read more about how to configure it with my own laptop and microphone. Settings ought to be different for each laptop model, right ?

  • dylan604 3 days ago

    Watching the video when they switch profiles??? sounds like when you're watching a movie and they make the music sound like coming from something in the scene and then switch to just music for the movie like showing someone with headphones/earbuds.

    Pretty impressive demo.

    • rasz 3 days ago

      Original sounds like one of the speakers wired in reverse inverting phase.

      • dylan604 3 days ago

        The fact that a hardware wiring issue can be fixed with a software update is cool. Also reminds me just how much software in pretty much all hardware design has to fix bad hardware.

        • thrdbndndn 3 days ago

          I mean.. you can just flip the phrase of one channel. Of course it can be fixed in software.

          • dylan604 2 days ago

            It would be much better if you flipped the phase of the one channel. If your going to be such a know it all on the internet, you might want to at least get the facts straight.

  • BizarroLand 3 days ago

    I would also like to know this. I have a Lenovo Legion and the sound quality is dramatically worse on Linux vs Windows. A fix would be a godsend.

    • userbinator 3 days ago

      the sound quality is dramatically worse on Linux vs Windows

      Windows drivers (Realtek?) likely load EQ coefficients into the codec, while the Linux one doesn't.

      There are some tools and info here on how to get the coefficients you need (it's Hackintosh-oriented, but the basic principles apply):

      https://github.com/acidanthera/AppleALC/wiki/Dumping-process...

Humbly8967 3 days ago

FYI, when attempting to apply this to speakers, the anechoic frequency response is required. If you try to equalize for flat-in-room response, the results are terrible. See this video[1] for loads more information and context.

[1] https://www.youtube.com/watch?v=zrpUDuUtxPM

rzzzt 3 days ago

On an old MBP I have a similar setup with these two tools:

- https://ju-x.com/hostingau.html

- https://existential.audio/blackhole/

Default output for applications is set to BlackHole's virtual sound device which the "Ext-In / Track D" channel can pick up in Hosting AU as an input. An "AUDynamicsProcessor" and "AUGraphicEQ" stage later (both built-in macOS units) it is sent back to the real output device.

  • c-hendricks 3 days ago

    A lot of fun to be had with black hole + guitar rig.

thrtythreeforty 3 days ago

Impulse response is sort of overkill here. If you design a filter bank in the first place, you can just implement that filter bank much cheaper than doing even an FFT-based convolution. Convolution is useful when you don't know the underlying filter transfer function.

  • Sesse__ 3 days ago

    It really depends on what your filter bank looks like. If it's a 4-band parametric EQ, then sure, you can have four biquad IIR filters and that's it. But if you've measured an impulse response and want its inverse (e.g. through a Wiener filter), that's not what you have; you simply have another impulse response (effectively closer to a N-band graphical EQ where N >= 100), not a parametric EQ.

    As a nitpick: You always know the filter transfer function, it's the DFT of the impulse response (and without the impulse response, you obviously cannot convolve).

    • patrakov 3 days ago

      There are a few procedures that convert an impulse response to an approximating IIR filter:

      1. Hartmut Brandenstein and Rolf Unbehauen, "Weighted Least-Squares Approximation of FIR by IIR Digital Filters", IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 49, NO. 3, MARCH 2001

      2. Hon Keung Kwan and Aimin Jiang, "Recent Advances in FIR Approximation by IIR Digital Filters", 2006 International Conference on Communications, Circuits and Systems

      3. Ngai Wong and Chi-Un Lei, "FIR Filter Approximation by IIR Filters Based on Discrete-Time Vector Fitting", 2007 IEEE International Symposium on Circuits and Systems (ISCAS)

      The third one is approachable by anyone who has studied linear algebra at the level usually taught for physics students and knows NumPy. No special DSP course is required. My implementation takes approximately 200 lines of Python code.

      The article contains a deterministic algorithm that takes a guess on the pole positions in the complex plane and returns a better guess. The idea is to start with a random guess with the correct symmetry and apply the algorithm iteratively.

      The only two tricks to be aware of are: 1) their reformulation of everything in section III.B in terms of real numbers (instead of complex numbers) is not making anything simpler and should be ignored, and 2) explicitly symmetrize matrices that are supposed to be symmetrical, it order to avoid accumulation of numerical errors.

      Still, it is not something that I would be willing to fully automate: for good results, one has to add a small delay or chop off a few initial near-zero samples, and guessing the delay correctly is what separates an easy-to-approximate filter from a bad one.

    • thrtythreeforty 3 days ago

      Agreed - I read this bit in the article:

      > generating a filter curve for a 300Hz slope, both channels were divided (A/B) against that curve

      as defining a parametric EQ band. If you just generally want to invert a measured impulse response, then yeah, you don't know the underlying transfer function.

      • Sesse__ 3 days ago

        Well, immediately after that, they say they inverted the entire curve (through a naïve 1/|X| and then un-FFT, presumably) and saved it as an impulse response. I think the 300Hz slope is to _keep_ the rolloff in that area, so that the system doesn't try to boost bass by 40 dB and just end up clipping madly.

        Since these operations sort-of commute, it is easier to understand if you invert the order of operations:

        1. Invert the spectrum (ideally through something less sensitive to noise than what's done here). Now you have an impulse response that will, in theory, give you a perfectly flat frequency response.

        2. Apply a 300 Hz slope. Now you gave up some of that flatness, but you have something that's physically realizable without murdering your speakers.

        • manawyrm 3 days ago

          Exactly correct, that was my thought process while doing it. I tried it without that 300 Hz slope first of course, but that did try to murder my speakers. :)

  • Retr0id 3 days ago

    > Convolution is useful when you don't know the underlying filter transfer function

    But we don't?

  • cycomanic 3 days ago

    I'm not sure I understand. How would you apply your FIR filter? Are you suggesting there is a different way than to either do convolution in the time domain or a multiplication in the frequency domain?

    • manawyrm 3 days ago

      REW can generate a set of peaking/shelf equalizer filters, but why would I want to do that instead of just applying the inverse impulse response instead? It's just more work for a less perfect solution/result...

    • colanderman 3 days ago

      Presumably GP is suggesting IIR filters?

  • gmueckl 3 days ago

    This depends entirely on the length of the impulse response, doesn't it? A very short time domain convolution isn't actually more computationally expensive than a bank of crossover filters.

  • smj-edison 3 days ago

    Perhaps it's simpler to configure with a single impulse response vs multiple filters?

Glyptodon 3 days ago

What kills me is that I'm going to have to learn half of the skills to do this sort of thing just to reverse one PC's stereo channels. (Though in all fairness maybe it only seems complicated because this is my first contact with Suse/Tumbleweed.)

  • snvzz 3 days ago

    If it's a PC, you can just do it at the wires. Much easier than software.

    • Glyptodon 3 days ago

      If only. I'm stuck with current wiring/display unless I want to rewire stuff and my audio out is through display port.

  • nicman23 3 days ago

    easyeffects has a filter just for that and you select RL

    • Glyptodon 2 days ago

      That filter wasn't included with the default package I tried. Maybe I used the wrong package manager, TBD when I have time.

      • Glyptodon 33 minutes ago

        Edit: I switched the machine to Manjaro from Tumbleweed (for several reasons) and it was easy to do w/ Easy Effects at that point.

  • zveyaeyv3sfye 3 days ago

    [flagged]

    • worthless-trash 3 days ago

      We know mate, we know.. its time for your nap.

      • lupusreal 2 days ago

        He's not wrong though. LLMs can significant reduce the chore of fixing odd linux desktop shit.

rasz 3 days ago

Under windows https://sourceforge.net/projects/equalizerapo/

>Equalizer APO can be used in conjunction with Room EQ Wizard (http://www.roomeqwizard.com/), because it can read its filter text file format.

  • out-of-ideas 3 days ago

    i highly recommend https://github.com/jaakkopasanen/AutoEq for headsets - though i have not added any of these to pipewire as it seems others have done [i still prefer foobar2000 with APO + Peace + AutoEq]

    • rasz 3 days ago

      Nice. Tried with Koss headphones and despite 3 entries (with custom earpads? audiophools are insane) for my model it all sounded the same to my ear when flipping EQ in player. I thought it was broken until I found Advanced and switched Target to Flat - instant difference for the worse :) Same when selecting wrong headphones resulting in bad sound with EQ enabled. Either Im deaf or my super cheap Koss KSC75 dont need additional processing to sound good.

      • out-of-ideas 3 days ago

        and trying with cd quality audio? from my recollection (using a bose qc 25 in passive mode) from my first setup it changed it a little but i cannot describe it nowadays, i concluded the difference was "better" and kept it for (too?) many years now. funny thing i do remember was adding AutoEQ in twice - once through APO and once through Peace. but i notice it now more when im not listening via my headset, its subtle.

        sounds like a win though on the Koss KSC75 regardless though, just makes em more portable to other devices for you

  • snvzz 3 days ago

    Or get some neutral headphones like Sennheiser HD600 and do away with EQ.

grandrew 3 days ago

I've been in this endeavor with Surface Book 2. While the results where good, the CPU usage for software DSP killed the entire effort. Microsoft is using intel's DSP accelerator to do this. While linux technically can use intel's audio DSP I never had enough time to dig into it

  • Blackthorn 3 days ago

    What DSP accelerator does Intel have?

    • pengaru 2 days ago

      my guess is Intel provides software windows uses to accelerate common dsp operations with simd/sse etc.

dizhn 3 days ago

One can do similar things with JamesDSP on Android. I believe there are ways to do it without root nowadays. Also you'd be able to find flattening eq curves for your headphone on GitHub and other places. I'll find the link if anybody is interested. This fixes artificially bass heavy headphones pretty well.

  • dsr_ 3 days ago

    If your headphone has already been measured, https://autoeq.app is your friend.

    • jorvi 3 days ago

      Thank you for mentioning AutoEQ, I didn't know about it and it looks like a great resource :)

      I wonder why laptops don't come with an internal speaker DSP profile loaded onto the EEPROM. This seems like one of those things that you really just want to do in firmware.

      IEMs and headphones come EQed out of the factory AFAIK, but apparently quite poorly. I ran the autoEQ profile on my Moondrop Aria beater IEMs and it both cut through the muddiness and opened up the soundstage quite dramatically.

OJFord 3 days ago

What a rollercoaster, not having heard of the GPD Pocket 4 before now, I went through:

- cool!

- oh but there's no way this isn't hard and somewhat manual, something to tune

- wait what, end of blog, that's it, just install a package?

- oh no this is the Asahi announcement, so it's Mac only? [follows link to GitHub]

- no! This is separate, it really is just install a package!

- oh, hang on, GPD Pocket 4 is the laptop shown in image, it's for that only

No slight against the author, nothing wrong with that, just a rollercoaster to follow!

Is there any technical reason it couldn't be generic though? Surely environment has almost as much impact as the hardware anyway, wouldn't you ideally have it sample and adjust every so often on a systemd timer or whatever?

  • manawyrm 3 days ago

    > Is there any technical reason it couldn't be generic though? It includes 2 .wav files containing a measured, real-life calibration data for this specific laptop.

    If you measure your own device (and it's frequency/impulse response) and replace those .wav files with that -- you're good to go! There's just no universal format/place to put such calibration yet, which is why I published a custom package (incl. the filter config).

    I'm kinda hoping more people generate such files for their laptops and share them, maybe we can build a collection of such profiles for many laptops :)

  • mycall 3 days ago

    Perhaps there are other approaches to obtain similar results such as using Dolby Atmos?

a1o 3 days ago

Great to see people using GPD Pocket, it is a nifty little laptop, I am impressed with each new version of it. There are few options for very small and portable devices that have a keyboard, and I find it pretty cool.

  • mycall 3 days ago

    One nice thing about the P4 with the 64GB RAM (HX 370 quad-channel) version, which they stopped producing lately, is using an 32B LLM at 5 watts -- little slow but works offline nicely.

MrBuddyCasino 3 days ago

I wonder what the latency is. FIR needs quite some time in the lower frequencies.

adamfaliq42 3 days ago

I'm thorn between GPD P4 and a Macbook Air for a travel laptop. How good is its battery life?

  • jakogut 3 days ago

    It depends on what you're doing, but the SoC is relatively powerful for it's size, and the battery is relatively undersized compared to the chip. Anywhere from 2-6 hours depending on what you're doing, generally.

    I manage to get decent battery life, somewhere around four hours in general usage (not gaming or compiling) with TLP and disabling boost on battery, along with a few other small tweaks.

  • roywashere 3 days ago

    The Air is going to be a very different product because it is produced in much higher volume. And it will have many more engineering hours spent on it to make things ‘smooth’, including having the speakers sound OK by applying DSP as this post discusses. The GPD will be much more hackable but have worse performance as a trade off

  • manawyrm 3 days ago

    Awful, around 3h. It's a nice machine if you need x86 and graphics power.

    I'm still keeping my M1 Pro.

causality0 3 days ago

FxSound made a huge difference in changing my GPD Win Max 2's speakers from unusably bad to average.

mycall 3 days ago

Any input on how to do similar speaker profiling inside Windows 11?

trelane 3 days ago

I wonder if this is part of what System76 does with their computers

unit149 3 days ago

MBV recorded Loveless w/ two tube amps, face to face to mimic Spector's wall of sound. No effect or pedals. When recording BT over DAW, like in Reverb,.wav/REW audio delay files correct external post-installation drivers.