├── ImpulseResponseScreenshot.PNG ├── PulseEffects.png ├── README.md ├── ThinkPadP53 ├── DolbyGame.irs ├── DolbyMovie.irs ├── DolbyMusic.irs └── DolbyVoice.irs ├── ThinkPadT14Gen1 ├── DolbyGameBalanced.irs ├── DolbyMovieBalanced.irs ├── DolbyMusicBalanced.irs └── DolbyVoiceBalanced.irs ├── ThinkPadT480 └── DolbyMusicBalanced.irs ├── ThinkPadT495 ├── DolbyGameBalanced.irs ├── DolbyMovieBalanced.irs ├── DolbyMusicBalanced.irs └── DolbyVoiceBalanced.irs ├── ThinkPadX1NanoGen1 ├── DolbyMovieBalanced.irs ├── DolbyMusicBalanced.irs ├── MovieBalanced.PNG └── MusicBalanced.PNG ├── ThinkPadX390 └── Convolver.irs └── impulse48khz-2sec.wav /ImpulseResponseScreenshot.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ImpulseResponseScreenshot.PNG -------------------------------------------------------------------------------- /PulseEffects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/PulseEffects.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux + Thinkpad speaker improvements 2 | 3 | Thinkpads ship by default with Windows, which comes with Dolby Atmos software that improves the sound quality coming from the speakers significantly. This is very noticeable if you turn the Dolby effects on and off while playing music. This software is not available under Linux, which means the sound quality is roughly the same as what you hear with the Dolby effects turned off. The resulting quality can be pretty bad. For example, at high volumes, I can hear significant chassis resonance for certain laptop models while playing music. 4 | 5 | The good news is that there is a way to improve the speaker sound quality. It seems like the Dolby software is doing at least two things to improve speaker quality: 6 | 7 | 1. It applies a convolution on the actual sound directly in the operating system. 8 | 2. It might also be interacting with the speakers differently than Linux. 9 | 10 | The first item is something we can emulate on Linux while the second item is not. Thus the bad news is the sound quality from Windows + Dolby will always be better than Linux, until someone can reverse engineer with Dolby is doing to the speakers post convolution. This guide shows you how to apply the same convolution that Dolby is applying in Linux. 11 | 12 | ## Obtaining the impulse response profile (.irs) files from Windows 13 | 14 | We need to figure out how the filtering is done with Dolby. To do this, we can simply play an impulse audio file, and measure the output audio, which is the impulse response and we can use it in a convolution filter. Step by step: 15 | 16 | 1. Install `Audacity` and `VLC` on Windows. If you don't have Windows, you can 17 | try installing [Windows to go](https://www.pcmag.com/how-to/how-to-run-windows-10-from-a-usb-drive). 18 | 2. Enable all Dolby effects using the Dolby app (`Dolby Audio Premium` at the time of writing this). Convince yourself that it is working by playing some music and turning the Dolby effects on and off. 19 | 3. Open `Audacity`, select `Edit` -> `Preferences` and then select the `Audio Settings` on the left tree. 20 | 4. Under `Interface` -> `Host`, select `Windows WASAPI` 21 | 5. Under `Playback` -> `Device`, select the speakers (`Speaker (Realtek(R) Audio)` for me). 22 | 6. Under `Recording` -> `Device`, select the speakers loopback (`Speaker (Realtek(R) Audio) (loopback)` for me). 23 | 7. Under `Quality`, make sure the `Project Sample Rate` and `Default Sample Rate` is `48000Hz`. 24 | 8. I selected 24-bit for the `Default Sample Format`. 32 bit float might be fine as well. 25 | 9. Click `OK` to save the settings. 26 | 10. Download the impulse WAV file from either [the original source](https://freesound.org/people/unfa/sounds/205620/) or [a mirror of it in this repo](impulse48khz-2sec.wav). 27 | 11. Open the WAV file with VLC. Pause the playback. 28 | 12. Go to `Tools` -> `Preferences` in VLC. On the bottom left, it says `Show settings` and there are two radio boxes, `Simple` and `All`. For me, `Simple` is selected, click `All` to get a more detailed preferences menu. 29 | 13. On the left tree, go to `Audio` -> `Output modules`. 30 | 14. On the right side, the `Audio output module` should be `Windows Multimedia Device output` and the `Media role` should be set to `Video`. I also tried a `Media role` of `Music`, but it made no difference in the impulse response profile on my machine. 31 | 15. Click `Save` to save the settings. 32 | 16. Go back to Audacity, click the Record button (big circle at the top). The recording might be stuck (no waveform shows on screen), which is OK. 33 | 17. Click play in VLC. This should cause the recording to show a waveform in audacity. 34 | 18. Stop the recording in Audacity and stop playback in VLC (if necessary). 35 | 19. Zoom into the peak of the wavform and see something like the following. You have to zoom in quite far. In my screenshot below, that's a range of abouy 4ms. If you see just a single peak without anything else even if you zoomed in very far, you probably did something wrong? 36 | 37 | 38 | 39 | 20. Select the audio clip centered around the maximum of the waveform, as shown in the above screenshot. Then go to `File` -> `Export Selected Audio`. Save the file as a WAV file. 40 | 21. Rename the resulting file's extension from `.wav` to `.irs`. Keep this file around. 41 | 42 | I have sampled some files for various different ThinkPad models. They are in 43 | the directories here. For some models, I have recorded the impulse response for 44 | multiple Dolby profiles. Choose the one you like the best. 45 | 46 | ## EasyEffects for PipeWire using distros 47 | 48 | 1. Install EasyEffects for your distro. For Fedora: `sudo dnf install easyeffects`. 49 | 2. Open EasyEffects. Add Output effect "Convolver". 50 | 3. In Convolver UI panel select "Impulses", import IRS file, then select it in impulse list and press "Load". 51 | 4. Optional: save you output preset, activate EasyEffect service in "Preferences" and then enabled your preset Autoloading in PipeWire panel (top-center). 52 | 53 | ## PulseEffects 54 | 55 | PulseEffects is unmaintained as development has moved to the pipewire based EasyEffects. That said, pulseeffect is widely available in existing distros. For Ubuntu 22.04: 56 | 57 | 0. Ensure no external speakers are plugged in and this is for the internal 58 | speakers only. Start playing some music. 59 | 1. `sudo apt intall pulseeffects` 60 | 2. On the left hand side, activate `Convolver`, on the right panels. There's a 61 | button that looks like a wave form above `Stereo Width`. Click it. 62 | 3. `Import Pulse` and select the desired `.irs` file. Click `Apply`. 63 | 4. On the left panel, use the arrow buttons of the `Limiter` row and move it 64 | below the `Convolver`. Activate that as well. 65 | - Without doing this, the convolution may cause the audio to clip and you 66 | may here artifacts due to that. 67 | 5. We need to setup a preset so this setup can be turned off when headphones 68 | are plugged in. On the top right corner, there's a button to set a preset. 69 | Click on it and a small popup will show with a textbox. Type `Laptop 70 | Speaker` into it. Press the `+` button. Then press the save button (should 71 | be the left-most icon button in the row of 3 buttons). 72 | 6. Press the middle icon button that looks like an refresh button. This will 73 | cause this preset to be loaded when the speakers are used. 74 | 7. Plug headphones in. Create a new preset called `Headphones` with the top 75 | right buttons. Switch to the new preset by clicking `Load` next to it. 76 | 8. Disable both the `Convolver` and `Limiter` filter. 77 | 9. Press save (left icon button) to save to the filter pipeline (which should 78 | have no filters) to the pipeline. 79 | 10. Press the middle icon button to instruct PulseEffects to automatically load 80 | this preset when headphones are plugged in. 81 | 11. Click the hamburger menu at the top right of the screen. Go to `General` 82 | and click `Start Service at Login`. This makes PulseEffects run on boot. 83 | - There might be a problem with this setting. See https://github.com/wwmm/easyeffects/issues/1644. 84 | - I have seen that I have to reload the filters in PulseEffects after a 85 | reboot for them to take effect. 86 | 12. Optionally could set the `Priority Type` to be `Real Time`. 87 | 88 | Your screen should look something like this (note I edited the Output gain of 89 | the Convolver filter, but that's up to you): 90 | 91 | 92 | 93 | You can test the headphone/laptop speaker switching. My observation is that it 94 | takes about 1-3 seconds for PulseEffects to switch between the presets. 95 | 96 | ## Results 97 | 98 | I found that after the `Convolver` + `Limiter`: 99 | 100 | - The sound is still quieter than Windows. Windows is also more clear. 101 | - I suspect maybe the Dolby software is causing the system to interact with the speakers differently, perhaps in a similar manners to [how Macbooks does it](https://news.ycombinator.com/item?id=34935483). 102 | - The chassis resonance I experienced on the ThinkPad X390 is gone. 103 | - Sound quality substantially improved, although Windows + Dolby remains 104 | superior. 105 | - Everything sounds much less tinny. 106 | - Music quality went up slightly to significantly depending on the music. 107 | - Voice quality substantially improved (judged via YouTube videos with 108 | narration). 109 | - Slight increase in latency. No synchronization issues. 110 | - Sometimes when the audio playback starts, the unfiltered sound comes through 111 | for a brief moment before the filters take effect. 112 | 113 | I suspect one should definitely use the impulse response file of the exact same 114 | ThinkPad model, as I've observed vast differences between ThinkPad models (X1 115 | Nano Gen 1 vs X390 is completely different). 116 | 117 | ## Sources 118 | 119 | 1. https://stackoverflow.com/a/53688163 120 | 2. https://github.com/wwmm/easyeffects/issues/2209 121 | 3. https://old.reddit.com/r/thinkpad/comments/q5pt38/x1_extreme_gen_4_dolby_atmos_setup_for_linux/ 122 | 4. https://news.ycombinator.com/item?id=34935483 123 | 5. https://freesound.org/people/unfa/sounds/205620/ 124 | -------------------------------------------------------------------------------- /ThinkPadP53/DolbyGame.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadP53/DolbyGame.irs -------------------------------------------------------------------------------- /ThinkPadP53/DolbyMovie.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadP53/DolbyMovie.irs -------------------------------------------------------------------------------- /ThinkPadP53/DolbyMusic.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadP53/DolbyMusic.irs -------------------------------------------------------------------------------- /ThinkPadP53/DolbyVoice.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadP53/DolbyVoice.irs -------------------------------------------------------------------------------- /ThinkPadT14Gen1/DolbyGameBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT14Gen1/DolbyGameBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT14Gen1/DolbyMovieBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT14Gen1/DolbyMovieBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT14Gen1/DolbyMusicBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT14Gen1/DolbyMusicBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT14Gen1/DolbyVoiceBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT14Gen1/DolbyVoiceBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT480/DolbyMusicBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT480/DolbyMusicBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT495/DolbyGameBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT495/DolbyGameBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT495/DolbyMovieBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT495/DolbyMovieBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT495/DolbyMusicBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT495/DolbyMusicBalanced.irs -------------------------------------------------------------------------------- /ThinkPadT495/DolbyVoiceBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadT495/DolbyVoiceBalanced.irs -------------------------------------------------------------------------------- /ThinkPadX1NanoGen1/DolbyMovieBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadX1NanoGen1/DolbyMovieBalanced.irs -------------------------------------------------------------------------------- /ThinkPadX1NanoGen1/DolbyMusicBalanced.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadX1NanoGen1/DolbyMusicBalanced.irs -------------------------------------------------------------------------------- /ThinkPadX1NanoGen1/MovieBalanced.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadX1NanoGen1/MovieBalanced.PNG -------------------------------------------------------------------------------- /ThinkPadX1NanoGen1/MusicBalanced.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadX1NanoGen1/MusicBalanced.PNG -------------------------------------------------------------------------------- /ThinkPadX390/Convolver.irs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/ThinkPadX390/Convolver.irs -------------------------------------------------------------------------------- /impulse48khz-2sec.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhaowu/linux-thinkpad-speaker-improvements/a28ffb16ac833af28723693d8b794f8ab56cdbf0/impulse48khz-2sec.wav --------------------------------------------------------------------------------