ASLA 구성 raspnerry pi MAX98357 I2S 앰프에 libasound2-plugin-equal에 대한 지원을 추가하는 방법

ASLA 구성 raspnerry pi MAX98357 I2S 앰프에 libasound2-plugin-equal에 대한 지원을 추가하는 방법

저는 이 튜토리얼을 따랐습니다(https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage) MAX98357 I2S 증폭기를 Raspberry Pi에 추가합니다. 훌륭하게 작동하지만 최고와 최저를 조정할 수 있는 소프트웨어 이퀄라이저가 필요합니다. /etc/asound.confASLA의 패키지 플러그인을 사용하여 이를 달성하는 데 필요한 구성을 파악할 수 없는 것 같습니다 . libasound2-plugin-equal어떤 제안이 있으십니까?

내가 가지고 있는 것과 내가 시도한 것에 대한 의견은 다음과 같습니다.

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
}

위의 구성으로 다음과 같은 결과를 얻습니다.

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:~ $

답변1

해결책은 설정하는 것입니다.slave.pmc "plug:dmix"

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
}

관련 정보