According to a report on the mailing list, upmixing a stereo stream to 5.1 results in bass being removed from the audio. LFE remixing should move bass to the LFE channel, but reportedly that doesn't happen. I'll mark this as a release blocker. I plan to try to reproduce the bug. If I can't reproduce, the blocker status can be removed, and maybe this bug can be closed too. Here's the original report: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/25574/focus=25705
lfe filtering only add LFE signal it won't touch rear and center channel, it is not up mixing http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=57b5076c30b3453ee843912c0aeb3df8dbee3f68;hp=326c6802e49e5499e16cf141e1cdb0360fce14aa http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=48f1b308cc66152eb6db66742dd0d08d888cda8d;hp=5c4cd46810cef8850b037fca9e38ffd43b0bff22
This can be reproduced in the following manner: 1) Create a 5.1 null sink: $ pactl load-module module-null-sink sink_name=NULL_5.1 \ channels=6 \ channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe 2) Play out the null sink output through its monitor: $ parec -d NULL_5.1.monitor | pacat 3) Play a high-bass audio file, like this one: http://darwish.chasingpointers.com/pub/sine-wave-50Hz-0.8amplitude.mp3 (Produced using Audacity tone generator) (4) High-bass should be heard.. Open `pavucontrol' and redirect the mp3 player output to the NULL_5.1 sink. Result: almost all of the bass is stripped
#!/bin/bash # # generate_waveform.sh - Record from a PulseAudio sink monitor and # plot the resulting waveform using sox and gnuplot # # usage: # - generate_waveform.sh alsa - Plot from ALSA sink monitor # - generate_waveform.sh null - Plot from NULL sink monitor # # notes: # - Before usage, set ALSA_SINK_NAME to system-appropriate value # - If not available, a NULL_5.1 sink is automatically created # set -o errexit set -o nounset PACTL=pactl PACAT=pacat PAREC=parec NULL_SINK_NAME=NULL_5.1 NULL_SINK_MONITOR=${NULL_SINK_NAME}.monitor ALSA_SINK_NAME=alsa_output.pci-0000_00_14.2.analog-stereo ALSA_SINK_MONITOR=${ALSA_SINK_NAME}.monitor OUTPUT_WAV_FILE=audio.wav OUTPUT_DAT_FILE=audio.dat OUTPUT_PLOT_FILE=audio.plot OUTPUT_PNG_FILE=audio.png GNUPLOT_SCRIPT=plot_audio.gp RECORD_PERIOD=10s usage() { echo "usage: $0 [null|alsa]" >& 2 exit -1 } [[ "$#" != "1" ]] && usage case "$1" in "null") RECORD_SINK_MONITOR=$NULL_SINK_MONITOR;; "alsa") RECORD_SINK_MONITOR=$ALSA_SINK_MONITOR;; *) usage esac null_sink_exists() { $PACTL list sinks | grep --silent $NULL_SINK_NAME } create_null_sink() { echo "Creating NULL sink $NULL_SINK_NAME" $PACTL load-module module-null-sink sink_name=$NULL_SINK_NAME \ channels=6 \ channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe } null_sink_exists || create_null_sink $PAREC -d $RECORD_SINK_MONITOR --file-format=wav $OUTPUT_WAV_FILE & _pid=$! echo "Recording audio, from $RECORD_SINK_MONITOR, for ${RECORD_PERIOD} .." sleep $RECORD_PERIOD kill $_pid echo "Generating signal amplitude values .." sox $OUTPUT_WAV_FILE $OUTPUT_DAT_FILE tail -n+3 $OUTPUT_DAT_FILE > $OUTPUT_PLOT_FILE # Remove comments cat > $GNUPLOT_SCRIPT <<EOF set terminal pngcairo enhanced size 640,480 font 'Verdana,10' set output "$OUTPUT_PNG_FILE" set yrange [-1:1] set ytics -1,0.1,1 # 0.1 jumps plot "$OUTPUT_PLOT_FILE" with lines EOF echo "Plotting audio .." gnuplot $GNUPLOT_SCRIPT echo "Success! .. please check audio waveform at $OUTPUT_PNG_FILE"
Created attachment 123414 [details] 0.8Amplitude, 50Hz, Audio signal as directly recorded from ALSA sink
Created attachment 123415 [details] 0.8Amplitude, 50Hz, Audio signal as directly recorded from upmixed NULL_5.1 sink and ZERO crossover frequency
Created attachment 123416 [details] 0.8Amplitude, 50Hz, Audio signal as directly recorded from upmixed NULL_5.1 sink and 120Hz crossover frequency
Created attachment 123417 [details] 0.8Amplitude, 120Hz, Audio signal as directly recorded from ALSA sink
Created attachment 123418 [details] 0.8Amplitude, 120Hz, Audio signal as directly recorded from upmixed NULL_5.1 sink and ZERO crossover frequency
Created attachment 123419 [details] 0.8Amplitude, 120Hz, Audio signal as directly recorded from upmixed NULL_5.1 sink and 120Hz crossover frequency
So this doesn't look like a "sum vs average" bug at all now. The filter should not attenuate the 50 Hz signal much - the theoretical gain of an LR4 filter is 0.994 at this frequency.
My personal preference would be to remove the feature, as it never worked correctly, and because people with serious DSP knowledge do not actively contribute to PulseAudio anymore. I.e. nobody, in my opinion, can take responsibility for the code.
I kate back two of my previous comments - the effect was due to downmixing in parec
(In reply to Alexander E. Patrakov from comment #12) > I kate back two of my previous comments - the effect was due to downmixing > in parec take back
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=979f19a434733afba0480e2ba456cccc98362e05 When enable-lfe-remixing is set, an LFE channel is present in the resampler's destination channel map but not in the source channel map, we insert a low-pass filter instead of just averaging the channels. Other channels will get a high-pass filter + + if (a == PA_CHANNEL_POSITION_MONO && on_lfe(b) && !(r->flags & PA_RESAMPLER_NO_LFE)) + *lfe_filter_required = true; do a == PA_CHANNEL_POSITION_MON when it is stereo ?
Any updates here?
BTW, the gnuplot file is missing?
Created attachment 123570 [details] Audacity screenshot -- original vs. parec on null sink fwiw, playing the mp3 file you uploaded, I don't see nearly as dramatic attenuation. Attaching a screenshot from Audacity.
Following from Alexander's comment from: https://lists.freedesktop.org/archives/pulseaudio-discuss/2015-February/023224.html I think this is something we need to address one way or another, but I don't think this merits being a blocker at this point.
After talking to Tanu, decided we need more discussion to see how to deal with this. Keeping as blocker for now, but not holding up RC1.
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=ee81abb623cb5e03c182d16871bb4fb34fdc9b4f how do 2.1 work since the driver expect LFE in last two channels , (e.g. asus notenbook external subwoofer only use the right channels but acer laptop use left channel ) +const struct snd_pcm_chmap_elem snd_pcm_2_1_chmaps[] = { + { .channels = 2, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, + { .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, + SNDRV_CHMAP_LFE, SNDRV_CHMAP_LFE } }, + { }
Pulseaudio uses the "surround21" device, whose channel map is defined as "front-left,front-right,lfe". It's alsa's job to ship configuration that arranges things so that "surround21" works as expected.
(In reply to Tanu Kaskinen from comment #21) > Pulseaudio uses the "surround21" device, whose channel map is defined as > "front-left,front-right,lfe". It's alsa's job to ship configuration that > arranges things so that "surround21" works as expected. do you mean druver should change the channel map for two different laptops if pulseaudio only provide front-left, front-right, lfe ? + { .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, + SNDRV_CHMAP_LFE, SNDRV_CHMAP_NA } }, + { .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, + SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } },
I don't know enough to tell what the driver should do. I only know that the "surround21" device is supposed to have "front-left,front-right,lfe" channel map. Pulseaudio doesn't care how alsa achieves that.
Based on IRC discussions, it seems likely that we will revert the default configuration to what it was in 6.0. That is, we won't synthesize LFE channel at all by default. The solution that I thought we'd do was to sum the low-pass filtered audio from all channels, instead of averaging it like we do now. That, however, can cause clipping in the LFE channel. The clipping can be avoided by lowering the volume, but it has its problems too. When converting 5.0 content to 5.1 channels, the absolutely safe thing would be to divide the amplitude of all channels by 5. Since that's pretty big reduction in volume, we could also do an empirical test on some collection of content and see how much the volume has to be reduced in practice in order to avoid clipping in 99% of cases. If we reduce the volume on 5.0 -> 5.1 conversion but not when playing 5.1 content, that means that 5.1 content will play louder than 5.0 content, which is not really acceptable, so we would have to reduce the volume the same amount in all cases. Alexander reported that Windows 10 doesn't synthesize the LFE channel (nor the center channel) when playing stereo content to a 5.1 device. The front channels just get copied to the rear channels, and also the amplitude is halved.
ALSA_SINK_NAME=alsa_output.pci-0000_00_14.2.analog-stereo ALSA_SINK_MONITOR=${ALSA_SINK_NAME}.monitor why do you use analog stereo since your hardware must support at least 4 or 6 channels for surround21
(In reply to Tanu Kaskinen from comment #24) > > Alexander reported that Windows 10 doesn't synthesize the LFE channel (nor > the center channel) when playing stereo content to a 5.1 device. The front > channels just get copied to the rear channels, and also the amplitude is > halved. http://www.ecs.com.tw/ECSWebSite/Support/Support_FAQ_Detail.aspx?MenuID=74&LanID=0&FAQID=43 is the speaker fill feature specific to realtek driver ?
(In reply to Tanu Kaskinen from comment #0) > According to a report on the mailing list, upmixing a stereo stream to 5.1 > results in bass being removed from the audio. LFE remixing should move bass > to the LFE channel, but reportedly that doesn't happen. > > I'll mark this as a release blocker. I plan to try to reproduce the bug. If > I can't reproduce, the blocker status can be removed, and maybe this bug can > be closed too. > > Here's the original report: > http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/25574/focus=25705 https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=979f19a434733afba0480e2ba456cccc98362e05 When enable-lfe-remixing is set, an LFE channel is present in the resampler's destination channel map but not in the source channel map, we insert a low-pass filter instead of just averaging the channels. Other channels will get a high-pass filter.
this mean that when you use combine sink 5.1 and stereo, bass will be removed from stereo when lfe mixing is enabled
do this mean that when your asus N series laptop with external subwoofer , select 2.1 profile the headphone will still have high pass filter when plugged unless you stop 2.1 stream and restart stereo stream
(In reply to Raymond from comment #29) > do this mean that when your asus N series laptop with external subwoofer , > select 2.1 profile the headphone will still have high pass filter when > plugged unless you stop 2.1 stream and restart stereo stream If the headphones are plugged in to a headphone connector, you don't get any audio while the 2.1 profile is active (headphones are supported only in the stereo profile). If you plug the headphones in a line-out connector and the 2.1 profile is active, and crossover filtering is enabled, then yes, the headphones will get high-pass filtered audio.
Removing release blocker status, because the configuration has been reverted to disable the crossover filtering by default.
(In reply to Arun Raghavan from comment #17) > Created attachment 123570 [details] > Audacity screenshot -- original vs. parec on null sink > > fwiw, playing the mp3 file you uploaded, I don't see nearly as dramatic > attenuation. Attaching a screenshot from Audacity. why only first and last channels have signal , are you using mono wav ? * The algorithm works basically like this: * * 1) Connect all channels with matching names. * * 2) Mono Handling: * S:Mono: Copy into all D:channels * D:Mono: Avg all S:channels
https://bugzilla.kernel.org/show_bug.cgi?id=107851#c83 it is pulseaudio resampler mix I00 and I02 for O02 ( 37.895| 0.000) D: [pulseaudio] resampler.c: Resampler: ( 37.895| 0.000) D: [pulseaudio] resampler.c: rate 44100 -> 44100 (method copy) ( 37.895| 0.000) D: [pulseaudio] resampler.c: format s16le -> s16le (intermediate s16le) ( 37.895| 0.000) D: [pulseaudio] resampler.c: channels 2 -> 3 (resampling 2) ( 37.895| 0.000) D: [pulseaudio] resampler.c: Channel matrix: ( 37.895| 0.000) D: [pulseaudio] resampler.c: I00 I01 ( 37.895| 0.000) D: [pulseaudio] resampler.c: +------------ ( 37.895| 0.000) D: [pulseaudio] resampler.c: O00 | 1.000 0.000 ( 37.895| 0.000) D: [pulseaudio] resampler.c: O01 | 0.000 1.000 ( 37.895| 0.000) D: [pulseaudio] resampler.c: O02 | 0.500 0.500 ( 37.895| 0.000) I: [pulseaudio] remap.c: Using generic matrix remapping ( 37.895| 0.000) D: [pulseaudio] resampler.c: lfe filter activated (LR4 type), the crossover_freq = 120Hz and alsa surround21 use route plugin to upmix LFE to both channels 2 and 3 0.189| 0.000) I: [pulseaudio] alsa-sink.c: Using hardware mute control. ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: snd_pcm_dump(): ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Route conversion PCM ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Transformation table: ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: 0 <- 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: 1 <- 1 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: 2 <- 2 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: 3 <- 2 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Its setup is: ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: stream : PLAYBACK ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: access : MMAP_INTERLEAVED ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: format : S16_LE ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: subformat : STD ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: channels : 3 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: rate : 44100 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: exact rate : 44100 (44100/1) ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: msbits : 16 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: buffer_size : 8192 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_size : 4096 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_time : 92879 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: tstamp_mode : ENABLE ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: tstamp_type : MONOTONIC ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_step : 1 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: avail_min : 7603 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_event : 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: start_threshold : -1 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: stop_threshold : 4611686018427387904 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: silence_threshold: 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: silence_size : 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: boundary : 4611686018427387904 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Slave: Soft volume PCM ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Control: PCM Playback Volume ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: min_dB: -51 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: max_dB: 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: resolution: 256 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Its setup is: ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: stream : PLAYBACK ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: access : MMAP_INTERLEAVED ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: format : S16_LE ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: subformat : STD ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: channels : 4 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: rate : 44100 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: exact rate : 44100 (44100/1) ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: msbits : 16 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: buffer_size : 8192 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_size : 4096 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_time : 92879 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: tstamp_mode : ENABLE ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: tstamp_type : MONOTONIC ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_step : 1 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: avail_min : 7603 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_event : 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: start_threshold : -1 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: stop_threshold : 4611686018427387904 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: silence_threshold: 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: silence_size : 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: boundary : 4611686018427387904 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Slave: Hardware PCM card 1 'HDA Intel PCH' device 0 subdevice 0 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: Its setup is: ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: stream : PLAYBACK ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: access : MMAP_INTERLEAVED ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: format : S16_LE ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: subformat : STD ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: channels : 4 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: rate : 44100 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: exact rate : 44100 (44100/1) ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: msbits : 16 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: buffer_size : 8192 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_size : 4096 ( 0.189| 0.000) D: [pulseaudio] alsa-util.c: period_time : 92879
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/397.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.