2013/3/1 Justin Chudgar <justin at justinzane.com>: > As per discussions with FordPrefect. tanuk, theBear, ohsix, etc. on > #pulseaudio. > > This is an initial, working version. Testing and review are most welcome, plus > thoughts on a better lp filter. Disclaimer: I only did the review, without any attempt to compile and test the code. I assume that it is for the situation where some speakers cannot reproduce low frequencies accurately (and, to be precise, start distorting other frequencies when given a signal with low-frequency components). Your patch (besides obvious code-style issues and unused options) has a hard-coded assumption that only the center channel needs to be filtered. Windows rightfully has a preference for this: sometimes all 5 satellites are tin cans that should not be given low-frequency content (because otherwise they will distort other frequencies, too), sometimes only the front and cerner speakers, sometimes only the center. I think that this preference should be exposed somehow, but should stay specific to a sink (i.e.: apply that filter to my onboard card, but not to the USB card). Also, it is important to make sure that the filtering operation adds to the LFE channel the sum of low-frequency signals that were filtered out from the satellites. This is important because of 5.0 content (such as concerts) that does contain low frequencies in all channels, but doesn't provide the LFE channel, and some people want to listen to such content on "5 tin cans + subwoofer" systems. In your patch, the filter is a first-order IIR filter. Are there any considerations why this is chosen? If I were designing this, I'd at least investigate and document why a second-order Butterworth or Bessel filter, or even a FIR-based filter is not usable for extractlng the LFE signal that should be fed to the subwoofer (or is it?). And, because you are filtering the LFE channel, you are inevitably introducing some phase shift, and it might be perceived as something that destroys the coherent sound field created by satellites and the subwoofer. I am not sure whether filtering the LFE channel itself (as opposed to subtracting low-frequency content from all other channels and adding it to LFE) is a good idea at all. If the LFE channel is obtained by decoding a DTS track in software, then there is no way to obtain non-LFE content in the LFE channel, because it is encoded at the 375 or 750 Hz sample rate in the file and pre-filtered during resampling back to 48 kHz. AC3 also has special processing of the LFE values - namely, only a fixed number of exponents is transmitted, thus effectively limiting the bandwidth. I.e., in both cases, it is safe to assume that the LFE channel is already pre-filtered. If you do want to filter it again, please use a filter that has a constant or approximately-constant delay (i.e. Bessel filter or a FIR-based one), and apply the same delay to satellites. Just for your reference, in DTS, both the LFE reconstruction filter (also used for pre-filtering during encoding) and the subband filter used for encoding and decoding signals for satellite speakers have the length of 1024 samples and are specified as FIRs, so no phase delays accumulate during the encode-decode process. -- Alexander E. Patrakov