Closed loocd closed 1 year ago
I ran into an issue getting this up and running. I see the same error in your logs:
Nov 23 11:26:57 raspberrypi run[3332]: ALSA lib pcm_asym.c:105:(_snd_pcm_asym_open) capture slave is not defined
Nov 23 11:26:57 raspberrypi run[3332]: arecord: main:831: audio open error: Invalid argument
Nov 23 11:26:57 raspberrypi run[3330]: ERROR:root:Unexpected error in mic_task_entry
I was getting this error when it couldn't use whatever default mic of the system was. I needed to specify the mic input and speaker output manually: https://github.com/synesthesiam/homeassistant-satellite#change-microphonespeaker
Thanks @cmsimike for sharing your experience - I'll give that a try!
using arecord -L
I get the following entry (among others)
Unfortunately, I'm not entirely sure what exactly I should put into the --mic-device plughw:...
command - can you give me some pointers?
Here's my outputs and my run command.
pi@pi005:~ $ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
playback
ac108
default
output
sysdefault:CARD=seeed4micvoicec
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
Default Audio Device
dmix:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
Direct sample mixing device
dsnoop:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
Direct sample snooping device
hw:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
Direct hardware device without any conversions
plughw:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
Hardware device with all software conversions
pi@pi005:~ $ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
playback
ac108
default
output
sysdefault:CARD=Headphones
bcm2835 Headphones, bcm2835 Headphones
Default Audio Device
dmix:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct sample snooping device
hw:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Hardware device with all software conversions
With the above, I run it like this:
script/run --mic-device plughw:CARD=seeed4micvoicec,DEV=0 --snd-device plughw:CARD=Headphones,DEV=0
I think anything with the plughw
prefix should work per the docs:
Run arecord -L to list available input devices. Pick devices that start with plughw: because they will perform software audio conversions. Use --mic-device plughw:... to use a specific input device.
Run aplay -L to list available output devices. Pick devices that start with plughw: because they will perform software audio conversions. Use --snd-device plughw:... to use a specific output device.
I've just tried it and the errors have in fact gotten fewer, but I'm still getting an error after accessing the logs:
pascal@raspberrypi:~ $ journalctl -u homeassistant-satellite.service -f
Nov 24 21:57:41 raspberrypi systemd[1]: homeassistant-satellite.service: Main process exited, code=exited, status=1/FAILURE
Nov 24 21:57:41 raspberrypi systemd[1]: homeassistant-satellite.service: Failed with result 'exit-code'.
Nov 24 21:57:43 raspberrypi systemd[1]: homeassistant-satellite.service: Scheduled restart job, restart counter is at 14.
Nov 24 21:57:43 raspberrypi systemd[1]: Stopped homeassistant-satellite.service - Home Assistant Satellite.
Nov 24 21:57:43 raspberrypi systemd[1]: homeassistant-satellite.service: Start request repeated too quickly.
Nov 24 21:57:43 raspberrypi systemd[1]: homeassistant-satellite.service: Failed with result 'exit-code'.
Nov 24 21:57:43 raspberrypi systemd[1]: Failed to start homeassistant-satellite.service - Home Assistant Satellite.
Nov 25 16:18:25 raspberrypi systemd[1]: Started homeassistant-satellite.service - Home Assistant Satellite.
Nov 25 16:18:26 raspberrypi run[3169]: INFO:root:Authenticated to Home Assistant version 2023.11.3
Nov 25 16:18:26 raspberrypi run[3171]: Recording raw data 'stdin' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
But it seems to work despite these errors
Hi all,
I've gone through this guide and am able to manually run the script and send voice commands successfully. However, as soon as I close the command line this is over - plus, if the Pi ever gets powered down I'd have to start the script again.
So I tried setting it up as a service, as described here. Unfortunately, after opening the log I keep seeing this error:
I followed the guide to the dot (at least I think so) and my file looks like this:
I have also noticed that when saving the file, it adds a number at the end of
homeassistant-satellite.service
, but I'm assuming that's normal due to read/write issues?