Speech Recognition ...
 
Notifications
Clear all

Speech Recognition not finding the QBO's microphone

3 Posts
2 Users
0 Reactions
2,790 Views
(@srklermt)
New Member
Joined: 5 years ago
Posts: 2
Topic starter  

Hi,

I am trying to setup the QBO for speech recognition using Python3's speech_recognition library but seem to have stumbled over a hurdle which I can't get over as of yet. I am trying to find at least one of the in-built microphones using the speech_recognition's function:

sr.Microphone.list_microphone_names() 

But it is returning the following output:

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Microphone with name "bcm2835 ALSA: IEC958/HDMI (hw:0,1)" found for `Microphone(device_index=0)`
Microphone with name "dmix" found for `Microphone(device_index=1)`
 
The underlined being the two microphone devices it found but upon further inspection, I found out that these are sound output devices which obviously do not suit my needs as I need to take voice input.
 
Upon further research online I found that the microphone required is called: 'dmicQBO_sv'. Is there a way to find it or do I need to install anything to make it work?
 
P.S. I am running on Python 3.5.2 and have the latest versions of speech_recognition and PyAudio installed. Moreover, I have upgrade to the latest version of Raspbian available right now.
 
P.S.2 I have tried my code on another QBO device and the microphone mentioned above was still not found.
 
Thanks in Advance.

   
Quote
(@srklermt)
New Member
Joined: 5 years ago
Posts: 2
Topic starter  

Ok, small update. It appears that the issue is being caused by the fact that we are updating the Raspbian OS with:

 

sudo apt-get update

sudo apt-get upgrade

 

Because as it comes out of the box, the robot can find the required microphone. The only issue being that when I attempt to install opencv-contrib-python for Python3, it is failing with the error dreaded  Could not find a version that satisfies the requirement ... error. Do you know how I can get the microphone to work on the latest Raspbian OS version or how to install OpenCV for Python3 on the out of the box version of Raspbian?

 

Thanks in Advance.

 


   
ReplyQuote
Qbo Robot
(@nonogrub)
Member Admin
Joined: 8 years ago
Posts: 185
 
Posted by: SrKleRMT

Ok, small update. It appears that the issue is being caused by the fact that we are updating the Raspbian OS with:

 

sudo apt-get update

sudo apt-get upgrade

 

Because as it comes out of the box, the robot can find the required microphone. The only issue being that when I attempt to install opencv-contrib-python for Python3, it is failing with the error dreaded  Could not find a version that satisfies the requirement ... error. Do you know how I can get the microphone to work on the latest Raspbian OS version or how to install OpenCV for Python3 on the out of the box version of Raspbian?

 

Thanks in Advance.

 

Hi,

this is how you can access to the microphones:

import serial
import QboCmd

#Get mics present RMS values 0 - 32767: 0 - 1V

par_list = HeadCtrl.GetHeadCmd("GET_MIC_REPORT", 0)
if response:
    mic1_rms = (par_list[1] << 8 | par_list[0]) / 32767.0
    mic2_rms = (par_list[3] << 8 | par_list[2]) / 32767.0
    mic3_rms = (par_list[5] << 8 | par_list[4]) / 32767.0

#Switch to mic  1

HeadCtrl.GetHeadCmd("SET_MIC_INPUT", 1)


   
ReplyQuote
Share: