Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using ubuntu 12.04 LTS - sound works fine.

I've tried to execute pocketsphinx for some tests with voice recognition, but it depends on OSS to work. It crashes with the message:

ad_oss.c(103): Failed to open audio device(/dev/dsp): No such file or directory

Googli'n around my first fix attempt was installing the package "oss-compat" - but the lack of success led me to find out it is just a misleader - an empty bogus package.

Then I tried:

$> padsp pocketsphinx_continuous
...
ioctl(NONBLOCK) failed: Invalid argument

Finally, the (dead?) sphynx wiki FAQ states:

compile pocketsphinx with ALSA support by installing alsa development headers from a package libasound2 or alsa-devel

Alsa-devel does not exists in my distro, but I've installed libasound2-dev and gstreamer0.10-pocketsphinx - then re-compiled pocketsphynx - no changes.

Now I'm out of ideas and the sphynx forums seem to be down. Anyone?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Just as a few guesses:

  • Nothing changed in pocketsphynx's support of ALSA because, after installing the ALSA headers, you compiled pocketsphynx with ./configure and did not specify --prefix=/usr as a command line option to configure, so it installed it into /usr/local path. /usr/bin version of pocketsphynx is being launched instead, so your installed version isn't being picked up.

  • Pocketsphynx's build system has a flag you have to specify in order to enable ALSA support explicitly, and you didn't set that flag? Try ./configure --help to see if you have to specify --enable-alsa or something.

  • If you still can't get ALSA support working, try configuring your system for OSS Proxy support. You can start with the "How to Test" instructions at here but skip steps 3 through 6. Also, you will need to separately compile osspd from source. The new home of osspd is on SourceForge. The purpose of osspd is to emulate a real OSS device in userspace using Character Device In Userspace (CUSE) kernel module, and forward the audio through the kernel to PulseAudio. It's more compatible with programs because certain things like non-blocking I/O and MMAP can be emulated with osspd that can't be emulated with a libc preload hack like padsp or aoss.

share|improve this answer
    
Indeed I was not specifiying the --prefix / and totally ignored the pocketsphynx compilation time on the error messages, thanks. –  gabriel_agm Oct 24 '12 at 14:09
    
You are getting compile-time errors in pocketsphynx? What are the errors? –  ÃŁŁǫǛȉЖΦΤїҪ Oct 24 '12 at 14:11
    
I've searched for such kind o flag to enable ALSA - didn't found any. Running configure with proper prefix, make clean, make, sudo make install.. No effect, same errors. So I'm trying osspd. I've compiled it, followed the instructions on the link and runned osspd - but syslog pops this: osspd: Creating dsp (14:3), adsp (14:12), mixer (14:0) > CUSE: failed to register chrdev region –  gabriel_agm Oct 24 '12 at 14:14
    
Oh, no compile error - when I run the binary, along with the "Failed to open audio device(/dev/dsp)" it popsthe binary compile date/time - this should warn me about not running the right version. –  gabriel_agm Oct 24 '12 at 14:15
    
Ah :) You get that error failed to register chrdev region if you have CONFIG_SOUND_OSS_CORE_PRECLAIM enabled in your kernel... so you'll have to recompile the kernel with this flag unset. :( Anyway, does the pocketsphynx compile complete successfully, and what are you using as the --prefix? –  ÃŁŁǫǛȉЖΦΤїҪ Oct 24 '12 at 14:20
show 4 more comments

I've found the easiest way to do oss emulation for one specific program on Ubuntu is to install alsa-oss which provides an aoss command. Then run aoss program to magically give program oss emulation.

(The other way is to install oss4 drivers, but then you have to use those instead of alsa, I don't think there's any good way to have oss4 and alsa coexist?)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.