2

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?

2 Answers2

1

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.

allquixotic
  • 34,882
1

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?)