Speech Recognition on ODROID

Share here your ideas for new projects
User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

Try to install it from source code, as this:
pip3 install git+https://github.com/alphacep/vosk-api.git
If you see some missing modules, you can install them by hand pip3 install <missing_module> and try again.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

> is it possible to use Odroid N2?

I think yes

> odroid@odroid:~/vosk$ pip3 install vosk-0.3.16-cp38-cp38-linux_aarch64.whl

What is you python version? Maybe 3.7 then you need cp37, not cp38

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

> Try to install it from source code, as this:

Sorry, it is not going to work like this as it requires many dependencies

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

N2 has an odd mix of processors which may be an issue with this. Julius should run on it though.

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

I have received the ReSpeaker 4-Mic Array now. But when I try to compile the driver I see that on kernel 3.10.107 it will not build. Need to install Armbian with mainline kernel on C1. But I have doubts about the stability and it won't work on eMMC, also usb is not working well. :(
It should run on the C1 I have in the living room that do all the nrf24 traffic for my alarm sensors. I would need to do long time stability tests with mainline kernel, that I have done already a year or two ago and I installed old kernel again.
Old kernel runs stable: wlan, usb, emmc...
But don't have snd_soc_dapm and not gpiod for AC108 driver.
These users thanked the author joerg for the post:
nshmyrev (Sat Jan 09, 2021 5:00 am)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

joerg wrote:
Sat Jan 09, 2021 2:24 am
I have received the ReSpeaker 4-Mic Array now. But when I try to compile the driver I see that on kernel 3.10.107 it will not build. Need to install Armbian with mainline kernel on C1. But I have doubts about the stability and it won't work on eMMC, also usb is not working well. :(
It should run on the C1 I have in the living room that do all the nrf24 traffic for my alarm sensors. I would need to do long time stability tests with mainline kernel, that I have done already a year or two ago and I installed old kernel again.
Old kernel runs stable: wlan, usb, emmc...
But don't have snd_soc_dapm and not gpiod for AC108 driver.
The source from Seeed isn't helpful?

Code: Select all

$ sudo apt-get update
$ sudo apt-get upgrade
$ git clone https://github.com/respeaker/seeed-voicecard.git
$ cd seeed-voicecard
$ sudo ./install.sh  
$ reboot
https://wiki.seeedstudio.com/ReSpeaker_ ... pberry_Pi/

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

Oh, I have tried that. It is coded for Raspberry Pi and gives a lot of errors compiling on C1 with kernel 3.10.107.
I was able to build it with mainline kernel after patching a lot.
But when I dig deeper into the source code and the datasheet of AC108 I see that it can't be used on C1!
It uses I2S. Somehow I was thinking it uses SPI, but not.
It makes also no sense to use a C1+, as the Data In for I2S is not there, only Data Out.
My alternatives: Send it back or use it with a Raspberry Pi.

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

I thought it was overpriced to use in a personal project. The PlayStation eye camera is my current favorite but I'm still looking around, in a security system application the playstation camera may be a better choice than respeaker, just in case you get the itch to fiddle with facial recognition later in life.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

Looks like I need another Odroid to try everything in place. What do you think mates? Which one to get? Does Odroid C4 look reasonable?

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

Btw, I pushed updated microphone code, should be much more reliable now:

https://github.com/alphacep/vosk-api/bl ... rophone.py

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

nshmyrev wrote:
Sun Jan 10, 2021 7:45 am
Looks like I need another Odroid to try everything in place. What do you think mates? Which one to get? Does Odroid C4 look reasonable?
IMO, for R&D the C1+ would be the best choice, followed by XU4, here's my reasoning:
In the Odroid current ARM line-up 4 out of 7 are ARMv7 so ARMv7 is the logical choice to get things started.
Of course your C1 uses the same image so you already have something C1+ compatible.

C1+ -vs- XU4:
XU4: ARMv7 and a strong community favourite, but due to low voltage GPIO pins is less desirable for makers and more desirable for use as a server.
C1+: Backwards compatible with the old C1 & C0, both are discontinued but there are still quite a few still in use today. Also costs like 30% less than the XU4 making it more cost effective for R&D and small projects that one would typically use Speech Recognition with..

Here's the line-up (ARM):

C2:
1.5GHz ARM 64bit Cortex-A53 Quad-core CPU

XU4:
Samsung Exynos5422 Cortex™-A15 2Ghz and Cortex™-A7 Octa core CPUs

