Skip to content

Commit 7bc17ce

Browse files
authored
Add files via upload
* Added a note for adjusting the cut-off for your devices
1 parent c044a5d commit 7bc17ce

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
## A Magisk module resampling for cheapies
22

3-
This module has been developed for casual users to overide re-sampling parameters of AudioFlinger (the system-wide mixer) in my other modules (["Audio misc. settings"](https://github.com/Magisk-Modules-Alt-Repo/audio-misc-settings) and ["Hifi Maximizer"](https://github.com/yzyhk904/hifi-maximizer-mod)) so as to significantly improve audio quality of LDAC Bluetooth earphones and DAC's under $30 (probably) especially when replaying 44.1 kHz tracks up-sampled over or equal to 96 kHz & 24 bits by AudioFlinger, but also the quality of internal speakers and a 3.5 mm jack receiving 48 kHz & 24 bits audio data (except 48 kHz & 16 bits) up-sampled by AudioFlinger. If you are an audiophile expert, please use "extras/change-resampling-quality.sh" in ["USB SampleRate Changer"](https://github.com/yzyhk904/USB_SampleRate_Changer) which can change the parameters on the fly flexibly.
3+
This module has been developed for casual users to overide re-sampling parameters of AudioFlinger (the system-wide mixer) in my other modules (["Audio misc. settings"](https://github.com/Magisk-Modules-Alt-Repo/audio-misc-settings) and ["Hifi Maximizer"](https://github.com/yzyhk904/hifi-maximizer-mod)) so as to significantly improve audio quality of LDAC Bluetooth earphones and DAC's under $30 (probably) especially when replaying 44.1 kHz tracks up-sampled over or equal to 96 kHz & 24 or 32 bits by AudioFlinger, but also the quality of internal speakers and a 3.5 mm jack receiving 48 kHz & 24 or 32 bits audio data (except 48 kHz & 16 bits) up-sampled by AudioFlinger. If you are an audiophile expert, please use "extras/change-resampling-quality.sh" in ["USB SampleRate Changer"](https://github.com/yzyhk904/USB_SampleRate_Changer) which can change the parameters on the fly flexibly.
44

5-
And its effect is accomplished almost without pre-echo, ringing (post-echo) and aliasing noise by very long filter length re-sampling near ideally cutting off a frequency zone from just above 20 kHz filled with ultrasonic noise generated by high frequency dithering and deteriorating audible sound by intermodulation significantly amplified by large amplification non-linearity of LDAC Bluetooth earphones and DAC's under $30. Furthermore this can be considered to be a kind of decimation filtering from 44.1 kHz & 16 bits samples to 40 kHz & 24 or 32 bits ones except the ultrasonic noise by hight frequency dithering. So it has little effect when using AAC and SBC codecs which transmit audio data by 44.1 kHz & 16 bits.
5+
By the way, although most people might wonder how this module improve the audio quality of such devices, it is accomplished by very long filter length re-sampling near ideally (almost without pre-echo, ringing (post-echo) and aliasing noise) cutting off a frequency zone from just above 20 kHz filled with ultrasonic noise generated by high frequency dithering and deteriorating audible sound by intermodulation significantly amplified by large amplification non-linearity of LDAC Bluetooth earphones and DAC's under $30. Furthermore this can be considered to be a kind of decimation filtering from 44.1 kHz & 16 bits samples to 40 kHz & 24 or 32 bits ones except the ultrasonic noise by hight frequency dithering. So it has little effect when using AAC and SBC codecs which transmit audio data by 44.1 kHz & 16 bits.
66

7-
However, as the noise has a merit adding mellowness into audible sound in the case of none cheap DAC's having very small amplification non-linearity, please use this module only when using LDAC Bluetooth earphones and DAC's under $30.
7+
However, as the noise has a merit adding mellowness into audible sound in the case of none cheap DAC's having very small amplification non-linearity, please use this module only when using LDAC Bluetooth earphones (any devices, as far as I know) and DAC's under $30 (typically using DAC chip CX31993, ALC5686, KT0210, etc.).
88

99
Finally, this module is designed to override re-sampling parameters set by my other modules, but can be used by itself only. You can install this module and enjoy its effect whether you are using one of them together or not.
1010

1111

1212
Notes:
13-
* This module doesn't have the effect for Hires. tracks (greater than 44.1 kHz sample rate) which not having large pre-echo and ringing, and high frequency dithering noise, except ultrasonic noise added on purpose for mellowness. Anyhow, if you want to improve the quality of only Hires. tracks on "cheapie" devices, edit "service.sh" script in the installed place or its ZIP archive as described in the script.
14-
* DAC's deteriorate the quality more or less by their internal over-sampling filtering when receiving low sample rate data.
13+
* If you feel your LDAC earphones or "cheapie" DAC wouldn't become to sound good at all, try editting "service.sh" script in the installed place or its ZIP archive so as to replace "94" in it with one of "93" down to "87" for appropriately cutting off ultrasonic noise causing intermodulation.
14+
* This module doesn't have the effect for Hires. tracks (greater than 44.1 kHz sample rate) which not having large pre-echo and ringing, and high frequency dithering noise, except ultrasonic noise added on purpose for mellowness. Anyhow, if you want to improve the quality of only Hires. tracks on "cheapie" devices, edit "service.sh" script in the installed place or its ZIP archive as described in the script.
15+
* LDAC earphones and DAC's deteriorate the quality more or less by their internal over-sampling filtering when receiving low sample rate data.
1516
* Don't forget disabling "A2DP hardware offload" on Snapdragon devices (if you can), because it forces double re-sampling (44.1 kHz to 48 kHz, and 48 kHz to 96 kHz) and it is so much worse that the latter re-sampling guts the former one at all.
1617

1718
<br/>
@@ -32,12 +33,12 @@ Notes:
3233
| 165 | 360 | | 104 | Low performance devices of A12 and later with audio ones having small amp. non-linearity |
3334
| 179 | 408 | | 99 | General purpose on A12 and later for audio devices having small amp. non-linearity |
3435
| Parameters of this module: | - | - | - | - |
35-
| 179 | 520 | 94 | | for LDAC BT earphones and DAC's under $30 both having large amp. non-linearity |
36+
| 179 | 520 | 94, 93, ... , 87 | | for LDAC BT earphones and DAC's under $30 both having large amp. non-linearity |
3637
| External examples: | - | - | - | - |
3738
| 100 | 29 | (91) | 109 | AK4493 (Sharp roll-off N-fold over-sampling) |
3839
| 150 | 42 | (91) | 109 | AK4191EQ (Sharp roll-off N-fold over-sampling) |
39-
| 120 | 35 | (97) | 110 | ESS 9038PRO (Fast roll-off N-fold over-sampling) |
40-
| 50 ~ 118 | 34 | 96 | (398) | ESS 9039PRO (Fast roll-off N-fold over-sampling) |
40+
| 120 | 35 | (97) | 110 | ES9038PRO (Fast roll-off N-fold over-sampling) |
41+
| vary 50 ~ 118 | 34 | 96 | (398) | ES9039PRO (Fast roll-off N-fold over-sampling) |
4142
| 110 | 40 | (96) | 109 | CX43131 (Fast roll-off N-fold over-sampling) |
4243
| 98 | 130 | 98.5 | | MacOS Leopard (guess) |
4344
| 159 | 240 | | 99 | iZotope, No-Alias (guess) |
@@ -53,7 +54,7 @@ Notes:
5354
| Category | Background opaqueness (aliasing noise) | Pre-echo and ringing | Mellowness (intermodulation) | Memo |
5455
| ---: | ---: | ---: | ---: | ---- |
5556
| DAC | light | heavy | heavy | AK4491EQ Sharp roll-off |
56-
| DAC | medium | medium | light | ESS9039PRO Fast roll-off |
57+
| DAC | medium | medium | light | ES9039PRO Fast roll-off |
5758
| Mastering tool | slight | slight | light | iZotope, No Alias (guess) |
5859
| Audio misc. settings | almost none | almost none | light | for general purpose |
5960
| Audio misc. settings | very slight | very slight | medium | for low performance devices |

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Change logs
22

3+
# v1.0.2
4+
* Added a note for adjusting the cut-off for your devices
5+
36
# v1.0.1
47
* Added settings for Hires. tracks commented out in "service.sh" for those who like Hires. tracks even on "cheapie" devices anyhow
58

module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=resampling-for-cheapies
22
name=Resampling for cheapies
3-
version=v1.0.1
4-
versionCode=1001
3+
version=v1.0.2
4+
versionCode=1002
55
author=zyhk
66
description=For avoiding muddy distortion specific to LDAC Bluetooth earphones and DAC's under $30 (probably), this sets special re-sampling at the system-wide mixer.

service.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ function setResamplingParameters()
4949
resetprop --delete ro.audio.resampler.psd.tbwcheat
5050
# End of workaround
5151

52-
resetprop ro.audio.resampler.psd.enable_at_samplerate 44100
5352
resetprop ro.audio.resampler.psd.stopband 179
5453
resetprop ro.audio.resampler.psd.halflength 520
54+
resetprop ro.audio.resampler.psd.enable_at_samplerate 44100
55+
56+
# If you feel your LDAC earphones or "cheapie" DAC wouldn't become to sound good at all,
57+
# try replacing "94" (below) with one of "93" down to "87" for appropriately cutting off ultrasonic noise causing intermodulation
5558
resetprop ro.audio.resampler.psd.cutoff_percent 94
56-
# Uncomment the following lines if you intend to replay only 96 kHz & 24 bits Hires. tracks
57-
# resetprop ro.audio.resampler.psd.enable_at_samplerate 96000
58-
# resetprop ro.audio.resampler.psd.cutoff_percent 44
59+
60+
# Uncomment the following lines if you intend to replay only 96 kHz & 24 bits Hires. tracks
61+
#resetprop ro.audio.resampler.psd.enable_at_samplerate 96000
62+
#resetprop ro.audio.resampler.psd.cutoff_percent 44
5963

6064
reloadAudioserver
6165
}

0 commit comments

Comments
 (0)