Professional Documents
Culture Documents
Home of Bishoph Offline Voice Control
Home of Bishoph Offline Voice Control
Startseite
twitter archiv
About
SOPARE stands for SOund PAttern REcognition and is a Python project developed on and for
the Raspberry Pi. The goal is to provide offline and real time audio processing for some words
that must be trained upfront.
As SOPARE is able to learn sounds from training sessions SOPARE is able to identify the same
sound later on even under different circumstances. This means that you can train words in any
languages. Or just sounds like doorbells, knocks and whatever you want. Of course, there are
limitations. However, SOPARE provides a simple plug-in architecture for further processing.
Here are some real life operational areas: SOPARE runs 24/7 and controls smart home things
like lights (on/off), a magic mirror (wake up, change views, …) and another installation controls
a robotic arm via voice commands. The source code and even more information is available on
GitHub.
You want to see SOPARE in action? Here is a 32 second video that shows the potential:
Now let us start with the hardware requirements. You need a computer. Yep, seriously. As
SOPARE was developed for and on a Raspberry Pi we go with this one – even if SOPARE runs
on other hardware as well. Make sure that the hardware comes with a multi core processor. This
means Raspberry Pi 2 or 3. Please note: The Pi zero was not tested and could be too weak even if
the „0“ comes with 2 cores. SOPARE does not run on older hardware like Raspberry Pi B or B+
due to the lack of multi-core processors. Of course, you need a power supply and a micro SD
card if you go with the Raspberry Pi.
Then you need a microphone. Maybe some USB-mic. The microphone is extremely important
and should fit your own requirements. For example: If you want speech recognition across a
large distance (more that 1 meter) you may find out that the cheap USB-mic for 5 Euros does not
do the trick. But if you plan to speak directly into the microphone the same mic could do the job
just perfect. I’m using different microphones for different environments and requirements.
That’s it for the hardware. Now let’s talk about software. SOPARE should run on every
Raspbian version that is out there. The latest version is Stretch. All of my Raspberry Pis are
running the „lite“ version without a desktop UI. But this is up to you and you can choose
whatever you prefer. There is some good information available how to download, install and
configure Raspbian. I don’t cover this topic as it would get out of hand.
Now you should have a computer, a mic and the operating system installed and configured. In
terms of Raspbian you already got most of the software for the further installation. Only some
required libraries must be installed manually with the following commands:
I recommend to create a development directory in your home directory but this is really optional.
In case you follow my recommendation execute the following commands:
cd
mkdir dev
cd dev
Voilá. To really be ready and to follow the complete instructions we need two more directories:
cd sopare
mkdir tokens
mkdir samples
You successful installed SOPARE. Congratulations. We can fire up some tests to find out if all
requirements are met and if the microphone is configured and used correctly. Start SOPARE and
the audio test with the following commands:
python sopare.py -u
python test/test_audio.py
Let us assume that everything went well and you got no errors. In that case you see something
like this:
sopare 1.5.1
starting unit tests...
...
unit_tests run successful!
done.
test_audio init...
... ALSA related information ...
testing different SAMPLE_RATEs ... this may take a while!
SAMPLE_RATE = 48000
CHUNK = 512
THRESHOLD = 100
Great! You can now edit the configuration and change the file accordingly to the
recommendations:
nano config/default.ini
As soon as you saved the config you are ready to do a first training round. Let’s train the word
„test“. This is easy as eating cake:
./sopare.py -v -t test
appears on the screen. You should see lots of lines rush over your monitor. This is good as
SOPARE logs some debug information. If the lines are rushing before you said something
SOPARE started the training because something triggered the THRESHOLD. In that case I
recommend to delete the trained file(s) and start the training again, maybe with a higher
THRESHOLD.
Here is the command to delete the files and the dictionary and start again:
rm dict/*.raw
./sopare.py -d "*"
You can repeat the training round a few times. Normally 3 times is enough to get first results.
After the training SOPARE must create an internal dictionary from the training:
./sopare.py -c
Finally we reached the end of the step-by-step tutorial. You may want to check if your trained
words are recognized, right? Here we go. Start SOPARE in endless loop mode and say „test“:
./sopare.py -l
Depending on your mic, your environment, the count of test rounds and lots of other things you
should see that SOPARE is able to recognize the word test as it appears on the screen in square
brackets.
['test']
Amazing. You can now fine tune, train more or different words or write your custom plugin. See
the other available content for more information. Leave me a comment and tell me about your
experience and your achievement. The video video tutorial for this post:
Post navigation
← SOPARE 1.5 is available; Feedback
SOPARE architecture and plugins →
1. Alec says:
Thank you for the great information! Unfortunately, I am not sure how to put it all
together.
I was able to install Sopare, train it, etc. I even saw the comment on how to apply it to
gpio, but I am trying to control multiple functions with commands. What I don’t
understand is, how do you use the readable output to trigger a section of code? I don’t
understand what rawbuf or the 3 arguments are.
When I look at the robot arm code, for example, I don’t see how i could apply this to gpio
/ motor controllers so that the computer takes the voice command it hears through a
microphone (ie., ‚test‘ or whatever the word is and uses) in the code? How / what line
does the code „take in“ the voice input information and use it to trigger something? I was
expecting something like #this is where the voice command comes from and #this is
where the voice command goes.
Antworten
o bishoph says:
Hi. If you want to control something via GPIO then you have to write a plugin
with some GPIO code. Your plugin will be called whenever SOPARE recognized
a word. Inside the plugin you check for the conditions of the trained words and
executes the GPIO code. There is a very simple GPIO code example available in
the comments of the „Sopare basic usage. Voice controlling a magic mirror“ blog
post. Hope this helps 🙂
Antworten
Alec says:
Yes, I was happy to see that post, but the problem is not knowing how to
control via GPIO, the problem is, I don’t know how to link the voice
command to that code. I see to add the ‚readable_results“ piece, but
nothing is being piped into that variable as far as I can tell. In other words,
when I say „test“ or „forward“ or whatever, this doesn’t seem to link to
any line of code to make it activate the GPIO as needed.
Here is my code: (first I define the GPIO functions, then I added the
sopare.py code with modifications to use those functions. I commented out
all the things that didn’t apply, at least as I saw it.)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import time
import RPi.GPIO as gpio
#import usb.core, usb.util
def init():
gpio.setmode(gpio.BOARD)
gpio.setup(7,gpio.OUT)
gpio.setup(11,gpio.OUT)
gpio.setup(13,gpio.OUT)
gpio.setup(15,gpio.OUT)
def forward(tf):
init()
gpio.output(7,True)
gpio.output(11,True)
gpio.output(13,True)
gpio.output(15,False)
time.sleep(tf)
gpio.cleanup()
def reverse(tf):
init()
gpio.output(7,True)
gpio.output(11,False)
gpio.output(13,True)
gpio.output(15,True)
time.sleep(tf)
gpio.cleanup()
def turn_left(tf):
init()
gpio.output(7,True)
gpio.output(11,True)
gpio.output(13,False)
gpio.output(15,True)
time.sleep(tf)
gpio.cleanup()
def turn_right(tf):
init()
gpio.output(7,False)
gpio.output(11,True)
gpio.output(13,True)
gpio.output(15,False)
time.sleep(tf)
gpio.cleanup()
def pivot_left(tf):
init()
gpio.output(7,True)
gpio.output(11,True)
gpio.output(13,True)
gpio.output(15,True)
time.sleep(tf)
gpio.cleanup()
def pivot_right(tf):
init()
gpio.output(7,True)
gpio.output(11,False)
gpio.output(13,True)
gpio.output(15,False)
time.sleep(tf)
gpio.cleanup()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
„““
Copyright (C) 2015 – 2018 Martin Kauss (yo@bishoph.org)
Licensed under the Apache License, Version 2.0 (the „License“); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
import sys
import getopt
import sopare.config as config
import sopare.util as util
import sopare.recorder as recorder
import sopare.log as log
import test.unit_tests as tests
from sopare.version import __version__
def main(argv):
endless_loop = False
debug = False
outfile = None
infile = None
dict = None
plot = False
wave = False
error = False
cfg_ini = None
recreate = False
unit = False
print („sopare „+__version__)
if (recreate == True):
recreate_dict(debug, cfg)
sys.exit(0)
if (unit == True):
unit_tests(debug, cfg)
sys.exit(0)
recorder.recorder(cfg)
def show_dict_ids(debug):
print („current entries in dictionary:“)
utilities = util.util(debug, None)
utilities.showdictentriesbyid()
def show_dict_analysis(debug):
print („dictionary analysis:“)
utilities = util.util(debug, None)
analysis = utilities.compile_analysis(utilities.getDICT())
for id in analysis:
print (id)
for k, v in analysis[id].iteritems():
print (‚ ‚ + str(k) + ‚ ‚ + str(v))
def usage():
print („usage:\n“)
print (“ -h –help : this help\n“)
print (“ -l –loop : loop forever\n“)
print (“ -e –error : redirect sdterr to error.log\n“)
print (“ -p –plot : plot results (only without loop option)\n“)
print (“ -v –verbose : enable verbose mode\n“)
print (“ -~ –wave : create *.wav files (token/tokenN.wav) for“)
print (“ each detected word\n“)
print (“ -c –create : create dict from raw input files\n“)
print (“ -o –overview : list all dict entries\n“)
print (“ -s –show [word] : show detailed [word] entry information“)
print (“ ‚*‘ shows all entries!\n“)
print (“ -w –write [file] : write raw to [dir/filename]\n“)
print (“ -r –read [file] : read raw from [dir/filename]\n“)
print (“ -t –train [word] : add raw data to raw dictionary file\n“)
print (“ -d –delete [word] : delete [word] from dictionary and exits.“)
print (“ ‚*‘ deletes everything!\n“)
print (“ -i –ini [file] : use alternative configuration file\n“)
print (“ -a –analysis : show dictionary analysis and exits.\n“)
print (“ -u –unit : run unit tests\n“)
main(sys.argv[1:])
“‘
if (RoboArm != None):
print (‚Robotic arm connected!‘)
else:
print (‚Robotic arm not connected or offline!‘)
def Light():
global light
light = 1 – light
RoboArm.ctrl_transfer(0x40,6,0×100,0,[0,0,light],3)
def AllOff():
RoboArmOff = usb.core.find(idVendor=0x1267, idProduct=0x000)
attemtps = 0
while True:
try:
RoboArmOff.ctrl_transfer(0x40,6,0×100,0,[0,0,light],3)
break
except:
if (attemtps == 0):
print (‚USB con error … consider an emergency shutdown!‘)
try:
RoboArmOff = usb.core.find(idVendor=0x1267, idProduct=0x000)
except:
print (‚Shit. Manual emergency shutdown required!‘)
attemtps += 1
if (attemtps == 20):
break
run(readable_results,1,1)
Antworten
Alec says:
Antworten
bishoph says:
26. Februar 2018 at 21:56
bishoph says:
SOPARE calls your plugin in the plugin directory and another sub
directory with the name „__init__.py“
1) cd sopare/plugins
2) Create a custom directory in the plugin directory (e.g.: mkdir
my_gpio_custom_plugin)
3) Create a python file with the name „__init__.py“ (e.g. you copy
the print plugin)
4) Create your custom code and the conditions in the run function
for your trained identifiers
5) Start SOPARE
6) SOPARE now calls automatically the function „def
run(readable_results, data, rawbuf):“ whenever an identifier is
recognized and the recognized values are in the array
„readable_results“
7) Your custom code and your conditions are executed which
means you control your robot
Antworten
Alec says:
After your notes above, the robot did it! You probably can’t
image how happy I am about this. I literally just threw my
arms up and cheered when the robot moved! 🙂
bishoph says:
Great! You are welcome and I’m glad that you like the
project, the tutorials and it works for you.
2. Karl says:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
and
sudo nano /usr/share/alsa/alsa.conf
defaults.ctl.card 0
defaults.pcm.card 0
defaults.ctl.card 1
defaults.pcm.card 1
Thanks
Antworten
o bishoph says:
As I don’t see any errors and just warnings from ALSA my only recommendation
is that you can clean your alsa.conf file and then have some serious fun 🙂
Cleaning means that you comment out the stuff that appears as warning, here is an
example that should help you:
#
# PCM interface
#
...
#pcm.rear cards.pcm.rear
...
Antworten
3. Karl says:
you stated: „clean your alsa.conf file “ == delete and re-install python-pyaudio?
Karl
Antworten
o bishoph says:
as shown and comment out the lines that appear in the warnings.
then search for the term „cards.pcm.rear“ and comment out the line like shown
above.
Antworten
4. Karl says:
correction:
sudo python sopare.py >>> – t test <<<<
gives:
sopare 1.5.0
ALSA lib pcm_d …
Antworten
5. Karl says:
ok seems to do something..
python test/test_audio.py
test_audio init…
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
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.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_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
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
testing different SAMPLE_RATEs … this may take a while!
SAMPLE_RATE = 44100
CHUNK = 512
THRESHOLD = 400
./sopare.py -v -t test
sopare 1.5.0
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
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.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_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
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
INFO:sopare.analyze:checking for plugins…
DEBUG:sopare.analyze:loading and initialzing plugins/print
DEBUG:sopare.audio_factory:#### Default input device info #####
DEBUG:sopare.audio_factory:defaultSampleRate: 48000.0
DEBUG:sopare.audio_factory:defaultLowOutputLatency: -1.0
DEBUG:sopare.audio_factory:defaultLowInputLatency: 0.0213333333333
DEBUG:sopare.audio_factory:maxInputChannels: 128
DEBUG:sopare.audio_factory:structVersion: 2
INFO:sopare.worker:worker queue runner started
DEBUG:sopare.audio_factory:hostApi: 0
DEBUG:sopare.audio_factory:index: 5
DEBUG:sopare.audio_factory:defaultHighOutputLatency: -1.0
DEBUG:sopare.audio_factory:maxOutputChannels: 0
DEBUG:sopare.audio_factory:name: default
DEBUG:sopare.audio_factory:defaultHighInputLatency: 0.0213333333333
INFO:sopare.buffering:buffering queue runner
DEBUG:sopare.recorder:SAMPLE_RATE: 48000
DEBUG:sopare.recorder:CHUNK: 512
INFO:sopare.recorder:start endless recording
WARNING:sopare.recorder:stream read error [Errno -9981] Input overflowed
WARNING:sopare.recorder:stream read error [Errno -9988] Stream closed
WARNING:sopare.recorder:stream read error [Errno -9988] Stream closed
WARNING:sopare.recorder:stream read error [Errno -9988] Stream closed
WARNING:sopare.recorder:stream read error [Errno -9988] Stream closed
on forever
Karl
Antworten
o bishoph says:
The recommendation for your environment is a sample rate of „44100“ but you
are using a sample rate of „48000“. Please change the sample rate in the config
file according to the recommendation and the warning should vanish.
Antworten
6. Karl says:
ok got it to work with catching the errors and sending sigkill , then restarting itself :
recorder.recorder(cfg)
os.system(„python sopare.py „+ argList[-1]+“ &“)
os.kill(os.getpid(), signal.SIGTERM)
in main:
killOldPgm(os.getpid(),“sopare.py“)
in recording:
self.stop()
return
remove sys.exit .. that hangs
def killOldPgm(myPID,pgmToKill):
try:
cmd= „ps -ef | grep ‚“+pgmToKill+“‚ | grep -v grep“
ret =
subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE).com
municate()[0]
lines=ret.split(„\n“)
Karl
Antworten
o bishoph says:
Yes, indeed. I have tested a lot of microphones and the ones that work flawlessly
are the more expensive ones. But I also using a 5€ mic that works as well but the
distance is limited to around 0,5m.
Now to your problem: First of all, you only get warnings and not an error. This is
important. You should be able to run SOPARE and still get some results. Not
saying best results but maybe decent results. What you can do is test different
sample_rates. Test the following sample_rates one by one and see if the warnings
disappear:
Antworten
7. Karl says:
the
WARNING:sopare.recorder:stream read error [Errno -9988] Stream closed
repeats endlessly once started. thats why I added the self restart.
dumb question, where are the results printed eg. [u’light‘]. I would like to replace that
with a method that performs some actions.
Thanks
Karl
und viele Gruesse aus Dallas
Antworten
o bishoph says:
Simply copy the „print“ directory which can be found in the „plugins“ directory
to create your own custom plugin. The plugins are called automatically when a
sound is recognized and you get the „readable_results“ as array in the „run“
method. Here is the code for my robotic arm example:
https://raw.githubusercontent.com/bishoph/Misc/master/robotic_arm_control.py
Antworten
8. Karl says:
found the place where I can add the commands.. .. I am really impressed by this package.
outstanding work ..
Antworten
o bishoph says:
Thanks 🙂
Antworten
9. Karl says:
getting an error:
in filter.py line 61:
Antworten
o bishoph says:
Antworten
Hi Martin;
I did every step you showed in the video.However when i try to test ./sopare.py -t
„example“ i got this error.
sopare 1.5.0
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown 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 confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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 confmisc.c:767:(parse_card) cannot find card ‚0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned
error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error:
No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM dmix
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
Traceback (most recent call last):
File „/usr/lib/python2.7/multiprocessing/queues.py“, line 268, in _feed
send(obj)
IOError: [Errno 32] Broken pipe
Antworten
o bishoph says:
Antworten
Cankut says:
Thanks for your answers Martin i did all of your steps.After i write
./sopare.py -t „go“ i got this error ;
sopare 1.5.0
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
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.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_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file
or directory)
attempt to connect to server failed
Antworten
bishoph says:
Hi. There is no SOPARE error. The output comes from the ALSA
system respective from pyaudio. As I don’t know anything about
your environment so I can only recommend to clean your alsa.conf
file to get rid of those warnings. I found a thread with the same
message and the recommendation is also to clean your alsa config:
https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=20354
7
python test/test_audio.py
Antworten
Hi,
after disabling the internal sound card and adding following code to /etc/asound.conf and
~/.asoundrc
[code]
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
[/code]
I have a Raspi3 and an Ugreen USB sound card 2.0 and an adafruit amplified mic.
Antworten
o bishoph says:
A segmentation fault comes normally from code with low memory access:
https://en.wikipedia.org/wiki/Segmentation_fault
As SOPARE is written in Python and uses pyaudio as bride to the hardware I can
only guess that you compiled something manually or you have installed some
incompatible (lib-)versions. The error can be nearly anywhere in the system
which means this goes beyond anything we could solve here with normal efforts
😉
Antworten
Carsten says:
Carsten says:
Antworten
bishoph says:
Ok, then there is something wrong with the mic, or the pi usb power is to noisy. the
treshold was mentioned from the soprare init test. will try a i2s mic array next. Thx
Antworten
Hallo,
Antworten
Sollte gehen, besser ist aber SOPARE direkt als service zu starten. Ich kann beizeiten mal
schreiben wie man das macht…
Antworten
Hey bishop,
Iam getting threshold as 12600 which is too much. Do i have to configure alsa ??
SAMPLE_RATE = 48000
CHUNK = 512
THRESHOLD = 12600
Please reply.
Antworten
Hey,
Antworten
o bishoph says:
During the test SOPARE detects the environmental sound level. This means you
should be silent during the test. If this is the normal sound level you should move
😉
Antworten
If yes , how to do it ?
Antworten
o bishoph says:
29. März 2018 at 17:47
Think so. ALSA config is for sound so there should be no difference if you
configure your mic…
Antworten
Hallo,
Ich vermute die Samplerate ist zu hoch beim Test, danach ist das Array nicht mehr
ansprechbar bis zum Reboot. Wo kann ich diese einstellen? Bei der Befehlszeile „arecord
-Dac108 -f S32_LE -r 16000 -c 4 hello.wav“ wird z.B. 16k angegeben, weiß nur nicht, ob
daß das Maximum darstellt.
Vielen Dank
Antworten
Ergänzung:
Antworten
o bishoph says:
Hi. Das ist recht speziell und ich weiß nicht warum das nicht geht. Ohne die
Hardware wird das schwierig. Mach bitte einen Bug auf GitHub auf und wir
hoffen das das jemand lösen kann.
Antworten
Hey,
Auch werden mir bei erkannten Wörtern ein „u“ davor gesetzt, was in deinen Videos ja
nicht der Fall ist(bei mir sieht das dann so aus [u’an‘]). Hat das irgendeine bedeutung, die
villeicht dazu führen tut, dass sich sopare aufhängt?
viele Grüße
Antworten
o bishoph says:
Hi. Das „u“ steht für Unicode und ist ganz normal und soll so sein.
Für alles andere bräuchte man mehr Info…
Antworten
Hab grad festgestellt, dass sobald sich sopare aufhängt die cpu für das Pythonscript auf
25% „hängen“ bleibt und dessen Memory kontinuirlich ansteigt. Villeicht bleibt das
Script in irgend einer Dauerschleife hängen?
Antworten
o bishoph says:
Antworten
Dominic says:
Werde mal ne log erstellen lassen, vllt kann man daraus dann irgend was
brauchbares herausfiltern. Bin momentan aber unterwegs, wird noch 2-3
Tage dauern bis ich das machen kann.
Was ich auch festgestellt habe, wenn ich das Script starte, und viel
hintereinander sage, hängt er sich schnell auf(eben diese 20-30sek). Aber
wenn ich zwischen den Ansagen immer eine Pause lasse (60-90sek), dann
läuft das Script 5-6min und hängt sich dann erst auf. Eventuell kommt er
mit viel „gerede“ nicht klar. Was auch sein kann, dass mein Mic eventuell
Probleme macht und den so falsche Signale rein schickt und das zu den
Fehler führt(ist nähmlich schon etwas älter und funktioniert auch nicht
mehr so ganz 100%tig, aber neues ist schon unterwegs, vllt ist das ja des
Rätsels Lösung).
viele Grüße
Antworten
das 4MicArray hab ich erstmal bei Seite gelegt (meine Nerven 😉 ) – wenn Du möchtest,
schicke ich dir das zu Testzwecken, jetzt ist das 2-MicHat dran. Aber auch hier gibt es
Probleme…
ich habe mir mal die von pyaudio erkannten Geräte anzeigen lassen:
[code]
import pyaudio
p = pyaudio.PyAudio()
for i in range(p.get_device_count()):#list all available audio devices
dev = p.get_device_info_by_index(i)
print((i,dev[’name‘],dev[‚maxInputChannels‘]))
Ausgabe:
(0, u’seeed-2mic-voicecard: – (hw:0,0)‘, 2L)
(1, u’sysdefault‘, 128L)
(2, u’playback‘, 0L)
(3, u’capture‘, 128L)
(4, u’dmixed‘, 0L)
(5, u’array‘, 2L)
(6, u’dmix‘, 0L)
(7, u’default‘, 128L)
[/code]
Scheinbar nutzt sopare immer das default Gerät, wird auch immer bei der Ausgabe der
test_audio.py angezeigt „DEBUG:sopare.audio_factory:maxInputChannels: 128
DEBUG:sopare.audio_factory:name: default“,
war auch beim 4MicArray so…. und ging deshalb vielleicht nicht.
Die Soundconfig wird bei der Treiberinstallation der Arrays vorgenommen, die
Erkennung funktioniert auch und ist über arecord ohne Angabe der Hardware möglich.
asound.conf
[code]
# The IPC key of dmix or dsnoop plugin must be unique
# If 555555 or 666666 is used by other processes, use another one
pcm.!default {
type asym
playback.pcm „playback“
capture.pcm „capture“
}
pcm.playback {
type plug
slave.pcm „dmixed“
}
pcm.capture {
type plug
slave.pcm „array“
}
pcm.dmixed {
type dmix
slave.pcm „hw:0,0“
ipc_key 555555
}
pcm.array {
type dsnoop
slave {
pcm „hw:0,0“
channels 2
}
ipc_key 666666
}
[/code]
Warum nutzt sopare aber ein anderes Gerät? Wie kann ich das verhindern?
[code]
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.phoneline
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only
playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only
capture stream
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only
playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only
capture stream
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
test_audio init…
DEBUG:sopare.audio_factory:#### Default input device info #####
DEBUG:sopare.audio_factory:defaultSampleRate: 48000.0
DEBUG:sopare.audio_factory:defaultLowOutputLatency: 0.125
DEBUG:sopare.audio_factory:defaultLowInputLatency: 0.125
DEBUG:sopare.audio_factory:maxInputChannels: 128
DEBUG:sopare.audio_factory:structVersion: 2
DEBUG:sopare.audio_factory:hostApi: 0
DEBUG:sopare.audio_factory:index: 7
DEBUG:sopare.audio_factory:defaultHighOutputLatency: 0.125
DEBUG:sopare.audio_factory:maxOutputChannels: 128
DEBUG:sopare.audio_factory:name: default
DEBUG:sopare.audio_factory:defaultHighInputLatency: 0.125
Expression ‚alsa_snd_pcm_hw_params_set_rate_near( pcm, hwParams, &setRate, NULL
)‘ failed in ’src/hostapi/alsa/pa_linux_alsa.c‘, line: 3201
Expression ‚paUnanticipatedHostError‘ failed in ’src/hostapi/alsa/pa_linux_alsa.c‘, line:
2053
Expression ‚PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self-
>primeBuffers, hwParamsCapture, &realSr )‘ failed in ’src/hostapi/alsa/pa_linux_alsa.c‘,
line: 2719
Expression ‚PaAlsaStream_Configure( stream, inputParameters, outputParameters,
sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )‘
failed in ’src/hostapi/alsa/pa_linux_alsa.c‘, line: 2843
ERROR:sopare.audio_factory:Error: [Errno -9999] Unanticipated host error
Expression ‚alsa_snd_pcm_hw_params_set_rate_near( pcm, hwParams, &setRate, NULL
)‘ failed in ’src/hostapi/alsa/pa_linux_alsa.c‘, line: 3201
Expression ‚paUnanticipatedHostError‘ failed in ’src/hostapi/alsa/pa_linux_alsa.c‘, line:
2053
Expression ‚PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self-
>primeBuffers, hwParamsCapture, &realSr )‘ failed in ’src/hostapi/alsa/pa_linux_alsa.c‘,
line: 2719
Expression ‚PaAlsaStream_Configure( stream, inputParameters, outputParameters,
sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )‘
failed in ’src/hostapi/alsa/pa_linux_alsa.c‘, line: 2843
ERROR:sopare.audio_factory:Error: [Errno -9999] Unanticipated host error
ERROR:sopare.audio_factory:Error: Stream not open
testing different SAMPLE_RATEs … this may take a while!
SAMPLE_RATE = 48000
CHUNK = 512
THRESHOLD = 3400
[/code]
Anmerkung: Das System ist gerade neu aufgesetzt, nur die notwendigen Pakete
installiert. Keine manuellen Änderungen vorgenommen!
Antworten
o bishoph says:
Es ist korrekt das SOPARE immer das default nutzt und eine Änderung geht nur
über die ALSA config da dies die Python Schnittstelle von pyAudio ist…
Antworten
Carsten says:
Trozdem Danke für dir Hilfe und das Angebot steht immer noch bzgl. des
4Mic Arrays zu testen 😉
Antworten
…einen Schritt weiter 2Mic-Hat ist jetzt Default, aber wieder ein Problem beim
Ausführen von „./sopare.py -v -t test“
NameError: global name ‚pf‘ is not defined
INFO:sopare.recorder:Buffering not alive, stop recording
INFO:sopare.recorder:stop endless recording
[code]
DEBUG:sopare.audio_factory:#### Default input device info #####
DEBUG:sopare.audio_factory:defaultSampleRate: 44100.0
DEBUG:sopare.audio_factory:defaultLowOutputLatency: 0.0087074829932
DEBUG:sopare.audio_factory:defaultLowInputLatency: 0.00580498866213
DEBUG:sopare.audio_factory:maxInputChannels: 2
DEBUG:sopare.audio_factory:structVersion: 2
DEBUG:sopare.audio_factory:hostApi: 0
INFO:sopare.worker:worker queue runner started
DEBUG:sopare.audio_factory:index: 0
DEBUG:sopare.audio_factory:defaultHighOutputLatency: 0.0348299319728
DEBUG:sopare.audio_factory:maxOutputChannels: 2
DEBUG:sopare.audio_factory:name: seeed-2mic-voicecard: – (hw:0,0)
DEBUG:sopare.audio_factory:defaultHighInputLatency: 0.0348299319728
INFO:sopare.buffering:buffering queue runner
DEBUG:sopare.recorder:SAMPLE_RATE: 48000
DEBUG:sopare.recorder:CHUNK: 512
INFO:sopare.recorder:start endless recording
INFO:sopare.processing:starting append mode
DEBUG:sopare.filter:New window!
Process buffering queue:
Traceback (most recent call last):
File „/usr/lib/python2.7/multiprocessing/process.py“, line 258, in _bootstrap
self.run()
File „/home/sopare/sopare/buffering.py“, line 43, in run
self.proc.check_silence(buf)
File „/home/sopare/sopare/processing.py“, line 74, in check_silence
self.prepare.prepare(buf, volume)
File „/home/sopare/sopare/prepare.py“, line 125, in prepare
self.tokenize(meta)
File „/home/sopare/sopare/prepare.py“, line 50, in tokenize
self.filter.filter(self.buffer, meta)
File „/home/sopare/sopare/filter.py“, line 126, in filter
chunked_norm = self.get_chunked_norm(nfft)
File „/home/sopare/sopare/filter.py“, line 61, in get_chunked_norm
progessive += progessive * pf
NameError: global name ‚pf‘ is not defined
INFO:sopare.recorder:Buffering not alive, stop recording
INFO:sopare.recorder:stop endless recording
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File „/usr/lib/python2.7/atexit.py“, line 24, in _run_exitfuncs
Process worker for filtered data:
Traceback (most recent call last):
File „/usr/lib/python2.7/multiprocessing/process.py“, line 258, in _bootstrap
func(*targs, **kargs)
File „/usr/lib/python2.7/multiprocessing/util.py“, line 325, in _exit_function
self.run()
p.join()
File „/home/sopare/sopare/worker.py“, line 88, in run
File „/usr/lib/python2.7/multiprocessing/process.py“, line 145, in join
obj = self.queue.get()
File „/usr/lib/python2.7/multiprocessing/queues.py“, line 117, in get
res = self._popen.wait(timeout)
File „/usr/lib/python2.7/multiprocessing/forking.py“, line 154, in wait
res = self._recv()
KeyboardInterrupt
return self.poll(0)
File „/usr/lib/python2.7/multiprocessing/forking.py“, line 135, in poll
pid, sts = os.waitpid(self.pid, flag)
KeyboardInterrupt
Error in sys.exitfunc:
Traceback (most recent call last):
File „/usr/lib/python2.7/atexit.py“, line 24, in _run_exitfuncs
func(*targs, **kargs)
File „/usr/lib/python2.7/multiprocessing/util.py“, line 325, in _exit_function
p.join()
File „/usr/lib/python2.7/multiprocessing/process.py“, line 145, in join
res = self._popen.wait(timeout)
File „/usr/lib/python2.7/multiprocessing/forking.py“, line 154, in wait
return self.poll(0)
File „/usr/lib/python2.7/multiprocessing/forking.py“, line 135, in poll
pid, sts = os.waitpid(self.pid, flag)
KeyboardInterrupt
[/code]
Antworten
o bishoph says:
Hi. Dieser o.g. Bug wurde vor geraumer Zeit im testing Branch behoben:
https://github.com/bishoph/sopare/issues/14
Zum Thema Mic Array: Kommt der Input Stream von dem Mic Array gebündelt
rein? Denn das würde erklären warum die Prozessor Last und der Speicher hoch
gehen. Hier müsste man (wo kann ich nicht genau sagen) die einzelnen Input
Streams mixen bzw. den „besten“ extrahieren und nur diesen verwenden….
Antworten
hey,
habe das neue Mic jetzt getestet, und das selbe problem besteht weiterhin, nach kurzer
zeit hängt sich das script anscheinend auf, die cpu geht auf 25% und der memory steigt
immer weiter… wenn ich das ganze jetzt mit ctrl+c beende erhalte ich folgendes:
sopare 1.5.0
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
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
[u’licht‘]
[]
[u’an‘]
[]
[u’licht‘]
[]
[u’an‘, “]
[]
[u’licht‘]
[]
[]
[]
[“, u’an‘]
[]
[u’licht‘]
[]
[u’an‘]
[]
[u’licht‘]
[u’licht‘, “]
[]
[u’an‘]
[]
[u’an‘]
[u’an‘, u’an‘]
[]
[u’licht‘]
[u’licht‘, u’licht‘]
[]
[u’licht‘]
[]
^CProcess worker for filtered data:
Traceback (most recent call last):
File „/usr/lib/python2.7/multiprocessing/process.py“, line 258, in _bootstrap
Traceback (most recent call last):
File „./sopare.py“, line 187, in
self.run()
File „/home/pi/dev/sopare/sopare/worker.py“, line 88, in run
Process buffering queue:
main(sys.argv[1:])
obj = self.queue.get()
File „./sopare.py“, line 108, in main
File „/usr/lib/python2.7/multiprocessing/queues.py“, line 117, in get
recorder.recorder(cfg)
File „/home/pi/dev/sopare/sopare/recorder.py“, line 44, in __init__
self.recording()
res = self._recv()
File „/home/pi/dev/sopare/sopare/recorder.py“, line 95, in recording
KeyboardInterrupt
self.logger.warning(„stream read error „+str(e))
KeyboardInterrupt
Traceback (most recent call last):
File „/usr/lib/python2.7/multiprocessing/process.py“, line 258, in _bootstrap
self.run()
File „/home/pi/dev/sopare/sopare/buffering.py“, line 40, in run
buf = self.queue.get()
File „/usr/lib/python2.7/multiprocessing/queues.py“, line 117, in get
res = self._recv()
KeyboardInterrupt
viele Grüße
Antworten
o bishoph says:
Nee, hilft nicht. Das sieht bei mir genau so aus und ist der normale Ablauf. Die
Frage ist immer noch offen ob das Mic einen Stream mixt oder ob mehrere
Stream parallel ankommen. 25% CPU ist übrigens vollkommen normal. Ruf mal
„top -d 1“ auf und schalte per „1“ in den Core View. Wenn da ein Core dauerhaft
auf 100% läuft kommt der Thread nicht mit der Bearbeitung hinterher.
Antworten
Dominic says:
Was ich eben nur nicht verstehe, dass es beim starten immer kurz
funktioniert und dann auf einmal zammbricht…
Antworten
Dominic says:
hab es jetzt mit einem Pi3 getestet, genau das selbe problem…
Antworten
bishoph says:
bishoph says:
Punkt 2 kann man einfach testen indem man alle Daten löscht und
einen einzigen Test trainiert und gegen diesen testet. Also im
Detail:
rm dict/*.raw
./sopare.py -d „*“
./sopare -t test
./sopare -l
Und dann die CPU beobachten. Geht die Last jetzt wieder auf
100% liegt es am Input Stream. Ich weiß, das der Amazon Echo
aus dem Array den „besten“ extrahiert bzw. aus dem multiplen
Input einen einzigen mixt. Das sollte ALSA auch können…
Antworten
Carsten says:
pcm.snooped {
type dsnoop
slave.pcm „hw:0“ # or whatever
}
Then extract single channels:
pcm.channel1 {
type route
slave {
pcm snooped
channels 2
}
ttable [ [ 1 0 ] ]
}
pcm.channel2 {
type route
slave {
pcm snooped
channels 2
}
ttable [ [ 0 1 ] ]
}
Then put a softvol on each of them:
pcm.channel1_softvol {
type softvol
slave.pcm channel1
control.name „Channel 1 Capture Volume“
}
pcm.channel2_softvol {
type softvol
slave.pcm channel2
control.name „Channel 2 Capture Volume“
}
Then merge them into a single device:
pcm.mixed_with_volumes {
type multi
slaves {
a { pcm channel1_softvol channels 1 }
b { pcm channel2_softvol channels 1 }
}
bindings [
{ slave a channel 0 }
{ slave b channel 0 }
]
}
… and use a plug plugin to mix the channels together:
pcm.my_device {
type plug
slave.pcm mixed_with_volumes
ttable [ [ 0.5 0.5 ] ]
}
Dominic says:
bishoph says:
Zur Soundkarte Kann ich nicht viel sagen, ich bin da eher
Entwickler und Software lastig 😉
25. JR says:
Good day! How can I make it run upon boot up? I want to make the raspberry pi run the
endless loop upon start up. Thank you!
Antworten
o bishoph says:
You can start SOPARE as a service. There are plenty of examples how to add a
Python script as a service. I can add my own start/stop script to GitHub and cover
this topic in combination with the plugins in the next video. Stay tuned – I should
have time in the next few weeks to do the next video tutorial.
Antworten
über „sudo arecord -D capture_mono -c 1 -r 48000 test.wav“ kann ich jetzt mono
aufnehmen
meine asound.conf
pcm.!default {
type asym
playback.pcm „playback“
capture.pcm „capture_mono“
}
pcm.playback {
type plug
slave.pcm „dmixed“
}
pcm.capture {
type plug
slave.pcm „array“
}
pcm.dmixed {
type dmix
slave.pcm „hw:1,0“
ipc_key 555555
}
pcm.array {
type dsnoop
slave {
pcm „hw:1“
}
ipc_key 666666
}
pcm.channel1 {
type route
slave {
pcm array
channels 2
}
ttable [ [ 1 0 ] ]
}
pcm.channel2 {
type route
slave {
pcm array
channels 2
}
ttable [ [ 0 1 ] ]
}
pcm.channel1_softvol {
type softvol
slave.pcm channel1
control.name „Channel 1 Capture Volume“
}
pcm.channel2_softvol {
type softvol
slave.pcm channel2
control.name „Channel 2 Capture Volume“
}
pcm.mixed_with_volumes {
type multi
slaves {
a { pcm channel1_softvol channels 1 }
b { pcm channel2_softvol channels 1 }
}
bindings [
{ slave a channel 0 }
{ slave b channel 0 }
]
}
pcm.capture_mono {
type plug
slave.pcm mixed_with_volumes
ttable [ [ 1 1 ] ]
}
Antworten
o bishoph says:
Das sieht sehr hilfreich aus für alle Multi-Channel oder Multi-Array-Mics. Danke
für die Config!
Antworten
mit -c 2 nimmt er zwar Stereo auf, aber ein Kanal hat Stille, also Mono 😉
Antworten
o bishoph says:
Hi, Mono ist der default für SOPARE. Also alles super.
Antworten
Ich komme einfach nicht voran. Jetzt macht die Queue Probleme, test/test_audio.py bleibt
beim chunk-test „stehen“? Ich habe auch schon die SAMPLE_RATES und die CHUNKS
Auswahl minimiert.
SAMPLE_RATES = [ 16000, 44100, 48000 ]
CHUNKS = [ 512, 2048, 4096 ]
Wenn ich dann mit STRG+C abbrechen möchte weil es nicht mehr weiter geht, wird mir
angezeigt:
Das Programm wird aber nicht beendet, muss die Putty-Sitzung dann beenden.
Es bleibt auch alles willkürlich hängen, mal bei Chunks 512, mal bei 2048 … auch
volume hab ich mir mal anzeigen lassen, mal geht es in die tausender hoch, mal bleibt es
bei 713 hängen, mal läuft die Schleife mehrere Male durch, dann nur einmal… Es spielt
auch keine Rolle, ob das Mic in Mono oder Stereo läuft, bleibt beides mal hängen.
Pi 3 B,
Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l
GNU/Linux
Antworten
o bishoph says:
Nope, leider keine Idee außer dem was ich zuvor schon gesagt habe: Ich denke
das ein Mic-Array eine spezielle Ansteuerung bzw. Handling benötigt…
Antworten
bzgl. Mic Array hab ich mal ne Anfrage unter Issues gestellt bzgl der Verwendung von
arecord anstelle von pyaudio. Sind auch die Links zu einem Projekt dabei. Da wird auch
die Queue anders erzeugt, CPU Last ist auch geringer. Vllt. ist es ja ne Option und für
uns alle hilfreich… 🙂
Antworten
30. Carsten says:
…🙂
Aufnahme klappt, ist auch Mono… aber s. Fehler am Ende…
sopare 1.5.2
DEBUG:sopare.audio_factory:#### Default input device info #####
DEBUG:sopare.audio_factory:defaultSampleRate: 44100.0
DEBUG:sopare.audio_factory:defaultLowOutputLatency: 0.0087074829932
DEBUG:sopare.audio_factory:defaultLowInputLatency: 0.00580498866213
DEBUG:sopare.audio_factory:maxInputChannels: 2
DEBUG:sopare.audio_factory:structVersion: 2
DEBUG:sopare.audio_factory:hostApi: 0
DEBUG:sopare.audio_factory:index: 2
DEBUG:sopare.audio_factory:defaultHighOutputLatency: 0.0348299319728
INFO:sopare.worker:worker queue runner started
DEBUG:sopare.audio_factory:maxOutputChannels: 2
DEBUG:sopare.audio_factory:name: seeed-2mic-voicecard: – (hw:1,0)
DEBUG:sopare.audio_factory:defaultHighInputLatency: 0.0348299319728
INFO:sopare.buffering:buffering queue runner
DEBUG:sopare.recorder:SAMPLE_RATE: 16000
DEBUG:sopare.recorder:CHUNK: 512
INFO:sopare.recorder:start endless recording
INFO:sopare.processing:starting append mode
DEBUG:sopare.filter:New window!
Process buffering queue:
Traceback (most recent call last):
File „/usr/lib/python2.7/multiprocessing/process.py“, line 258, in _bootstrap
self.run()
File „/home/sopare/sopare/buffering.py“, line 43, in run
self.proc.check_silence(buf)
File „/home/sopare/sopare/processing.py“, line 74, in check_silence
self.prepare.prepare(buf, volume)
File „/home/sopare/sopare/prepare.py“, line 126, in prepare
self.tokenize(meta)
File „/home/sopare/sopare/prepare.py“, line 50, in tokenize
self.filter.filter(self.buffer, meta)
File „/home/sopare/sopare/filter.py“, line 126, in filter
chunked_norm = self.get_chunked_norm(nfft)
File „/home/sopare/sopare/filter.py“, line 62, in get_chunked_norm
i += int(progessive)
OverflowError: cannot convert float infinity to integer
INFO:sopare.recorder:Buffering not alive, stop recording
INFO:sopare.recorder:stop endless recording
und bitte nicht alles aufs Array schieben, ich habe es jetzt schon zu einem Mono-Mic
kastriert 😉
Antworten
o Carsten says:
der Fehler kommt übrigens auch, wenn ich eine wav oder raw Datei einlese.
Antworten
o bishoph says:
Antworten
habe mich jetzt bisschen mit den Einstellungen rum gespielt und den Chunk-Size auf
1024 erhöht und das ganze mal länger getestet und jetzt scheint es zu laufen 🙂
viele Grüße
Antworten
o bishoph says:
Antworten
sir,
first time i have installed SOPARE successfully and get Result [test] but now i am facing
this error can you please help me…
sopare 1.5.0
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.front.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown 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 confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround40.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround71.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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
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
INFO:sopare.analyze:checking for plugins…
DEBUG:sopare.analyze:loading and initialzing plugins/print
DEBUG:sopare.audio_factory:#### Default input device info #####
Traceback (most recent call last):
File „./sopare.py“, line 187, in
main(sys.argv[1:])
File „./sopare.py“, line 108, in main
recorder.recorder(cfg)
File „/home/pi/dev/sopare/sopare/recorder.py“, line 44, in __init__
self.recording()
File „/home/pi/dev/sopare/sopare/recorder.py“, line 82, in recording
self.stream = self.audio_factory.open(self.cfg.getintoption(’stream‘, ‚SAMPLE_RATE‘))
File „/home/pi/dev/sopare/sopare/audio_factory.py“, line 36, in open
for k, v in self.pa.get_default_input_device_info().iteritems():
File „/usr/lib/python2.7/dist-packages/pyaudio.py“, line 949, in
get_default_input_device_info
device_index = pa.get_default_input_device()
IOError: No Default Input Device Available
INFO:sopare.worker:worker queue runner started
INFO:sopare.buffering:buffering queue runner
Antworten
o bishoph says:
If you get results you have to kill the processes with the command
kill -3 PROCESS_ID
Antworten
Antworten
o bishoph says:
I want to mention that I get the error „-9988“ with one microphone (don’t appear
with other microphones) so this issue is definitely hardware depended. Even it is
annoying, the message is necessary because the issue effects the precision
slightly. But as you said correctly it can be suppressed.
Antworten
Antworten
o bishoph says:
Hi, seems you messed up the plugin directory. The error highlights that a (sub)
directory does not contain the necessary __init__.py file as the module „__init__
(you should avoid this as directory name!) is not available. Learn more:
https://docs.python.org/3/tutorial/modules.html#packages
And you should clean up your alsa.conf as most of the output comes from ALSA!
Antworten
pi@raspberrypi:~/dev/sopare $ ./sopare.py -l
sopare 1.5.0
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 confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround40.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround71.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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
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
ERROR:sopare.analyze:ImportError: No module named __init__
ERROR:sopare.analyze:ImportError: No module named __init__
[]
[]
[]
[u’LIGHTON‘]
[u’LIGHTON‘]
[u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘]
[u’LIGHTON‘, u’LIGHT‘]
[u’LIGHTON‘, u’LIGHT‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[“, u’LIGHT‘]
[“, u’LIGHT‘]
[“, u’LIGHT‘]
[“, u’LIGHT‘, “, u’LIGHTON‘]
[“, u’LIGHT‘, “, u’LIGHTON‘]
[“, u’LIGHT‘, “, u’LIGHTON‘]
[“, u’LIGHT‘, “, u’LIGHTON‘, u’LIGHTON‘]
[“, u’LIGHT‘, “, u’LIGHTON‘, u’LIGHTON‘]
[“, u’LIGHT‘, “, u’LIGHTON‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHTON‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHTON‘, u’LIGHTON‘]
[u’LIGHTON‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHTON‘, u’LIGHTON‘]
[]
[]
[]
[]
[]
[]
[u’LIGHTOFF‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHT‘, “]
[u’LIGHTOFF‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHT‘, “]
[u’LIGHTOFF‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHT‘, “]
[u’LIGHTOFF‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHT‘, “, u’LIGHT‘, “]
[u’LIGHTOFF‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHT‘, “, u’LIGHT‘, “]
[u’LIGHTOFF‘, u’LIGHT‘, u’LIGHTON‘, u’LIGHT‘, “, u’LIGHT‘, “]
[]
[]
[]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
„““
Copyright (C) 2015 – 2017 Martin Kauss (yo@bishoph.org)
Licensed under the Apache License, Version 2.0 (the „License“); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
GPIO.setmode(GPIO.BOARD)
LIGHT = 17
GPIO.setup(LIGHT, GPIO.OUT)
def run(readable_results, data, rawbuf):
if(len(readable_results) == 1 and readable_results[0] == ‚LIGHTON‘):
GPIO.output(LIGHT, GPIO.HIGH)
elif(len(readable_results) == 1 and readable_results[0] == ‚LIGHTOFF‘):
GPIO.output(LIGHT, GPIO.LOW)
Antworten
o bishoph says:
Antworten
Hey,
when i run python test/test_audio.py
test_audio init…
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
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
testing different SAMPLE_RATEs … this may take a while!
Antworten
o bishoph says:
https://www.alsa-project.org/main/index.php/Matrix:Main
Antworten
Moin,
[stream]
# Sample rate
SAMPLE_RATE = 16000
#mehr kann das Mic nicht
# Characteristic length
CHUNKS = 2048
#########################################################
# Characteristic configuration options ##################
#########################################################
[characteristic]
#########################################################
# Compare configuration options #########################
#########################################################
[compare]
SIMILARITY_NORM = 0.7
SIMILARITY_HEIGHT = 0
SIMILARITY_DOMINANT_FREQUENCY = 0
SIMILARITY_ZERO_CROSSING_RATE = 0.3
#bisher die besten Ergebnisse damit, hab fast alles probiert!
Danke
Antworten
o Carsten says:
[stream]
# Sample rate
SAMPLE_RATE = 16000
# Volume threshold when audio processing starts / silence
THRESHOLD = 500
# Characteristic length
CHUNKS = 2048
#########################################################
# Characteristic configuration options ##################
#########################################################
[characteristic]
#########################################################
# Compare configuration options #########################
#########################################################
[compare]
[misc]
#########################################################
# Experimental configuration options ####################
#########################################################
[experimental]
Antworten
o bishoph says:
PROGRESSIVE_FACTOR = 0
START_PROGRESSIVE_FACTOR = 600
MIN_PROGRESSIVE_STEP = 5
MAX_PROGRESSIVE_STEP = 5
MIN_START_TOKENS = 3
MARGINAL_VALUE = 0.8
MIN_CROSS_SIMILARITY = 0.85
Ebenfalls sehr wichtig diese beiden Werte, die als Filter fungieren (am besten
hoch anfangen und dann runter gehen):
MIN_LEFT_DISTANCE = 0.9
MIN_RIGHT_DISTANCE = 0.7
Da das alles stark abhängig ist von der Umgebung, Training und Hardware ist
eigenes austesten unumgänglich…
Eventuell bekommt man aber auch mit der niedrigen Sample Rate keine besseren
Resultate … meine Sample Rate liegt bei 48000, JFYI.
Antworten
Carsten says:
Danke für die Antwort, aber kannst die nochmal auf git schreiben bitte?
Hier fehlt die Hälfte von meinem Text, k.a. warum. Lösche am besten die
Frage ganz. 🙂
Danke
Antworten
sir,
first time i have installed SOPARE successfully and get Result [test] but now i am facing
this error can you please help me…
pi@raspberrypi:~/dev/sopare $ ./sopare.py -l
sopare 1.5.0
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.front.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown 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 confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround40.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround71.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
[]
[]
[]
i use usb audio for mic and 3.5 mm jack for speaker
I hope help from you..
thank sir
Antworten
o bishoph says:
Antworten
Hi,
I cannot train it after successfully training it at first day i got my raspberry pi, it says:
please help
Thanks
Antworten
o bishoph says:
Not sure but a quick Internet search shows me that you have issues with your
ALSA setup. Maybe you installed something manually or your ALSA config is
muddled.
As far as I can tell the above error messages are not related to SOPARE which
means I can’t really help.
Antworten
Hello, im am using SOPARE for voice control and came across some questions
thanks
Antworten
o bishoph says:
Hi. Speech independent in terms of sound recognition: yes. There is no real limit
but too many commands will lead to lag/delay as the current word identification
mechanism needs an optimization/overhaul.
Antworten
************************************************************************
**
testing different SAMPLE_RATEs … this may take a while!
Gruss georg
Antworten
o bishoph says:
Will take a look whenever I have some more time 😉 Thx for the report!
Antworten
Hi,
Thanks
Antworten
o bishoph says:
Hi. Not sure and never tried it but to differentiate extremely short sounds is
difficult. Try to use the visualization feature from SOPARE and check if the
sound waves and the frequencies differ. Also this gives you an indication about
length and frequency ranges. Furthermore I can imagine that you need a good
microphone and some nearly noise free environment and you need to make sure
that the training and sounds are made under the same conditions. Finally: with the
right config it could work but you have to test it out – I can’t provide any
guaranty 😉
Have fun 🙂
Antworten
43. alvin says:
hello, i am nearly completing my project, i only need to detect my hand clap, dont care
about the others, but i notice that there are some sound pattern that sopare recognize as „a
hand clap“ but surely it is not a clap, for example a sound of a creaking door, keys hitting
my desk, etc.. I also tried to see the minimum left and right distance using the verbose
parameter in sopare, but the thing is they are practically similar (the difference is only 0.1
or less) and i found no way to differentiate these sound patterns with the actual handclap.
I have also tried modifying the SIMILARITY value combination but still no luck
is there any other way to overcome this? btw, i can only use CHUNK=1000 and
CHUNKS=4000 otherwise after some time the mic will stop working (input overflow
error will appear)
thanks
Antworten
o bishoph says:
Antworten
Thank you for this wonderful project! I am having issues with recognizing two words. I
can train each word individually, but when attempting to use your example to only
execute a plugin when two words are spoken I am not getting the correct response. How
can I adjust the configuration to accept more than one word at a time?
Thank you again, this is an awesome project to work on!
Antworten
o bishoph says:
You can and should write your own plugin. Inside the plugin you can decide
when and what triggers your custom actions. Here is an example which controls a
robotic arm with one and two commands:
https://github.com/bishoph/Misc/blob/master/robotic_arm_control.py
Antworten
Hi Martin,
First at all congratulations for your work with Sopare I have been doing some research I
have found your work the most convenient around.
I’m planning to import Pygame to play the sound and also I’m using ReSpeaker Pi Hat (
http://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT) for sound and microphone
managing, I have setup ReSpeaker and ALSA recognizes it well microphone and sound
on my Raspberry Pi 3. Do you think my ecosystem is compatible with Sopare?
Best,
Gonzalo
Antworten
o bishoph says:
Hola Gonzalo,
thanks for your kind words.
Antworten
Antworten
o bishoph says:
I talked about the overall process roughly here and here. As you can configure
certain types the answer depends a lot on the individual configuration. But from a
high level perspective the features derive from the frequency spectrum and from
the domain data itself. But you can also mix in stuff like zero crossing. The
classification (I would not call it so) is a more or less a distance calculation for all
used and configured features.
Antworten
Hi,
Got it working but after ending the endless loop by crtl-z I get the + Stopped message and
can not start Sopare again. Instead get the message IOerror: No default input device
available. Probably the mic is not released or something
Any idea what I’m doing wrong here? DO I need to stop Sopare some other way?
Also, If you would want to have Sopare running continously, how to make sure it starts at
boot?
Thanks.
regards,
Hein
Antworten
o bishoph says:
Hi. Seems that there is still a SOPARE python process running. Find the process
and kill k
Antworten
enaam says:
can you please explain the method of feature extraction and classification
that used in this recognition?
Antworten
bishoph says:
Antworten
Inaam says:
bishoph says:
If you got the answer and it was helpful I’m delighted. And
hopefully you was able to fix your other problem. Have fun
🙂
Question: how do you take Sopare out of its infinite loop if you want to learn it some
more commands?
Kind regards,
Hein
Antworten
o bishoph says:
17. September 2018 at 18:08
Thanks 🙂
Start SOPARE without the „-l“ option. When SOPARE is running you can stop it
by using CTRL-C or just kill the process with the „kill“ command. Hope that
helps.
Antworten
Hi,
One other question: does Sopare do a lot of writes to SD cards ? Reason I ask is because I
have domoticz running on my Pi and the Pi in turn is using an SD card. Known issues
with SD is that lots of writes have a negative effect on the lifespan of the card.
regards,
Ronald
Antworten
o bishoph says:
Hi.
SOPARE writes when you train and compile the dict or have the -w option
enabled. And of course if you redirect the logging to a file. Other than that
SOPARE does not write at all. I have several (nolt only SOPARE) instances
running 24/7 since years while using tempfs for some heavy write directories (like
/var/log or /tmp and whathaveyou) and never had any sd card corruptions.
My tip: Just don’t by the cheapest sd cards on the market and make sure to have
enough space on the card for the OS to mark bad blocks and potentially for wear
leveling.
Antworten
50. mallu says:
pi@raspberrypi:~ $ cd
pi@raspberrypi:~ $ mkdir dev
pi@raspberrypi:~ $ cd dev
pi@raspberrypi:~/dev $ git clone https://github.com/bishoph/sopare.git
bash: git: command not found
pi@raspberrypi:~/dev $ cd sopare
bash: cd: sopare: No such file or directory
pi@raspberrypi:~/dev $ ^C
pi@raspberrypi:~/dev $ cd
pi@raspberrypi:~ $ sudo apt-get install git
Reading package lists… Done
Building dependency tree
Reading state information… Done
git is already the newest version.
The following packages were automatically installed and are no longer required:
coinor-libipopt1 libboost-atomic1.55.0 libboost-filesystem1.55.0
libboost-program-options1.55.0 libboost-regex1.55.0 libboost-thread1.55.0
libc-ares2 libffi5 libgmime-2.6-0 libmng1 libmumps-seq-4.10.0 liboauth0
libqt4-dbus libqt4-xml libqt5concurrent5 libqt5core5a libqt5dbus5 libqt5gui5
libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5svg5 libqt5widgets5
libqtdbus4 libqtgui4 libraw10 libruby2.1 libscsynth1 libv8-3.14.5
libxcb-icccm4 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xkb1
libxkbcommon-x11-0 libyaml-0-2 qdbus qtchooser qttranslations5-l10n ruby
ruby2.1 rubygems-integration wolframscript
Use ‚apt-get autoremove‘ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
pi@raspberrypi:~ $ ^C
pi@raspberrypi:~ $ sudo apt-get install gicd dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package gicd
E: Unable to locate package dev
pi@raspberrypi:~ $ cd
pi@raspberrypi:~ $ mkdir dev
mkdir: cannot create directory ‘dev’: File exists
pi@raspberrypi:~ $ cd dev
pi@raspberrypi:~/dev $ git clone https://github.com/bishoph/sopare.git
bash: git: command not found
pi@raspberrypi:~/dev $ git clone https://github.com/bishoph/sopare.git
bash: git: command not found
pi@raspberrypi:~/dev $ cds
bash: cds: command not found
pi@raspberrypi:~/dev $ cd
pi@raspberrypi:~ $ cd wiringPi
bash: cd: wiringPi: No such file or directory
pi@raspberrypi:~ $ sudo apt-get install git-core
Reading package lists… Done
Antworten
o bishoph says:
What the heck? This is a weird mix of mistakes you made…not sure what to say
😉
Antworten
Hi,
After unavailing with few voice engines,Sopare was the one i got successfully working.
Thank you for a user-friendly voice recognition software. I was able to successfully
control GPIO’s with it. Now wanted to know if it can be combined with Google Assistant
on raspberry pi to control GPIO pins.
Antworten
o bishoph says:
Have fun!
Antworten
Hi,
I want to input sound to SoPaRe via bluetooth instead of a usb microphone. How do you
suggest I go about with that?
So far I have installed and trained SoPaRe for a few words and am achieving decent
accuracy.
I will require to do the bluetooth section for my next prototype.Could you please give me
a few guidelines on that?
Antworten
o bishoph says:
If you mean a Bluetooth mic than this could work if you get it to work with the
ALSA stack (PulseAudio or Bluetooth Audio ALSA Backend). If you mean your
own Bluetooth stack with all the device stuff, pairing and the communication than
I can’t give you suggestions or advice as this is beyond the scope and way to
complicated.
Antworten
hi
when i execute sopare i have got this error:
Error:sopare.analyze:ImportError: No module named _init_
can you please explain the reason for this error
Antworten
o bishoph says:
Antworten
HI!!
Could you help tell me what file/function the output that appears in the terminal is
coming from when the program is run in -l? I would like to continuously check the
output….
Thank YOU!
Antworten
o bishoph says:
Output is generated all over the places but I hope you mean the example plugin:
https://github.com/bishoph/sopare/blob/master/plugins/print/__init__.py
Antworten
55. J says:
Hi,
fabapi@fabapi:~/Desktop/sopare$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Webcam [C922 Pro Stream Webcam], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Audio recording with this microphones also works. So I don’t know why it doesn’t work
in Sopare. Do I have to specify something somewhere? Thanks!
Antworten
o bishoph says:
Seems that your mic is not configured correctly…make your mic the default in
ASLA and it should work.
Antworten
We plan to create a voice operated wheelchair.So if I use Sopare based voice recognition
will I be able to react to only the voices of trained users.Or will be reactive to every user
who speaks the command.(Speaker based or just command based)
Antworten
o bishoph says:
Depends on your training and your settings. If you train a specific voice command
from one speaker and have strict settings only a specific voice will be recognized.
Antworten
Why did you stop updating the code? This looks like a fun project!
Antworten
o bishoph says:
I currently have other projects and higher priorities. That said, I’ll continue to
make optimizations and changes as my TODO list contains still items I want to
solve and to try 😉
Antworten
I love SOPARE on my Pi 3. Is there a ghost of a chance that SOPARE, looking for one
command, might work on a Pi Zero?
Antworten
o bishoph says:
As the zero is a multi core device it could work already. I can’t say for sure how
good as this depends on dict size, threshold and some other things. Give it a try. If
the load is too high and the recognition is delayed than I’m sorry but I can’t do
much right now. In the future we might see performance optimizations and a
better Pi zero support…;)
Antworten
Hello! I recently used sopare to control an Arduino powered robot however some of the
time the program will stop and not start again, I believe that this is due to one of the cores
having too much to do and stopping, is it possible to transfer the work across to two
cores? Is there anything else you recommend?
Also doubt it was my plugin as I have the same issue without it, and I know it is one core
out of the 4 because it always says it is under 25% stress when it stops.
Antworten
o bishoph says:
Without further information I can only guess. Let us try to shed some light into
this. The following issues are responsible for a potential high load:
If you encounter high load you can try to remove some trained words from the
dict, lower the sample rate or use a higher threshold.
Other than that, increase the precision and filter out false positives before such
words are compared expensively.
Hope that gives you some ideas what you can optimize by yourself 🙂
Have fun!
Antworten
BlakeG says:
Hi, I have since tried to lower the dict word amount to 16 for 4 words;
forwards, stop, left, right. This does not help the issue, I have also lowered
the sample rate to 5 and have the issue. Finally I adjusted the threshold so
no words other than the trained ones are herd, and the issue is the same.
More information is that after the crash were nothing happens and I have
to restart sopare, the % of used power from the CPU is 3 when resting and
18 at maximum, then when it crashes it reaches 25 to 26 and stays there
until I restart.
Antworten
bishoph says:
However, if you say crash than you get an error message we can
work on. File a bug report, tell us how to reproduce and attach
stuff that matters like OS environment, used versions, settings,
config, output, error messages, stack traces and what have you to
make sure we can fix the issue.
Antworten
BlakeG says:
bishoph says:
Dear Bishop,
first of all, thankyou for Sopare. Great work and very nice technical explanation of your
system.
I would liketo to use Sopare into my simple project (activate some outputs via voice) on
Rpi 3. I modified the simple rate and the sound threshold as suggested by the test
program and I prepared the dictionary (6 words each repeated 3 times). When ./sopare -l
starts, I am in the same situation described by BlackeG. The software stops to recognize
the voice randomly; it seems to be freezed after some words.
–> config:
CHUNK = 512;
SAMPLE_RATE = 48000;
THRESHOLD = 250;
Best Regards,
Rino
Antworten
o bishoph says:
11. Januar 2019 at 16:32
Top indicated that there are plenty of resources left. A 4 core CPU can work
through a load of 4 and still run smoothly. I would check if the THRESHOLD is
too low. There is a good change that your environment encounters some
background noise, even in frequencies you don’t hear. This means SOPARE
checks constantly against a noisy environment. In fact, the only time when the
analysis starts is when the timeouts hit. And this can be seen as kind of hiccup.
Antworten
Rino says:
Antworten
bishoph says:
If the stream is closed SOPARE don’t get further audio data from
pyAudio and stops/hangs/waits until more data is available.
Can you post how do a plugin for the on off light and the code i will appreciate soo much
hugs from Chile soouth America Claudio
Antworten
o bishoph says:
As I’m using my own home control system the code would not help as you don’t
have the interface. What system or service do you want to use?
Antworten
Does SOPARE works in Windows?. Currently I am using python 3.4.1 and windows 7. I
tried to run SOPARE in python 2.7.12 version in windows it is unable to handle multi-
threading.
Antworten
o bishoph says:
Never tried and I really don’t know as the development platform and the target
platform is Raspberry Pi in combination with a Linux OS like Raspbian. If you
are able to solve the dependencies it could work…
Antworten
63. ravikumar says:
Antworten
o bishoph says:
Yes. This is an error regarding git, SSH and maybe lots of other stuff. Just fix
your system and have fun 🙂
Antworten
Can this sopare can work using broadlink for home automation
Antworten
o bishoph says:
SOPARE has no builtin function for „Broadlink Home Automation“. But you can
implement whatever you want using a custom plugin. Hope that answers your
question.
Antworten
Antworten
o bishoph says:
Yes, sure. I provide a start/stop script including helpful information about the
usage and setup:
https://github.com/bishoph/Misc/blob/master/sopare_service
Antworten
Hi, is there a way to select the audio device that SOPARE records from please? I have a
USB microphone but editing the alsa conf files does not seem to allow me to set a default
device. I know, however, that calling it directly e.g. arecord -d 3 -D plughw:2 test.wav
allows me to access the microphone. Is this possible with python?
Cheers,
Z
Antworten
o bishoph says:
Between SOPARE and the hardware are many layers of abstraction. Therefore the
right way is to define the default card in ALSA:
https://www.alsa-project.org/main/index.php/Asoundrc
~/.asoundrc
Antworten
hi martin i m a big fan of your work currently working on your project can you please
provide me the code of light on and light on gpio basically i m new to pi
Antworten
o bishoph says:
Thx, but I don’t have any GPIO code I could provide. SOPARE code and also
examples are available on GitHub: https://github.com/bishoph/
Have fun!
Antworten
68. AP says:
I got the program installed and then got my alsa file cleaned up, but I’m still seeing errors
when I run the two tests. I think they are mostly on the test_audio.py one, but I included
both sets of results here.
SAMPLE_RATE = 48000
CHUNK = 512
THRESHOLD = 100
Any suggestions?
Antworten
o bishoph says:
Nope. Everything is fine. The SOPARE test was successful and you got
everything you need to proceed.
Antworten
AP says:
Ok, I did the training (for „test“), when I run the listener I get the output
below.
===============
sopare 1.5.0
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
[]
[]
[u’test‘]
[]
[u’test‘]
[]
[]
[]
[]
[u’test‘]
[]
^CTraceback (most recent call last):
=========
What are the errors about „Cannot connect to server“ and „jack server“
about?
Antworten
bishoph says:
This are ALSA warnings and are not related to SOPARE. You can
a) ignore them
or
b) try to get rid of them.
Antworten
sopare 1.5.0
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.front.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown 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 confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround40.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround51.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.surround71.0:CARD=0‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition
‚cards.bcm2835_alsa.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2‘
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error:
No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM spdif
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
Antworten
o bishoph says:
This is not an error message related to SOPARE. 99% of the output comes from
ALSA and you get rid of it by cleaning up your ALSA config,
Antworten
Sean says:
I cant see any error messages in the ALSA config. What am i looking for?
Antworten
bishoph says:
Let’s try to figure this out. As neither SOPARE nor ALSA shows
error messages you can just leave it as it is and it should work. But:
as the ALSA output is cluttered with warnings I recommend to
clean up your ALSA configuration.
This can be cone by simply commenting out unused devices in
your alsa.conf (like in your case the PCM stuff):
Place a „#“ in front of the lines that appear in the warnings, save
the file and test if everything works. Before you start make a copy
of the file just to be safe:
Antworten
Hi, thank you for your great work on this. But I’m running into trouble. I have installed
SOPARE succesfully and both test runs successfully.
But when trying to learn the „test“ word (or any word) I get the following error:
Just in case, I have also waited a while before speaking my test word. To see if it would
still record noise. But then the number won’t run on the screen. But as soon as I say the
word test, the number run and before I can say test for the second time it stops recording.
I have ubuntu 18.04 (I know, not a RPi) and followed your tutorial for installing
SOPARE.
Antworten
o bishoph says:
With pleasure. There is no error in your output and I really don’t know what the
problem is…please try to be specific, provide step by step „how to reproduce“
instructions including desired outcome and full output. If you encounter an issue
please file an issue on GitHub for easy tracking/reporting. Thx.
Have fun!
Antworten
onacvooe says:
Thank you, for your answer. I just sorted it out and can confirm it is
working now!
Just one question, I’m trying to send a curl command on recognizing a
word. But I cannot get it tot work. Can you point me in the right direction?
This is what I got in custom my __init__.py
########################### BEGIN
#!/usr/bin/env python
# -*- coding: utf-8 -*-
„““
Copyright (C) 2015 – 2017 Martin Kauss (yo@bishoph.org)
Licensed under the Apache License, Version 2.0 (the „License“); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
headers = {
‚Content-Type‘: ‚text/plain‘,
}
data = ‚OFF‘
response =
requests.post(‚http://192.168.1.253:8080/rest/items/wcd001_schakelaar‘,
headers=headers, data=data)
################################ END
I know that the curl command is correct, but how do I put it correctly in de
init file? Can you help?
Antworten
bishoph says:
Great that it is working for you! As you posted the code without
indentation I could argue that the indentation is missing/wrong.
And the import should be placed on top of the file. I suggest and
recommend that you get familiar with Python programming if you
want to start coding 😉
Antworten
onacvooe says:
Thank you, for all your help. I have put this issue on your
Github and it is already solved. So. But thank you 😉
I do not know anything about Raspberry Pi or programming, but Google had led me to
this page.
Is it possible to use this with a small 12vdc motor to use voice command to make it run
forward or reverse?
Antworten
o bishoph says:
Short answer is yes. The longer answer is that you need experience in Python
development and electronic as you need
a) a SOPARE plugin for your custom motor control
b) a motor shield or maybe just a relay to separate the motor from the PI (at least
2 circuits: GPIO 3.3v and 12v)
Antworten
Hi,
I have been trying to figure out how to get sopare working, and from all the other
comments i see that i need to clear the alsa.conf file. Could you please explain in detail
how to do that, because i can’t find any error messages in it. I have tried using a fresh
install of raspbian stretch on a raspberry pi 3.
Antworten
o bishoph says:
First of all I deleted the alsa configuration from the comment as it makes no sense
to present us a standard alsa.conf in full detail here. Second: You don’t have to
clean the config, you want to clean it. Comment out the hardware/lines that show
up in the ALSA warnings and that are not attached/used. There are already
comments available how to do this:
https://www.bishoph.org/step-by-step-raspberry-pi-offline-voice-recognition-
with-sopare/#comment-234
https://github.com/bishoph/sopare/issues/7
Antworten
Sean says:
„You don’t have to clean the config, you want to clean it.“
What?
I cant find any ALSA warnings in the .conf file
Antworten
bishoph says:
Antworten
Hello sir,
I wanted to ask you what classification method did you used in sopare. Is it Feed forward
Neural network, Recurrent neural networks or HMM ?
Antworten
o bishoph says:
Antworten
Antworten
o bishoph says:
Antworten
That is not voice recognition. It is speech recognition. They are very different things.
Antworten
o bishoph says:
4. September 2019 at 9:47
Antworten
Hi Martin,
SAMPLE_RATE = 48000
CHUNK = 512
THRESHOLD = 0
o bishoph says:
Seems that you have two sound cards and the one that is able to record sound is
not the default card in the ASLA config. As soon as you change this it should
work…
Antworten
Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.
Kommentar
Name *
E-Mail *
Website
Neueste Beiträge
SOPARE architecture and plugins
Step by step: Raspberry Pi offline voice recognition with SOPARE
SOPARE 1.5 is available; Feedback
Sopare precision and accuracy
Sopare basic usage. Voice controlling a magic mirror
Buzzwords
Allgemein Banana Pi Development Mobile Pinball Raspberry Pi smarthome smartphone Solar