HC1:
Samsung Exynos5422 Cortex™-A15 2Ghz and Cortex™-A7 Octa core CPUs

N2+:
Amlogic S922X (4x Cortex-A73 @ 2.2GHz, 2x Cortex-A53 @ 1.9GHz)

HC2:
Samsung Exynos5422 Cortex-A15 2Ghz and Cortex-A7 Octa core CPUs

C4:
CPU: Amlogic S905X3 12nm Processor Quad-Core Cortex-A55 (2.016GHz) ARMv8-A architecture with Neon and
Crypto extensions

C1+:
Amlogic ARM® Cortex®-A5(ARMv7) 1.5Ghz quad core CPUs
These users thanked the author L67GS for the post:
nshmyrev (Sun Jan 10, 2021 10:48 pm)

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

C1+ is out of stock unfortunately, I doubt it will be actively sold in the future.

What about XU4 vs C4? Does C4 also have low voltage?

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

No, the C4 has 3,3V IO pins, but power supply is 5.5V ... 15.5V.
These users thanked the author joerg for the post:
nshmyrev (Sun Jan 10, 2021 10:48 pm)

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

Got it: :D
Bildschirmfoto vom 2021-01-10 15-53-05.png
Bildschirmfoto vom 2021-01-10 15-53-05.png (108.42 KiB) Viewed 1272 times
These users thanked the author joerg for the post:
L67GS (Mon Jan 11, 2021 6:28 am)

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

Installed vosk-api without problems:

Code: Select all

sudo pip3 install vosk-0.3.17-cp38-cp38-linux_armv7l.whl
Processing ./vosk-0.3.17-cp38-cp38-linux_armv7l.whl
Installing collected packages: vosk
Successfully installed vosk-0.3.17

Code: Select all

python3 --version
Python 3.8.5

Code: Select all

Welcome to Ubuntu 20.04 LTS (GNU/Linux 3.10.107-20 armv7l)

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

> Installed vosk-api without problems:

Works?

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

I have to learn how to use it. Let me a little bit of time. I am old. ;)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

nshmyrev wrote:
Sun Jan 10, 2021 6:48 pm
C1+ is out of stock unfortunately, I doubt it will be actively sold in the future.

What about XU4 vs C4? Does C4 also have low voltage?
C4 is ARMv8, a minority, the C1 you currently have is a better choice imo.

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

joerg wrote:
Sun Jan 10, 2021 11:56 pm
Got it: :D
Bildschirmfoto vom 2021-01-10 15-53-05.png
Oh wow you got the PlayStation camera, it just plugs in and audio just works right?

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

I have to wait, got it right now in ebay auction. Need to wait until I receive the parcel.

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

I have tried the test_simple.py of vosk and of some spoken words and counting from one to ten it has recognized the counting correct but the words not correct.
I have recorded in German a sample with the microphone of a webcam. Then I reduced the noise with audacity, the recognition was the same. I used vosk-model-small-de-zamia-0.3.
It took 32s for a sample of 22s.
[edit]
With vosk-model-small-de-0.15. it took only 20s and the words recognition was better but not perfect.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

joerg wrote:
Mon Jan 11, 2021 3:08 am
I have tried the test_simple.py of vosk and of some spoken words and counting from one to ten it has recognized the counting correct but the words not correct.
I have recorded in German a sample with the microphone of a webcam. Then I reduced the noise with audacity, the recognition was the same. I used vosk-model-small-de-zamia-0.3.
It took 32s for a sample of 22s.
[edit]
With vosk-model-small-de-0.15. it took only 20s and the words recognition was better but not perfect.
Great, thats something. At least it works. If you share the sample audio I can take a look. In general ASR should be more accurate if you speak closer to the microphone.

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

Oh, it's a terrible microphone. Let's wait until I get the PS3 Eye Cam and get it hopefully working.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

L67GS wrote:
Mon Jan 11, 2021 12:51 am
C4 is ARMv8, a minority, the C1 you currently have is a better choice imo.
I think armv8 will be a majority very soon, and even more will have GPU onboard like Jetson nano/BananaPi. Which is best for AI applications.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

joerg wrote:
Mon Jan 11, 2021 3:08 am
With vosk-model-small-de-0.15. it took only 20s and the words recognition was better but not perfect.
On what device is that? C1+ ?

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

