使用Alsa和PulseAudio将LADSPA滤波器仅应用于一个多声道输出通道

我想将滤波器,特别是SWH的glame-bandpass-iir,应用于几个输出通道中的一个。

看完下面列出的例子后,我仍然难过。 我很确定module-ladspa-sinkmodule-remap-sink是我需要的解决方案。 但是,我不能理解module-remap-sink上的文档。 为了简单起见,我们假设目标是让front L/R soundcard jack输出未经过滤的音频, rear L/R soundcard jack输出滤波后的音频。

 sink_name: The name for the new virtual sink. master: The name of the sink of which channels you're remapping. channels: Channel count of the new sink. channel_map: List of the channels that this sink will accept. master_channel_map: The channels in the master sink, where the channels listed in channel_map will be relayed to. channel_map and master_channel_map must have equal number of channels listed, because the channels will be mapped based on their position in the list, ie the first channel in channel_map will be relayed to the first channel in master_channel_map and so on. remix: Allow remixing of the mono or stereo streams to multiple channels (default is yes; set to "no" if you don't want the stereo stream to be up-mixed to all channels except subwoofer and channels named aux0-aux15). 

http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules#module-remap-sink

以下是我想要使用的filter接收器:

 ### LADSPA Sink .ifexists module-ladspa-sink.so .nofail load-module module-ladspa-sink sink_name=ladspa_out master=alsa_out plugin=bandpass_iir_1892 label=bandpass_iir control=660.0,440.0,2 .fail .endif 

有人可以解释我如何center jack on soundcard完成source – > ladspa_out – > center jack on soundcard 。 具体来说,我该如何填写?

 load-module module-remap-sink filt_sink  2    

如果它是相关的,我使用i945板载声音: alsa.long_card_name = "Intel ICH7 with ALC850 at irq 17"

经过几周的挫折编辑…

我已经尝试了/etc/pulse/default.pa~/pulse/default.pa所有配置,我可以想象没有成功。 我尝试过使用module-udev-detect各种排列 module-alsa-sink用于设置具有4或6个通道的alsa,分别称为前左,前右,左,右,aux0-4,左后,右后和module-remap-sinkmodule-combine-sink以及预期的module-ladspa-sink 。 虽然滤波器可以在一个,两个或四个通道上工作,但是不可能通过任何其他通道同时获得未滤波的输出。

我已经在#pulseaudio上询问了irc,并且被告知单独使用脉冲我想要的是不可能的。 如果有人能指出我特定的pulseaudio解决方案或其他工具的解决方案,我真的很感激。

谢谢。

将LADSPAfilter分配给单个音频通道

我们可以通过微调pulseaudio LADSPA接收器模块来实现这一目的。 此模块加载将应用任何LADSP插件的接收器。 通常情况下,将滤波器应用于所有通道,但我们也可以通过重新映射然后组合通道来定义单个通道以指定滤波器。

涉及以下Pulse Audio命令 :

  1. 获取有效的sink_namechannel_map

     pacmd list-sinks 
  2. 加载LADSPAfilter:

     load-module module-ladspa-sink sink_name=ladspa_out master=alsa_out plugin= label= 
  3. 创建一个新的重新映射的接收器:

     load-module remap-sink sink_name= master= channels= master_channel_map= channel_map= 
  4. 创建一个新的组合接收器:

     pacmd load-module module-combine-sink sink_name= sink_properties=device.description= slaves= channels= 

为了获得所需的效果,我们需要加载LADSPAfilter以创建带有来自给定接收器的过滤音频的ladspa_out -sink。 然后我们需要为每个音频通道创建单独的命名接收器。 我们希望应用filter的通道需要ladspa_out -sink作为主站,我们需要清洁的通道需要未过滤的接收器作为主站。 最后,我们再次组合各个渠道,为我们提供新的组合水槽。


两个通道的示例

 pacmd load-module module-ladspa-sink sink_name=ladspa_out master=alsa_output.pci-0000_00_14.2.analog-stereo plugin=bandpass_iir_1892 label=bandpass_iir control=660.0,440.0,2 

使用bandpass_iirfilter创建一个新的接收器ladspa_out并将给定的控制应用于来自主接收器的音频信号(替换为上面步骤1中的主接收器)

 pacmd load-module module-remap-sink sink_name=remapR master=ladspa_out channels=1 master_channel_map=front-right channel_map=front-right 

从过滤后的ladspa_out器为右前音频通道创建名为remapR的过滤ladspa_out器。

 pacmd load-module module-remap-sink sink_name=remapL master=alsa_output.pci-0000_00_14.2.analog-stereo channels=1 master_channel_map=front-left channel_map=front-left 

左前方音频通道的未过滤 remapL是从我们未经过滤的主接收器创建的,如上所述。

 pacmd load-module module-combine-sink sink_name=combine sink_properties=device.description=myCombine slaves=remapL,remapR channels=2 

将使用2通道创建新的接收器combine (或您选择的任何其他名称),使用左通道的未过滤的sink remapL ,以及右通道的过滤的sink remapR

现在我们可以在音频设置中选择这个新创建的接收器(显示为“myCombine”),使左声道未经过滤,右声道通过上面的LADSPfilter进行过滤。

如果我们有两个以上的通道,我们将不得不为所有通道执行这些步骤,用过滤的或未过滤的信号替换每个通道,以在最后一步中再次组合它们。