首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Alsa和PulseAudio将LADSPA滤波器应用于单通道多路输出

用Alsa和PulseAudio将LADSPA滤波器应用于单通道多路输出
EN

Ask Ubuntu用户
提问于 2012-09-29 04:07:42
回答 1查看 2.3K关注 0票数 2

我想应用一个过滤器,特别是SWH的荣耀带通-iir,只对几个输出通道之一。

在看了下面的例子之后,我仍然很困惑。我确信module-ladspa-sinkmodule-remap-sink是满足我需求的解决方案。但是,我无法理解module-remap-sink上的文档。为了保持简单,让我们假设目标是让front L/R soundcard jack输出未经过滤的音频,而rear L/R soundcard jack输出过滤音频。

代码语言:javascript
复制
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, i.e. 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

下面是我想使用的过滤器接收器:

代码语言:javascript
复制
### 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

有人能解释一下我是如何完成source -> ladspa_out -> center jack on soundcard的吗?具体来说,我该如何填写?

代码语言:javascript
复制
load-module module-remap-sink filt_sink <?> 2 <?left,?right> <?m_left,?m_right> <?yes>

如果是相关的话,我使用的是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来设置alsa,它有4或6个通道,名为前左、前右、左、右、0-4、后左、后右、module-remap-sinkmodule-combine-sink,以及预定的module-ladspa-sink。虽然过滤器将工作在一个,两个或四个通道上,它是不可能同时获得未经过滤的输出通过任何其他渠道。

我在irc上询问了#脉冲音频,有人告诉我,我想要的仅仅是脉搏是不可能的。如果有人能告诉我具体的脉冲音频解决方案或其他工具的解决方案,我会非常感激的。

谢谢。

EN

回答 1

Ask Ubuntu用户

发布于 2012-09-29 08:34:19

将LADSPA滤波器分配给单个音频信道

我们可以通过微调脉冲音频LADSPA接收器模块来实现这一点。这个模块加载一个接收器,任何LADSP插件都将应用到其中。通常情况下,将过滤器应用于所有信道,但我们也可以通过重新映射和组合信道来定义单个通道来分配过滤器。

所涉及的脉冲音频命令如下:

  1. 获取有效的sink_namechannel_map:pacmd列表-接收器
  2. 加载LADSPA过滤器:负载模块模块-ladspa-接收器sink_name=ladspa_out master=alsa_out plugin= label= control=
  3. 创建一个新的重映射接收器:负载模块重新映射-接收器sink_name= master= channels= master_channel_map= channel_map=
  4. 创建一个新的组合接收器: pacmd加载模块模块-组合式接收器sink_properties=device.description= slaves= channels=

为了获得预期的效果,我们需要加载LADSPA过滤器,以便从给定的接收器中创建一个带有过滤音频的ladspa接收器。然后,我们需要为每个音频频道创建单独的命名接收器。我们希望过滤器被应用的通道需要作为主人的ladspa_out-接收器,我们需要干净的通道需要未经过滤的水槽作为主人。最后,我们再次组合不同的信道,给我们新的组合接收器。

两个通道的

示例

代码语言:javascript
复制
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

使用ladspa_out过滤器创建了一个新的接收器bandpass_iir,并对来自主接收器的音频信号应用了给定的控件(用上面步骤1中的主接收器替换)

代码语言:javascript
复制
pacmd load-module module-remap-sink sink_name=remapR master=ladspa_out channels=1 master_channel_map=front-right channel_map=front-right

从过滤后的remapR接收器中为前面右边的音频通道创建一个名为ladspa_out的过滤接收器。

代码语言:javascript
复制
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是从我们未经过滤的主接收器中创建的,如上面所定义的。

代码语言:javascript
复制
pacmd load-module module-combine-sink sink_name=combine sink_properties=device.description=myCombine slaves=remapL,remapR channels=2

一个新的接收器combine (或您选择的任何其他名称)将使用2通道创建,其中左侧通道使用未过滤的接收器remapL,右侧通道使用筛选后的接收器remapR

现在,我们可以在音频设置中选择这个新创建的接收器(以“myCombine”的形式显示),使左侧通道不被过滤,右边的通道由上面的LADSP过滤。

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

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/194281

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档