nshmyrev wrote:
Mon Jan 11, 2021 5:58 am
L67GS wrote:
Mon Jan 11, 2021 12:51 am
C4 is ARMv8, a minority, the C1 you currently have is a better choice imo.
I think armv8 will be a majority very soon, and even more will have GPU onboard like Jetson nano/BananaPi. Which is best for AI applications.
I'm not so sure about that, the N2+ just came out, the XU4 is kind of the flagship SBC for Odroid, and for the others Hardkernal seems to keep stuff well beyond it's freshness date as long as the demand is there so it could be a while before the v7 is the Odroid minority.

As of now the C1+ is probably the logical choice for a maker board.

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

nshmyrev wrote:
Mon Jan 11, 2021 5:58 am
joerg wrote:
Mon Jan 11, 2021 3:08 am
With vosk-model-small-de-0.15. it took only 20s and the words recognition was better but not perfect.
On what device is that? C1+ ?
C1

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

joerg wrote:
Mon Jan 11, 2021 12:39 am
Installed vosk-api without problems:

Code: Select all

sudo pip3 install vosk-0.3.17-cp38-cp38-linux_armv7l.whl
Processing ./vosk-0.3.17-cp38-cp38-linux_armv7l.whl
Installing collected packages: vosk
Successfully installed vosk-0.3.17

Code: Select all

python3 --version
Python 3.8.5

Code: Select all

Welcome to Ubuntu 20.04 LTS (GNU/Linux 3.10.107-20 armv7l)
I do not understand why it doesn't work for me.

Code: Select all

root@odroid:~# pip3 install vosk-0.3.17-cp38-cp38-linux_armv7l.whl                                   
WARNING: Requirement 'vosk-0.3.17-cp38-cp38-linux_armv7l.whl' looks like a filename, but the file dot
Processing ./vosk-0.3.17-cp38-cp38-linux_armv7l.whl                                                  
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ''

Code: Select all

root@odroid:~# pip3 install https://github.com/alphacep/vosk-api/releases/download/0.3.7/vosk-0.3.7-cp37-cp37m-linux_aarch64.whl
ERROR: vosk-0.3.7-cp37-cp37m-linux_aarch64.whl is not a supported wheel on this platform.

root@odroid:~# python3 --version
Python 3.8.5

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

> I do not understand why it doesn't work for me.

Try

Code: Select all

pip3 install https://github.com/alphacep/vosk-api/releases/download/0.3.17/vosk-0.3.17-cp38-cp38-linux_armv7l.whl
These users thanked the author nshmyrev for the post:
L67GS (Mon Jan 11, 2021 7:02 am)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

It worked, and I see it now, I had tried changing the package but failed to change the directory to 0.3.17
These users thanked the author L67GS for the post:
nshmyrev (Mon Jan 11, 2021 9:42 am)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

Success! I can run test_simple.py now!

So I tried test_microphone.py

Code: Select all

root@odroid:/vosk-api/python/example# python3 ./test_microphone.py                                                                      
Traceback (most recent call last):                                                                                                      
  File "./test_microphone.py", line 6, in <module>                                                                                      
    import sounddevice as sd                                                                                                            
ModuleNotFoundError: No module named 'sounddevice'               

User avatar
joerg
Posts: 1343
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 86 times
Been thanked: 193 times
Contact:

Re: Speech Recognition on ODROID

Post by joerg »

Try pip3 install sounddevice
Everytime you get a ModulNotFoundError, it is not installed on your device or it can't be found.
These users thanked the author joerg for the post:
L67GS (Mon Jan 11, 2021 3:38 pm)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

joerg wrote:
Mon Jan 11, 2021 2:26 pm
Try pip3 install sounddevice
Everytime you get a ModulNotFoundError, it is not installed on your device or it can't be found.
Thank you, I'll try that tomorrow.
I found an older microphone comparison with the PS eye, it's an interesting read.
https://medium.com/snips-ai/benchmarkin ... 0de8876fda
These users thanked the author L67GS for the post:
nshmyrev (Mon Jan 11, 2021 7:13 pm)

n2fan
Posts: 18
Joined: Fri Jan 08, 2021 6:47 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speech Recognition on ODROID

Post by n2fan »

Odroid N2; thanks for help for the previous step; it was a symbolic link issue

odroid@odroid:~/vosk/vosk-api/python/example$ python3 --version
Python 3.8.0

pip3 install vosk-0.3.16-cp38-cp38-linux_aarch64.whl - worked fine

odroid@odroid:~/vosk/vosk-api/python/example$ python3 ./test_simple.py test.wav
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:194) Decoding params beam=13 max-active=7000 lattice-beam=6
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:197) Silence phones 1:2:3:4:5:6:7:8:9:10
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components.
LOG (VoskAPI:CompileLooped():nnet-compile-looped.cc:345) Spent 0.126654 seconds in looped compilation.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:221) Loading i-vector extractor from model/ivector/final.ie
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:246) Loading HCLG from model/graph/HCLG.fst
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:265) Loading words from model/graph/words.txt
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:273) Loading winfo model/graph/phones/word_boundary.int
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:281) Loading CARPA model from model/rescore/G.carpa
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)

any idea what am I doing wrong now?

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

It seems we may be able to do some beamforming and echo cancellation with the PS eye array in pulseaudio.

https://arunraghavan.net/2016/06/beamfo ... ulseaudio/

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

n2fan wrote:
Mon Jan 11, 2021 3:54 pm
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:281) Loading CARPA model from model/rescore/G.carpa
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)

any idea what am I doing wrong now?
Hey, you tried too big model, it doesn't fit your memory. Try smaller one:

http://alphacephei.com/vosk/models/vosk ... s-0.15.zip

n2fan
Posts: 18
Joined: Fri Jan 08, 2021 6:47 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speech Recognition on ODROID

Post by n2fan »

many thanks! smaller model works fine.

###
odroid@odroid:~/vosk/vosk-api/python/example$ python3 ./test_simple.py test.wav
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:194) Decoding params beam=10 max-active=3000 lattice-beam=2
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:197) Silence phones 1:2:3:4:5:6:7:8:9:10
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components.
LOG (VoskAPI:CompileLooped():nnet-compile-looped.cc:345) Spent 0.0869389 seconds in looped compilation.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:221) Loading i-vector extractor from model/ivector/final.ie
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:251) Loading HCL and G from model/graph/HCLr.fst model/graph/Gr.fst
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:273) Loading winfo model/graph/phones/word_boundary.int
{
"partial" : ""
}
{
"partial" : ""
}
{
"partial" : ""
}
{
"partial" : ""
}
{
"partial" : ""
}
{
"partial" : "one"
}
{
"partial" : "one zero"
}
{
"partial" : "one zero zero"
nshmyrev wrote:
Mon Jan 11, 2021 5:27 pm
n2fan wrote:
Mon Jan 11, 2021 3:54 pm
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:281) Loading CARPA model from model/rescore/G.carpa
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)

any idea what am I doing wrong now?
Hey, you tried too big model, it doesn't fit your memory. Try smaller one:

http://alphacephei.com/vosk/models/vosk ... s-0.15.zip
These users thanked the author n2fan for the post:
nshmyrev (Mon Jan 11, 2021 11:11 pm)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

Of the users interested in this what Odroid devices do we have at our disposal to test vosk on? So far I see C1,C0, C1+ & N2. I also own an XU4 so I can test on XU4 as well but we're still a few devices away from the whole line-up.

n2fan
Posts: 18
Joined: Fri Jan 08, 2021 6:47 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speech Recognition on ODROID

Post by n2fan »

just one more question: I start the test program python3 ./test_simple.py test.wav and start htop in the second terminal. The processor load is 100% on one core but other cores are not loaded. It is intentionally or I overlook something?

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

n2fan wrote:
Tue Jan 12, 2021 1:17 am
just one more question: I start the test program python3 ./test_simple.py test.wav and start htop in the second terminal. The processor load is 100% on one core but other cores are not loaded. It is intentionally or I overlook something?
Yes, we use just 1 core because we want to keep space for other tasks. In the future we might implement multicore system, not implemented yet.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

L67GS wrote:
Tue Jan 12, 2021 12:05 am
Of the users interested in this what Odroid devices do we have at our disposal to test vosk on? So far I see C1,C0, C1+ & N2. I also own an XU4 so I can test on XU4 as well but we're still a few devices away from the whole line-up.
It should work more or less, the question is accuracy and features for practical applications. Like keyword spotting for activation.

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

nshmyrev wrote:
Tue Jan 12, 2021 2:58 am
L67GS wrote:
Tue Jan 12, 2021 12:05 am
Of the users interested in this what Odroid devices do we have at our disposal to test vosk on? So far I see C1,C0, C1+ & N2. I also own an XU4 so I can test on XU4 as well but we're still a few devices away from the whole line-up.
It should work more or less, the question is accuracy and features for practical applications. Like keyword spotting for activation.
That wasn't on my radar because my Candice AI does it's own keywords, but I'll study how to test it.
Any recommended reading on vosk-api so I can incorporate into c++? I haven't really looked closely since I wanted to make sure it ran first.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

