[HN Gopher] GPD Pocket 4 Speaker DSP: Configuring PipeWire so la...
       ___________________________________________________________________
        
       GPD Pocket 4 Speaker DSP: Configuring PipeWire so laptop speakers
       sound better
        
       Author : zdw
       Score  : 251 points
       Date   : 2025-04-09 18:07 UTC (1 days ago)
        
 (HTM) web link (kittenlabs.de)
 (TXT) w3m dump (kittenlabs.de)
        
       | thrtythreeforty wrote:
       | 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.
        
         | cycomanic wrote:
         | 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?
        
           | colanderman wrote:
           | Presumably GP is suggesting IIR filters?
        
           | manawyrm wrote:
           | 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...
        
         | Retr0id wrote:
         | > Convolution is useful when you don't know the underlying
         | filter transfer function
         | 
         | But we don't?
        
         | smj-edison wrote:
         | Perhaps it's simpler to configure with a single impulse
         | response vs multiple filters?
        
         | gmueckl wrote:
         | 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.
        
         | Sesse__ wrote:
         | 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).
        
           | thrtythreeforty wrote:
           | 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__ wrote:
             | Well, immediately after that, they say they inverted the
             | entire curve (through a naive 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 wrote:
               | 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. :)
        
               | thrtythreeforty wrote:
               | Now I understand, makes sense!
        
           | patrakov wrote:
           | 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.
        
       | causality0 wrote:
       | FxSound made a huge difference in changing my GPD Win Max 2's
       | speakers from unusably bad to average.
        
       | rzzzt wrote:
       | 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 wrote:
         | A lot of fun to be had with black hole + guitar rig.
        
       | ahub wrote:
       | 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 ?
        
         | BizarroLand wrote:
         | 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 wrote:
           | _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...
        
         | dylan604 wrote:
         | 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 wrote:
           | Original sounds like one of the speakers wired in reverse
           | inverting phase.
        
             | dylan604 wrote:
             | 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 wrote:
               | I mean.. you can just flip the phrase of one channel. Of
               | course it can be fixed in software.
        
       | MrBuddyCasino wrote:
       | I wonder what the latency is. FIR needs quite some time in the
       | lower frequencies.
        
       | smj-edison wrote:
       | 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
        
         | cassepipe wrote:
         | Would you share the profiles you used for your framework ? I
         | have one too and it could use a better sound
        
           | blutack wrote:
           | If it's a 13, there's a couple linked from here: https://wiki
           | .archlinux.org/title/Framework_Laptop_13_(AMD_Ry...
           | 
           | I use the "cab404" one and very impressed with it.
        
           | smj-edison wrote:
           | Here's the one I created, but be sure to try the others like
           | @blutack mentioned: https://gist.github.com/smj-
           | edison/280c7b293f727b40c29ffef3d...
           | 
           | EDIT: and full easy effects profile:
           | https://gist.github.com/smj-
           | edison/915c3a72bf485bd8910125b68...
        
         | tuukkah wrote:
         | Do you have the version 1 (original) or the version 2 (80 dB)
         | of the Framework speakers?
        
           | smj-edison wrote:
           | Version 1 (I got a framework 12 and so far have only swapped
           | the screen). Now that I think of it, which one is the
           | official EQ for?
        
             | tuukkah wrote:
             | I was thinking of the same but perhaps it's for both. I saw
             | an explanation that the EQ compensates for the biases
             | caused by the laptop chassis.
        
         | ahartmetz wrote:
         | Work on PipeWire started AFAIU as a simpler plugin API for
         | GStreamer, so of course many things are pluggable and
         | interposable and routable etc.
        
         | sintax wrote:
         | Followed an article in one of the wiki links to tune a laptop,
         | result was quite the improvement: https://jontes.page/misc-
         | static/enhancing-notebook-speakers
        
       | dizhn wrote:
       | 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_ wrote:
         | If your headphone has already been measured, https://autoeq.app
         | is your friend.
        
           | jorvi wrote:
           | 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.
        
       | Glyptodon wrote:
       | 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 wrote:
         | If it's a PC, you can just do it at the wires. Much easier than
         | software.
        
           | Glyptodon wrote:
           | If only. I'm stuck with current wiring/display unless I want
           | to rewire stuff and my audio out is through display port.
        
         | nicman23 wrote:
         | easyeffects has a filter just for that and you select RL
        
           | Glyptodon wrote:
           | That filter wasn't included with the default package I tried.
           | Maybe I used the wrong package manager, TBD when I have time.
        
       | rasz wrote:
       | 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 wrote:
         | 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 wrote:
           | 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 wrote:
             | 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 wrote:
         | Or get some neutral headphones like Sennheiser HD600 and do
         | away with EQ.
        
       | unit149 wrote:
       | 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.
        
       | abdullahkhalids wrote:
       | Can you similarly process the laptop microphone input so it
       | sounds better?
        
         | lxgr wrote:
         | Different idea, but a lot of DSP magic happens there too:
         | https://news.ycombinator.com/item?id=43461701
        
       | trelane wrote:
       | I wonder if this is part of what System76 does with their
       | computers
        
       | Humbly8967 wrote:
       | 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
        
       | a1o wrote:
       | 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 wrote:
         | 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.
        
       | OJFord wrote:
       | 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?
        
         | mycall wrote:
         | Perhaps there are other approaches to obtain similar results
         | such as using Dolby Atmos?
        
         | manawyrm wrote:
         | > 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 wrote:
       | Any input on how to do similar speaker profiling inside Windows
       | 11?
        
       | adamfaliq42 wrote:
       | I'm thorn between GPD P4 and a Macbook Air for a travel laptop.
       | How good is its battery life?
        
         | jakogut wrote:
         | 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 wrote:
         | 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 wrote:
         | Awful, around 3h. It's a nice machine if you need x86 and
         | graphics power.
         | 
         | I'm still keeping my M1 Pro.
        
       | grandrew wrote:
       | 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 wrote:
         | What DSP accelerator does Intel have?
        
           | pengaru wrote:
           | my guess is Intel provides software windows uses to
           | accelerate common dsp operations with simd/sse etc.
        
       | abdullahkhalids wrote:
       | What are the exact steps to repeat this on my own laptop?
       | 
       | Surely, I don't use the wav files for their laptop for mine.
        
         | manawyrm wrote:
         | Get familiar with REW and then maybe
         | https://www.youtube.com/watch?v=5YcH7j2-L1Y and you should get
         | pretty close results.
        
       | throwaway1482 wrote:
       | Wim Taymans is the man!
        
       | userbinator wrote:
       | 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 wrote:
         | 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 wrote:
         | 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.
        
       | scoot wrote:
       | The title really needs to mention Linux, as this is a solved
       | problem in the OSs used by the majority of people. ( _Including
       | developers_ [0] before anyone comments that this is HN).
       | 
       | [0] https://www.statista.com/statistics/1482210/os-
       | distribution-...
        
       ___________________________________________________________________
       (page generated 2025-04-10 23:01 UTC)