freemangordon
|
2012-02-04
, 18:55
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#131
|
The Following User Says Thank You to freemangordon For This Useful Post: | ||
|
2012-02-04
, 21:49
|
Posts: 1,101 |
Thanked: 1,184 times |
Joined on Aug 2008
@ Spain
|
#132
|
I see now, you misunderstand me . I was just asking what those two patches do, while I disabled all those from the list in my previous post. Those two will be the first to be enabled once stability is confirmed without the whole bunch.
|
2012-02-05
, 16:25
|
Posts: 1,101 |
Thanked: 1,184 times |
Joined on Aug 2008
@ Spain
|
#133
|
Well, I think I am in position
@Pali, why is that filter needed in Maemo5 kernel, what problem/bug it fixes, or what functionality it adds? Who sent you the patch? Is it upstream patch?
TBH I think you should remove that from kernel-power at least until there is some information WTF is this animal(the filter) doing and who will support it (fix bugs) at least while KP is in devel.
Or even better - remove it constantly.
P.S.
And maybe you should re-consider your policy to accept patches from developers who cannot be contacted/don't want to help if some problem arise, thus leaving only me and you to fix bugs introduced by some random guy.
Well after reading the patch it does look like it could be interesting. I think it implements an IIR filter at the hardware level that is controllable through software. This is an unused hardware feature of the 320aic3x chip. This IIR filter affects the sound coming from the speakers. The part about only supporting 48kHz sample rate also gives me the willies, what are the implications of this?
I think the main beef was that while it was submitted by luke-jr, he has literally no idea what it is or does beyond 'stop n900 speakers from blowing up' (no offense luke-jr, I read your script for getting the nokia binaries for n900 in your gentoo install, it was boss). This in turn aroused suspicion for obvious reasons. It was however written by some other bro in September 2010 who does understand what it is he was creating. I think the original author is still on maemo IRC, he had something to do with chinook version of xchat I think.
|
2012-02-05
, 16:31
|
Posts: 2,153 |
Thanked: 8,462 times |
Joined on May 2010
|
#134
|
|
2012-02-05
, 16:46
|
Posts: 1,101 |
Thanked: 1,184 times |
Joined on Aug 2008
@ Spain
|
#135
|
Which pulseaudio filter? Do you know in which package is filter libraries? I'm asking this becuase some closed pulseaudio packages was opened on meego gitorious repositories.
|
2012-02-05
, 16:58
|
Posts: 2,153 |
Thanked: 8,462 times |
Joined on May 2010
|
#136
|
|
2012-02-05
, 17:05
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#137
|
The Following 3 Users Say Thank You to freemangordon For This Useful Post: | ||
|
2012-02-05
, 17:24
|
|
Posts: 1,310 |
Thanked: 820 times |
Joined on Mar 2006
@ Irving, TX
|
#138
|
Regarding this patch which causes so much paranoia around here I have been studying it today and it is a really nice feature to add, although it actually is not completely correct.
The chip actually has a proper hi-pass filter so no need to use the de-emph filter for this purpose (have a look at the data sheet referenced in the patch). Both hi-pass and de-emph are first order IIR filters.
Actually, as you can see in the attached graphic (ellip), the filter coefficients used are wrong, since the intended cutoff frequency is 0.01 of the Nyquist frequency (that is, 0.01*24000=240Hz) while the real cutoff frequency is half of the intended (that's because he calculated the coefs using an elliptic filter simulation, good for higher order, instead of just Butterworth).
Actually, as it has already been said, speakers protection is implemented in pulseaudio. This is bad for two and a half reasons:
1) pulseaudio eats a lot of cpu
1.5) I hate pulseaudio.
2) mplayer and friends can bypass pulseaudio (actually I bypass pulseaudio in mplayer) and damage the speakers accidentally.
This driver allows to implement all audio filtering in hardware, so 0 cpu usage.
With a little work we can:
1a) Reverse engineer pulseaudio Nokia filters for the different audio output profiles and calculate the coeficients for the IIR filters
1b) Enable a hi-pass filter to protect the speakers, no matter pulseaudio. The cutoff frequency proposed in the patch is around 240 Hz, but if we perform step 1a we can learn what cutoff frequency is Nokia using.
2) Disable filtering in pulseaudio lowering cpu usage by 66% and use some script to load them when the audio profile changes.
To do step 1a, only one question is needed: How to redirect PA output to a file instead of the pcm device? Then feed PA with pure sinusoids in thirds of octave frequencies and calculate the gain, then some algebra for the coefficients.
I'll start by enabling the hi-pass filter with correct coefficients instead of the de-emph filter.
EDIT: I forgot to mention, the right coefficients are 31770, -31770, 30771 instead of 32276, -32276, 31785. Calculated using "iir(1, 'hp', 'butt', [0.01 0], [0 0])" in scilab.
The Following 2 Users Say Thank You to Mara For This Useful Post: | ||
|
2012-02-05
, 17:39
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#139
|
Personally I do not believe you can "blow up the speakers" with the little audio amp N900 has.
Just to make sure the filter is not in the audio path to headphones? I do not want to filter the bass out from headphone port.
The Following User Says Thank You to Estel For This Useful Post: | ||
|
2012-02-05
, 17:47
|
Posts: 1,101 |
Thanked: 1,184 times |
Joined on Aug 2008
@ Spain
|
#140
|
The Following 5 Users Say Thank You to maacruz For This Useful Post: | ||
Tags |
development, kernel-power |
|