Genie Community Forum

Speaker and Mic

Hi guys

In regards to a speaker and mic
Can a bluetooth speaker and mic be used or must it be particular hard?

i was thinking of using Raspberry OS with a Bluetooth speaker and mic

regards
Jeremy

I think it should be possible but I am struggling now with the combination of an old PI 3 V1.2 and a cheap LogiLink SP0051P bluetooth speaker/mic. At the time I’m getting a HTTP 6 error, if I start the genie-client. It might be a problem with the communication chip in the PI 3.

On the genie server side I see the following in the log:

** Message: 11:08:09.371: Loading picovoice model from /usr/local/lib/genie-client/assets/porcupine_params.pv
** Message: 11:08:09.371: Loading wakeword from /usr/local/lib/genie-client/assets/hey-genie/keyword_linux.ppn
Initialized wakeword engine, frame length 512, sample rate 16000
** (genie-client:95901): ERROR **: 11:08:09.375: pa_simple_new() failed: No such entity
genie-client exited with signal SIGTRAP

My next step will be to test the same with a PI 4. I will give an update if I can solve the problem.

As soon as those are seen as mic and speaker by the OS, they should work. But let’s also say that usually the BT mic is always more problematic than the speaker function, so in case you will find some problem, investigate in that direction and check if the input and the output sink are set correctly

Here you can see how is done for the genie-client, but commands are the same

https://wiki.almond.stanford.edu/en/getting-started/installation-guide/raspberry-pi-speaker

I got a step further. I had to remove my selfsigned certificates. Then the genie-client could connect and I can see message from the Home Assistant arriving in the log.
The SP0051 does not work with the PI 3 or the PI 4 because the microphone is not found. But I could connect my USB headset over bluetooth. With Audacity I check the microphone and the sound and everything is working.
But now I am stucked. The port 8000 is still showing the configuration and I still see the above SIGTRAP in the HA genie server log.

This is my genie server logfile:

[17:11:20.227998] exec (../src/app.cpp:112): start main loop
genie::Config-Message: 17:11:20.228: Config key [general] assets_dir missing, using default '/usr/local/lib/genie-client/assets'
genie::Config-Message: 17:11:20.228: Config key [general] retry_interval missing, using default '3000'
genie::Config-Message: 17:11:20.228: Config key [general] connect_timeout missing, using default '5000'
genie::Config-Message: 17:11:20.228: Config key [audio] backend missing, using default 'pulseaudio'
genie::Config-Message: 17:11:20.228: Config key [audio] output missing, using default 'echosink'
genie::Config-Message: 17:11:20.228: Config key [audio] voice missing, using default 'male'
genie::Config-Message: 17:11:20.228: Config key [hacks] wake_word_verification missing, using default 'true'
genie::Config-Message: 17:11:20.228: Config key [hacks] surpress_repeated_notifs missing, using default 'false'
genie::Config-Message: 17:11:20.228: Config key [hacks] dns_server missing, using default '8.8.8.8'
genie::Config-Message: 17:11:20.228: Config key [picovoice] model missing, using default 'porcupine_params.pv'
genie::Config-Message: 17:11:20.228: Config key [picovoice] keyword missing, using default 'hey-genie/keyword_linux.ppn'
genie::Config-Message: 17:11:20.228: Config key [picovoice] sensitivity missing, using default '0.7'
genie::Config-Message: 17:11:20.228: Config key [picovoice] wake_word_pattern missing, using default '^([A-Za-z]+[ .,]? (gene|genie|jeannie|jenny|jennie|dean)|beijing|pg and e|ragini|pagini|paging)[.,]?'
genie::Config-Message: 17:11:20.228: Config key [sound] wake missing, using default 'match.oga'
genie::Config-Message: 17:11:20.228: Config key [sound] no_input missing, using default 'no-match.oga'
genie::Config-Message: 17:11:20.228: Config key [sound] too_much_input missing, using default 'no-match.oga'
genie::Config-Message: 17:11:20.228: Config key [sound] news_intro missing, using default 'news-intro.oga'
genie::Config-Message: 17:11:20.228: Config key [sound] alarm_clock_elapsed missing, using default 'alarm-clock-elapsed.oga'
genie::Config-Message: 17:11:20.228: Config key [sound] working missing, using default 'match.oga'
genie::Config-Message: 17:11:20.228: Config key [sound] stt_error missing, using default 'no-match.oga'
genie::Config-Message: 17:11:20.228: Config key [buttons] evinput_dev missing, using default '/dev/input/event0'
genie::Config-Message: 17:11:20.228: Config key [vad] start_speaking_ms missing, using default '3000'
genie::Config-Message: 17:11:20.228: Config key [vad] done_speaking_ms missing, using default '500'
genie::Config-Message: 17:11:20.228: Config key [vad] input_detected_noise_ms missing, using default '600'
genie::Config-Message: 17:11:20.228: Config key [vad] listen_timeout_ms missing, using default '10000'
genie::Config-Message: 17:11:20.229: Config key [webui] port missing, using default '8000'
** Message: 17:11:20.242: Loading picovoice model from /usr/local/lib/genie-client/assets/porcupine_params.pv
** Message: 17:11:20.242: Loading wakeword from /usr/local/lib/genie-client/assets/hey-genie/keyword_linux.ppn
Initialized wakeword engine, frame length 512, sample rate 16000
** (genie-client:91436): ERROR **: 17:11:20.243: pa_simple_new() failed: No such entity
genie-client exited with signal SIGTRAP

Perhaps some additional background:
I followed exactly the installation guide for the genie client on a raspberry pi 3. I did the same for a raspberry pi 4. Both installation were done from scratch with a new sd card. But it looks like it is not working or I am missing a critical piece. The only thing I can reach is the configuration page on port 8000.

I used the configuration for other HW:

load-module module-echo-cancel source_name=echosrc sink_name=echosink channels=2 rate=48000 aec_method=webrtc
load-module module-role-ducking trigger_roles=voice-assistant ducking_roles=music volume=20% global=true

Was anybody able to install a genie client on a raspberry pi and able to communicate over a microphone with it?

Actually I did personally the test for the installations on all the pi available on market and I wrote this https://wiki.almond.stanford.edu/en/getting-started/installation-guide/raspberry-pi-speaker that I linked above.
The only error in you log “**: 17:11:20.243: pa_simple_new() failed: No such entity” is on pulse audio
https://freedesktop.org/software/pulseaudio/doxygen/simple_8h.html
Did you verified to have all the packages suggested here? https://github.com/stanford-oval/genie-client

I don’t get you comment on the port 8000, because on the genie-client that is the only page you are supposed to see, and is needed for the setup. Is the Genie Server that has a backend (but on port 3000 ).

When you write you can now see the log from HA, it means that you installed Genie server as add on on Home assistant?

Thanks for your help.

I got a step further. I forgot that I have to restart the pulsaudio everytime. Now I can talk over bluetooth to the the genie-client and I see in the logfile, that the genie-client is receiving my voice command. The audio output is not working yet. I have to investigate the problem tomorrow.

in the configuration wiki there is this row “Use alsamixer -D hw:1 to set the volume of the “Headphone” to a non-zero value.” , did you tried it?

and also this other part can help to verify that the output set is correct :

By default the audio ouput is set to the base board one, even after the installation of the ReSpeaker hat, to use the ReSpeaker one use the following bash commands:

pacmd list-sinks

to view the list of outputs and their names (the ReSpeaker should be “alsa_output.platform-soc_sound.stereo-fallback”);

pacmd set-default-sink "alsa_output.platform-soc_sound.stereo-fallback"