L67GS wrote:
Tue Jan 12, 2021 4:01 am
That wasn't on my radar because my Candice AI does it's own keywords, but I'll study how to test it.
Any recommended reading on vosk-api so I can incorporate into c++? I haven't really looked closely since I wanted to make sure it ran first.
For c++ you have to compile it yourself. We will probably release precompiled version soon, but no deadlines. You need to try python, its really flexible for ai applications.

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

nshmyrev wrote:
Tue Jan 12, 2021 5:07 am
L67GS wrote:
Tue Jan 12, 2021 4:01 am
That wasn't on my radar because my Candice AI does it's own keywords, but I'll study how to test it.
Any recommended reading on vosk-api so I can incorporate into c++? I haven't really looked closely since I wanted to make sure it ran first.
For c++ you have to compile it yourself. We will probably release precompiled version soon, but no deadlines. You need to try python, its really flexible for ai applications.
I figured there was a C++ header file somewhere?
From https://github.com/alphacep/vosk-api:

"Speech recognition bindings implemented for various programming languages like Python, Java, Node.JS, C#, C++ and others."

Edit: yeah there's a header file, so I thought all I had to do was start vosk and then #include it to use it, darn.
https://github.com/alphacep/vosk-api/bl ... vosk_api.h

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

L67GS wrote:
Tue Jan 12, 2021 5:23 am
Edit: yeah there's a header file, so I thought all I had to do was start vosk and then #include it to use it, darn.
https://github.com/alphacep/vosk-api/bl ... vosk_api.h
Yes, you can include that header.

For library file you can unpack wheel and use _vosk.so from it, just rename it to libvosk.so, link to it and it should work.

You can also check vosk-api/c folder for details.
These users thanked the author nshmyrev for the post:
L67GS (Tue Jan 12, 2021 11:18 am)

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

I found a deal on 2 PS Eye cameras and ordered. They'll be here in a few days and I'll have one for r&d, and one to tear apart for the Candice project.

L67GS
Posts: 458
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Has thanked: 136 times
Been thanked: 66 times
Contact:

Re: Speech Recognition on ODROID

Post by L67GS »

I've got vosk working with the microphone, it's not terribly accurate but it's working. I'm going to focus the next couple of days on trying to do C++ integration and see how it likes the PS Eye microphones when they arrive.

n2fan
Posts: 18
Joined: Fri Jan 08, 2021 6:47 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speech Recognition on ODROID

Post by n2fan »

Yesterday, I was able to start a bigger model on N2. It seems to work fine in the real-time with one core load 100%.
Next hurdle: if I start a second recognition process; the vosk server loads the model one more time and N2 will be unresponsbile.
I did following command:
python ./test_simple.py /tmp/fifo1.wav
python ./test_simple.py /tmp/fifo2.wav

how to reuse the model for several recognition processes?
nshmyrev wrote:
Tue Jan 12, 2021 2:57 am
n2fan wrote:
Tue Jan 12, 2021 1:17 am
just one more question: I start the test program python3 ./test_simple.py test.wav and start htop in the second terminal. The processor load is 100% on one core but other cores are not loaded. It is intentionally or I overlook something?
Yes, we use just 1 core because we want to keep space for other tasks. In the future we might implement multicore system, not implemented yet.

nshmyrev
Posts: 47
Joined: Sat Dec 12, 2020 10:14 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 10 times
Contact:

Re: Speech Recognition on ODROID

Post by nshmyrev »

> Yesterday, I was able to start a bigger model on N2

This model should be probably optimal for you, you can also tune beams in model/model.conf for best performance

https://alphacephei.com/vosk/models/vos ... lgraph.zip

> how to reuse the model for several recognition processes?

If you want to have multiple recognition tasks in parallel you can use vosk server:

https://github.com/alphacep/vosk-server

for simple API we have websocket variant, there is also mqtt variant compatible with home assistant:

https://github.com/alphacep/vosk-server ... aster/mqtt

n2fan
Posts: 18
Joined: Fri Jan 08, 2021 6:47 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Speech Recognition on ODROID

Post by n2fan »

thanks, will try the server today. did you make some tests how many channels can be processed in parallel on Intel hardware or any other devices/processors?


vosk-server/client-samples/python/tts-test.py is it a text to speech engine included?

Post Reply

Return to “The Ideas”

Who is online

Users browsing this forum: No registered users and 1 guest