julius-speech / julius

Open-Source Large Vocabulary Continuous Speech Recognition Engine
BSD 3-Clause "New" or "Revised" License
1.85k stars 300 forks source link

Problems with Julius in Raspbian #100

Open mangunillos opened 5 years ago

mangunillos commented 5 years ago

Hi,

I've download and installed Julius in raspbian and I made it work. But, after restarting the system I got this message and stopped working:

----------------------- System Information end -----------------------

Notice for feature extraction (01),


* Cepstral mean normalization for real-time decoding:       *
* NOTICE: The first input may not be recognized, since      *
*         no initial mean is available on startup.          *
*************************************************************

read waveform input

Stat: adin_oss: device name = /dev/dsp (application default) Stat: adin_oss: sampling rate = 16000Hz Stat: adin_oss: going to set latency to 50 msec Stat: adin_oss: audio I/O Latency = 32 msec (fragment size = 512 samples) STAT: AD-in thread created <<< please speak >>>Warning: strip: sample 0-318 is invalid, stripped Warning: strip: sample 0-159 is invalid, stripped Warning: strip: sample 0-323 is invalid, stripped Warning: strip: sample 0-155 is invalid, stripped

I use this command to make the system work:

padsp julius -input oss -C Sample.jconf

I've changed the -input oss to -input mic and had the same problem.

Also, using the same command withour padsp to not use pulseaudio and the same happens.

Anyone else had the same problem?

colbec commented 5 years ago

The first comment about cepstral mean is normal and is just informative.

The strip issue may be resolved by the option -nostrip; you can view the available options with julius --help

You may be able to avoid some of the pulseaudio issues by ensuring that the pulseaudio development files are available during the build configure. If julius can see them then it may default to PA for input.

mangunillos commented 5 years ago

Thanks for the information, but if I use -nostrip flag julius stops and doesn't work. I installed with the pulseaudio adding a flag in the ./configure and the same problem happened. I've changed the audio systems setting to make sure the microphone works. I use a usb microphone. The strange thing is that I made it work before and now doesn't work after a reboot.

colbec commented 5 years ago

When Julius is running it remains largely silent unless something goes wrong. Since the reboot changed things then something else may have been reset. Julius has many options and it is reasonably easy to set an option in the jconf that will stop it from behaving as expected.

One way to check that the audio system is working is to do something like arecord | aplay at the command line which will activate the microphone and then play back immediately what was heard. Pay close attention to sample rate and levels for silence which can vary a lot for different devices. Once you get a jconf that works keep a backup copy of it while you experiment with settings.

mangunillos commented 5 years ago

Okey I will try to make changes to the jconf file to see if it's possible to make any change, but I test in audacity and with those commands that you send and the microphone is working fine. I don't know what happened to the system it's very strange, maybe the OS changed some internal audio configuration.

colbec commented 5 years ago

Very unlikely that the OS is the problem. Examine closely the silence thresholds in Julius.

mangunillos commented 5 years ago

I've been trying to change all the settings and the same problem happens. I reinstalled all in a different memory and for a period of time worked and now the same problem happens again.

LeeAkinobu commented 5 years ago

Does Julius works at the first time, and does not work on the second time after reboot? If so, try to check whether the OS changes the "default audio device" after reboot. Julius always opens default device. I wander if the second time Julius opens another audio device to which microphone is not connected.

If the above situation does not fit your problem, check if the recording after reboot still works on other audio tools.

mangunillos commented 5 years ago

Yes, I tried with the audacity to know if all works fine and it looks like it's fine but always get that message. Even I've changed the flags to change the threshold and the same happens. The only thing I change, it's the screen where I place the Pi but I don't think that this can be the problem.

colbec commented 5 years ago

The Raspberry Pi has an HDMI port - part of which is audio. If you are using non-HDMI video/audio and then switch to HDMI video is it possible that the Pi is switching audio as well? Using Pulseaudio tools should give you a graphical access to which video/audio is currently in use and allow you to force the audio input required.

mangunillos commented 5 years ago

I'm using the HDMI port all the time but a change can be made without knowing. The problem is that I change all the time the screen and work more times. But randomly the error ocurrs and it's impossible to continue the recognition.