首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何添加对libasound2-plugin-等于ASLA配置raspnerry pi MAX98357 I2S amp的支持

如何添加对libasound2-plugin-等于ASLA配置raspnerry pi MAX98357 I2S amp的支持
EN

Unix & Linux用户
提问于 2019-07-26 11:07:06
回答 1查看 750关注 0票数 1

我遵循本教程(https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage)添加MAX98357 I2S放大器到覆盆子圆周率。它的工作原理很棒,但我希望有一个软件eq来调整高低。我似乎无法确定所需的/etc/asound.conf配置,以使它实现使用libasound2-plugin-equal包插件到ASLA。有什么建议吗?

以下是我所拥有的,以及我尝试过的一些评论

代码语言:javascript
运行
复制
pcm.speakerbonnet {
   type hw card 0
}

pcm.dmixer {
   type dmix
   ipc_key 1024
   ipc_perm 0666
   slave {
     pcm "speakerbonnet"
     period_time 0
     period_size 1024
     buffer_size 8192
     rate 44100
     channels 2
   }
}

ctl.dmixer {
    type hw card 0
}

pcm.softvol {
    type softvol
    slave.pcm "dmixer"
    control.name "PCM"
    control.card 0
}

ctl.softvol {
    type hw card 0
}




pcm.!default {
    type             plug

    # this works (ie not using eq)
    #slave.pcm       "softvol"

    # tried setting this to plugin, but this fails to produce sound
    slave.pcm        plugequal
}



# attempt to get libasound2-plugin-equal working
ctl.equal {
  type equal
}
pcm.plugequal {
  type equal
  slave.pcm "dmixer"
}
pcm.equal {
  type plug
  slave.pcm plugequal
}

使用上面的配置,我得到以下信息

代码语言:javascript
运行
复制
pi@pi:~ $ speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav

speaker-test 1.1.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
Broken configuration for playback: no configurations available: No such file or directory
Setting of hwparams failed: No such file or directory
pi@pi:~ $ 
pi@pi:~ $ mpg123 /tmp/test_song.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
    version 1.25.10; written and copyright by Michael Hipp and others
    free software (LGPL) without any warranty but with best wishes
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available
[src/libout123/modules/alsa.c:204] error: get_formats_alsa(): no configuration available

Directory: /tmp/

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: test_song.mp3 ...
[src/libout123/modules/alsa.c:80] error: initialize_device(): no configuration available
main: [src/mpg123.c:309] error: out123 error 7: failed to open device
pi@pi:~ $
EN

回答 1

Unix & Linux用户

发布于 2019-07-26 17:03:55

解决方案是设置slave.pmc "plug:dmix"

代码语言:javascript
运行
复制
pcm.speakerbonnet {
   type hw card 0
}

pcm.dmixer {
   type dmix
   ipc_key 1024
   ipc_perm 0666
   slave {
     pcm "speakerbonnet"
     period_time 0
     period_size 1024
     buffer_size 8192
     rate 44100
     channels 2
   }
}

ctl.dmixer {
    type hw card 0
}

pcm.softvol {
    type softvol
    slave.pcm "dmixer"
    control.name "PCM"
    control.card 0
}

ctl.softvol {
    type hw card 0
}




pcm.!default {
    type             plug
    #slave.pcm       "softvol"
    slave.pcm        plugequal
}



# attempt to get libasound2-plugin-equal working
ctl.equal {
  type equal
}
pcm.plugequal {
  type equal
  slave.pcm "plug:dmix"
}
pcm.equal {
  type plug
  slave.pcm plugequal
}
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/532277

复制
相关文章

相似问题

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