matrix-io/matrix-creator-pocketsphinx

pocketsphinx_demo exits with errors

Closed this issue · 1 comments

After running the demo:

./pocketsphinx_demo -keyphrase "MATRIX" -kws_threshold 1e-20 -dict assets/6706.dic -lm assets/6706.lm -inmic yes -adcdev mic_channel8

I end up with the following error message:

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM mic_channel8
Error opening audio device mic_channel8 for capture: No such file or directory
FATAL: "pocketsphinx_demo.cpp", line 158: Failed to open audio device

Any idea?

As suggested in https://community.matrix.one/t/solved-microphone-issues/1450/4 I copyied the following lines to ~/.asoundrc what solved the problem.

pcm.sc {
    type hw
    card 1
}

pcm.mic_channel0 {
    type file
    file "/tmp/matrix_micarray_channel_0"
    infile "/tmp/matrix_micarray_channel_0"
    format "raw"
    slave {
      pcm sc
    }
}

pcm.mic_channel1 {
    type file
    file "/tmp/matrix_micarray_channel_1"
    infile "/tmp/matrix_micarray_channel_1"
    format "raw"
    slave {
      pcm sc
    }
}

pcm.mic_channel8 {
    type file
    file "/tmp/matrix_micarray_channel_8"
    infile "/tmp/matrix_micarray_channel_8"
    format "raw"
    slave {
      pcm sc
    }
}

pcm.!default {
    type asym
    playback.pcm {
      type hw
      card 0
      device 0
    }

    capture.pcm {
      type file
      file "/tmp/matrix_micarray_channel_0"
      infile "/tmp/matrix_micarray_channel_0"
      format "raw"
      slave {
        pcm sc
      }
    }
}