17.02.2015 17:29, David Henningsson wrote: > Changes since v1: > - Fix according to Alexander's comments > - A new patch has been added that removes dead code imported from Chrome OS. > For easier reviewing, I will also send a total of the first three patches. > > Also note that the current routing logic are not optimal, e g, > when on 2.1 speakers, plug headphones in, then unplug headphones again, the > result might be that the stereo profile is selected instead of the expected 2.1 > profile. This is not an error with this patch set but might limit its usefulness. > > David Henningsson (5): > lfe-filter: Import code from the Chrome OS audio server > lfe-filter: Enable LFE filter in the resampler > lfe-filter: Cleanup and refactor > lfe-filter: Add rewind support > resampler: Make some basic functions for rewinding > > Hui Wang (2): > daemon-conf: enable the lfe remixing by default > lfe-filter: change the crossover frequency as a parameter Well, I have tested this quantitatively using a null sink. pacmd load-module module-null-sink rate=44100 channel_map=front-left,front-right,lfe parec --fix-format --fix-rate --fix-channels --file-format=wav --format=s16le --rate=44100 --channels 3 -d null.monitor response.wav & paplay -d null sweep.wav ; killall parec ; wait # where sweep.wav is a mono file containing a sine wave sweep audacity response.wav # look at the waveform Result: the crossover frequency should be at 120 Hz by default, the filter should attenuate the signal by 6 dB at this frequency, and it indeed behaves this way. If I mix the right channel and the LFE channel together, the result corresponds to a flat frequency response. However, I have some doubts about the correct normalization. Let's consider this use case. Someone prefers to use his full 5.1 system when watching DVDs and BluRays, but does not like that PulseAudio uses rear and center speakers for stereo content like CDs. Still, he needs a subwoofer and a software crossover, because the satellite speakers just don't reproduce bass well enough. So he switches manually between 5.1 and 2.1 profiles as needed depending on the content. Now consider a passage on a music CD that contains e.g. some drums in the left channel and nothing on the right. PulseAudio averages the left and right channels, then filters the result, and gives that to the subwoofer. I.e., 50% of the bass from drums get there in this example, and 100% of high-frequency content get to the left speaker. Without the crossover, in the stereo profile, 100% of both bass and non-bass from drums get to the left speaker - and that is definitely balanced in terms of frequency content if the speaker reproduces all frequencies accurately. So, for the example with the LR4 crossover to sound balanced, the subwoofer must be 6 dB more sensitive than the left speaker. The important thing to take back is the 100%/50% ratio of non-bass in the left speaker and bass coming to subwoofer, and the presumably-balanced result. Now consider the same passage on a DVD in the 5.0 arrangement (i.e. there is no LFE channel in the soundtrack). The drums are in the front left channel, and there is nothing in the other channels. PulseAudio upmixes this to 5.1, and the LFE is synthesized as an average of all channels. Thus, it gets 20% of the bass from the drums, while the front-left speaker still gets 100% of non-bass. As these amplitudes are not in the same proportion as in the CD case, the system that sounded balanced previously would not do so now. So this looks like an "average vs sum of channels" question regarding the LFE filter input. Of course, without the filter, we just have to use the average to avoid clipping on typical music material. Alternatively, the answer may be just "don't switch profiles like that". I don't know how hardware 5.1 AV receivers react to this use case, because I don't have one yet (and maybe, depending on the listening tests, will spend money on a really good stereo system instead). I think that the definite answer to this balance paradox will come from measurements of the individual frequency response of each laptop speaker for a laptop with a built-in subwoofer. It would also be interesting to see what Windows does here. -- Alexander E. Patrakov