голосовое управление Intel Edison - как настроить Alsa

609
mdam

Я хочу реализовать голосовое управление инвалидной коляской с помощью Intel Edison. В основном я скажу вперед, влево, вправо и остановлюсь на микрофоне, подключенном к плате Edison через звуковой адаптер .

Для первоначального прототипа я просто хочу отобразить вывод распознавания речи в CLI.

Я следую этому онлайн-уроку. Все хорошо, пока в разделе настройки звука.

Далее следуют CLI-команды, используемые в учебнике.

lsusb:

root@edison:/home/speech_to_text# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 

ALSA-Utils:

root@edison:/home/speech_to_text# opkg install alsa-utils libportaudio2 libasound2 bison espeak alsa-lib-dev alsa-utils-dev alsa-dev python-numpy Package alsa-utils (1.0.28-r0) installed in root is up to date. Package libportaudio2 (v19+svnr1387-r0) installed in root is up to date. Package libasound2 (1.0.28-r0) installed in root is up to date. Package bison (2.7.1-r0) installed in root is up to date. Package espeak (1.48.04-r0) installed in root is up to date. Package alsa-lib-dev (1.0.28-r0) installed in root is up to date. Package alsa-utils-dev (1.0.28-r0) installed in root is up to date. Package alsa-lib-dev (1.0.28-r0) installed in root is up to date. Package python-numpy (1.7.0-r1) installed in root is up to date. 

aplay: (ДАЕТ ОШИБКУ ЗДЕСЬ)

root@edison:/home/speech_to_text# aplay -Ll ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing configuration **** List of PLAYBACK Hardware Devices **** ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing configuration aplay: device_list:277: control open (0): Invalid argument ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing configuration aplay: device_list:277: control open (1): Invalid argument ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:1697:(snd_config_load1) _toplevel_:1:29:Unexpected char ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3417:(config_file_open) /home/root/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3339:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib /data/jenkins_worker/workspace/edison-weekly/out/linux64/build/tmp/work/core2-32-poky-linux/alsa-lib/1.0.28-r0/alsa-lib-1.0.28/src/conf.c:3788:(snd_config_update_r) hooks failed, removing confroot@elab_iot_edison:/home/speech_to_text# installPip.sh 

Что я должен сделать, чтобы это исправить?

2
`/home/root/.asoundrc может быть старым или поврежденным: подумайте об его удалении или исправлении`? Tom Yan 8 лет назад 0

1 ответ на вопрос

1
mdam

Ok, solved it. There was some problem with the .asoundrc file.

Replaced the content of .asoundrc with the following and it worked. Followed this link to solve it.

pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } 

Похожие вопросы