Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera + voicecontrol Help ! #9

Open
ricardoyen opened this issue Nov 20, 2019 · 1 comment
Open

camera + voicecontrol Help ! #9

ricardoyen opened this issue Nov 20, 2019 · 1 comment

Comments

@ricardoyen
Copy link

pi@raspberrypi:~ $ cd /MagicMirror
pi@raspberrypi:
/MagicMirror $ npm start

[email protected] start /home/pi/MagicMirror
sh run-start.sh

Starting MagicMirror: v2.9.0
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: MMM-Spotify
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
Initializing new module helper ...
Module helper loaded: camera
Initializing new module helper ...
Module helper loaded: voicecontrol
Initializing new module helper ...
Module helper loaded: MMM-Remote-Control
Initializing new module helper ...
Module helper loaded: MMM-Remote-Control-Repository
No helper found for module: MMM-AlarmClock.
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
Initializing new module helper ...
Module helper loaded: MMM-Hotword
Initializing new module helper ...
Module helper loaded: MMM-AssistantMk2
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: MMM-Spotify
[SPOTIFY_AUTH] Token is expired. It will be refreshed
[SPOTIFY_AUTH] Token refreshing...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: camera
camera helper started ...
Connecting socket for: voicecontrol
Connecting socket for: MMM-Remote-Control
Starting node helper for: MMM-Remote-Control
Connecting socket for: MMM-Remote-Control-Repository
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-Hotword
[HOTWORD] MMM-Hotword starts
Connecting socket for: MMM-AssistantMk2
Sockets connected & modules started ...
Launching application.
[SPOTIFY_AUTH] Token is written.
Create new calendar fetcher for url: http://www.officeholidays.com/ics/ics_country.php?tbl_country=South%20Africa - Interval: 300000
initializing nodemailer
Create new news fetcher for url: http://feeds.news24.com/articles/News24/TopStories/rss - Interval: 300000
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924

Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.front.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40

[AMK2] Recipe is loaded: hide_and_show_all_modules.js
[AMK2] Recipe is loaded: reboot.js
[AMK2] Recipe is loaded: screen_onoff.js
[AMK2] Recipe is loaded: shutdown.js
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(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:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
Expression 'alsa_snd_pcm_hw_params_set_period_size_near( pcm, hwParams, &alsaPeriodFrames, &dir )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 924
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
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
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
Traceback (most recent call last):
File "./modules/voicecontrol/snowboy/kws-multiple.py", line 34, in
detector = snowboydecoder.HotwordDetector(models, sensitivity=sensitivity)
File "/home/pi/MagicMirror/modules/voicecontrol/snowboy/snowboydecoder.py", line 115, in init
stream_callback=audio_callback)
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
stream = Stream(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 441, in init
self._stream = pa.open(**arguments)
IOError: [Errno -9997] Invalid sample rate

[AMK2] Temporal storage directory is clearing.
[RCREPO] Repository scanning...
[HOTWORD] begins.
[HOTWORD] Detector starts listening.
[HOTWORD] stops.
[HOTWORD] Final Result: { detected: false }
[HOTWORD] begins.
[HOTWORD] Detector starts listening.
[AMK2] assistant ready
[AMK2] Conversation starts.
[AMK2] Started with text query: brief today
[RCREPO] modules.json is updated.
{ requestId: '5dd49c06-0000-25da-9a33-f403043d6898' } { profileFile: 'default.json', lang: 'en-US' }
[AMK2] Device Action: { requestId: '5dd49c06-0000-25da-9a33-f403043d6898' }
[AMK2] Assistant Text Response:
[AMK2] Conversation Completed
Shutting down server...
Stopping module helper: MMM-Spotify
Stopping module helper: updatenotification
Stopping module helper: calendar
Stopping module helper: camera
Stopping module helper: voicecontrol
Stopping module helper: MMM-Remote-Control-Repository
Stopping module helper: newsfeed
Stopping module helper: MMM-Hotword
Stopping module helper: MMM-AssistantMk2

config.js file below
{
module: 'camera',
position: 'top_center',
config: {
selfieInterval: 3, // Time interval in seconds before the photo will be taken.
emailConfig: {
service: 'Hotmail', // Email provider to use to send email with a photo.
auth: {
user: '[email protected]', // Your email account
pass: '' // Your password for email account
}
}
}
},

	{
		module: 'voicecontrol',
		position: 'bottom_left',
		config: {
			models: [
				{
					keyword: "Show Camera",
					description: "Say 'Show Camera' to display camera",
					file: "ShowCamera.pmdl",
					message: "SHOW_CAMERA"
				},
				{
					keyword: "Hide Camera",
					description: "Say 'Hide Camera' to hide camera",
					file: "HideCamera.pmdl",
					message: "HIDE_CAMERA"
				},
				{
					keyword: "Selfie",
					description: "Say 'Selfie' when camera is visible",
					file: "Selfie.pmdl",
					message: "SELFIE"
				},
			]
		}
	},

i need help, i basically want to intergrate the camera into my magic mirror and get the voice controls to work....

please help

@yax51
Copy link

yax51 commented Nov 15, 2020

It looks like the sampling rate if off on your mic.
Check alsa.conf and modify the value in: defaults.pcm.dmix.rate

You should be able to see what sample rate your device is capable of, and adjust it accordingly with http://www.volkerschatz.com/noise/alsacap.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants