Menu

pocketsphinx and alsa card

Help
paul
2009-01-09
2012-09-22
  • paul

    paul - 2009-01-09

    I can't get pocketsphinx_continuous to run with my alsa driver. I'm using pocketsphinx and sphinxbase from nightly 12/31/08.

    The alsa driver capture is at a rate of 44100. I'm using a usb mic which creates the raw /dev/dsp1 and /dev/audio1 and the alsa capture hw:1

    if I try the raw device dsp1, it fails:
    $ pocketsphinx_continuous -adcdev /dev/dsp1
    ALSA lib pcm.c:2196:(snd_pcm_open_noupdate) Unknown PCM /dev/dsp1
    Error opening audio device /dev/dsp1 for capture: No such file or directory
    FATAL_ERROR: "continuous.c", line 259: ad_open_dev failed

    If I try the raw device audio1, it fails:
    $ pocketsphinx_continuous -adcdev /dev/audio1
    ALSA lib pcm.c:2196:(snd_pcm_open_noupdate) Unknown PCM /dev/audio1
    Error opening audio device /dev/audio1 for capture: No such file or directory
    FATAL_ERROR: "continuous.c", line 259: ad_open_dev failed

    If I try the alsa device, without a sample rate, it fails with:
    $ pocketsphinx_continuous -adcdev hw:1
    Available samping rate 44100 is too far from requested 16000
    FATAL_ERROR: "continuous.c", line 259: ad_open_dev failed

    If I try the alsa device, with a sample rate of 16000, it fails:
    $ pocketsphinx_continuous -adcdev hw:1 -samprate 16000
    Available samping rate 44100 is too far from requested 16000
    FATAL_ERROR: "continuous.c", line 259: ad_open_dev failed

    If I try the alsa device with a sample rate of 44100, it fails:
    $ pocketsphinx_continuous -adcdev hw:1 -samprate 44100
    ERROR: "fe_interface.c", line 100: FFT: Number of points must be greater or equal to frame size (1130 samples)

    $ ls -l /dev/dsp /dev/audio
    crw-rw----+ 1 root audio 14, 4 2009-01-09 12:48 /dev/audio
    crw-rw----+ 1 root audio 14, 20 2009-01-09 13:05 /dev/audio1
    crw-rw----+ 1 root audio 14, 3 2009-01-09 12:48 /dev/dsp
    crw-rw----+ 1 root audio 14, 19 2009-01-09 13:05 /dev/dsp1

     
    • David Huggins-Daines

      This is a common ALSA problem. It's because you are using the "hardware" ALSA device, which does not do any sample rate conversion. Try using the "plugin" ALSA device:

      pocketsphinx_continuous -adcdev plughw:1

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.