OpenVoiceOS / ovos-installer

Open Voice OS and/or HiveMind installer using Ansible with an intuitive and easy Text-based User Interface
https://www.openvoiceos.org
67 stars 20 forks source link

Issue with installer and ReSpeaker 2 mic hat #154

Closed RichB-1 closed 4 days ago

RichB-1 commented 5 days ago

Hey all,

I'm having an issue using OVOS with the ReSpeaker 2 mic hat. When I try the installer file, it works for a bit, until it gets to 'scan i2c bus for hardware auto-detection' - fail, unable to continue the process...Please share this URL with us: https://dpaste.com/H869MH62L

goldyfruit commented 5 days ago

@RichB-1 could you please run the ovos-installer in DEBUG mode please?

sh -c "curl -s https://raw.githubusercontent.com/OpenVoiceOS/ovos-installer/main/installer.sh -o installer.sh && chmod +x installer.sh && sudo ./installer.sh -d && rm installer.sh"
RichB-1 commented 5 days ago

This is the URL that comes up: https://dpaste.com/A32NSXTQJ

And the information leading after the last successful step of the installation is here: https://dpaste.com/H66BX7L38

goldyfruit commented 5 days ago

dtparam -v i2c_arm=on seems to be the culprit.

RichB-1 commented 5 days ago

Raspberry Pi 5, 8GB, and Raspberry Pi OS x64 (newest version)

goldyfruit commented 5 days ago

Raspberry Pi 5, 8GB, and Raspberry Pi OS x64 (newest version)

I'm not able to replicate on my RPi 5B 8G with Raspberry Pi OS Bookworm Lite 64-bit.

+ i2c_scan
+ '[' 'Raspberry Pi 5 Model B Rev 1.0' '!=' N/A ']'
+ echo -ne '➤ Scan I2C bus for hardware auto-detection...'
➤ Scan I2C bus for hardware auto-detection...+ dtparam -l
+ grep -q i2c_arm=on
+ dtparam -v i2c_arm=on
+ lsmod
+ grep -q i2c_dev
+ modprobe -v i2c-dev
+ for device in "${!SUPPORTED_DEVICES[@]}"
+ address=2f
+ i2c_get 2f
+ i2cdetect -y -a 1 0x2f 0x2f
+ grep -Eq '2f|UU'
+ return 1
+ for device in "${!SUPPORTED_DEVICES[@]}"
+ address=04
+ i2c_get 04
+ i2cdetect -y -a 1 0x04 0x04
+ grep -Eq '04|UU'
+ return 1
+ for device in "${!SUPPORTED_DEVICES[@]}"
+ address=1a
+ i2c_get 1a
+ i2cdetect -y -a 1 0x1a 0x1a
+ grep -Eq '1a|UU'
+ return 1
+ echo -e '[\e[32mdone\e[0m]'
[done]
goldyfruit commented 5 days ago

Could you please run this command manually:

sudo dtparam -v i2c_arm=on
RichB-1 commented 5 days ago

This is the output. Will I need to reflash the OS with Lite rather than regular? A few months ago, installing on regular worked

https://dpaste.com/3LQSSWSY

goldyfruit commented 5 days ago

This is the output. Will I need to reflash the OS with Lite rather than regular? A few months ago, installing on regular worked

It should not change anything but why not :stuck_out_tongue: Try as well without the HAT.

https://dpaste.com/3LQSSWSY

The link doesn't work.

RichB-1 commented 5 days ago

Apologies, mistyped it: https://dpaste.com/3LQSSLWSY

That should work now

goldyfruit commented 5 days ago

Apologies, mistyped it: https://dpaste.com/3LQSSLWSY

That should work now

Output looks good.

RichB-1 commented 5 days ago

So should I reflash the OS onto the SD and start fresh? I installed the ReSpeaker drivers from HinTak before installing OVOS, should I have done it the other way round?

Just wondering why the error is coming up

goldyfruit commented 5 days ago

So should I reflash the OS onto the SD and start fresh?

You could try.

I installed the ReSpeaker drivers from HinTak before installing OVOS, should I have done it the other way round?

No, installing the ReSpeaker module first is the right thing to do. :+1:

Just wondering why the error is coming up

Me too.

RichB-1 commented 5 days ago

For context, I installed the ReSpeaker drivers from here: https://github.com/HinTak/seeed-voicecard

This is due to the ReSpeaker drivers from their github being outdated

RichB-1 commented 5 days ago

Okay, so, I reflashed my SD with RPiOS Lite, then installed the ReSpeaker driver from HinTak, then ran install_wm8960.sh from ubopod (apparently that fixed an issue with the ReSpeaker driver on RPi 5, but it could be causing this issue here), before running the curl command, which brought up a failure at the exact same point as before, the debug url is here: https://dpaste.com/CF4SD4GFD

goldyfruit commented 5 days ago

Is your EEPROM up-to-date?

sudo rpi-eeprom-update -a
sudo reboot
RichB-1 commented 5 days ago

Yeah, it's up to date.

Also, when I rebooted after running the install_wm8960.sh script, it fails to start the wm8960-soundcard.service - unsure why

goldyfruit commented 5 days ago

After a reboot, can you run sudo dtparam -l?

RichB-1 commented 5 days ago

When I run sudo dtparam -v i2c_arm=on, it says '0_dtparam" is already loaded.

When I run sudo dtparam -l, it says that no overlays are loaded

RichB-1 commented 5 days ago

If all else fails regarding using the ReSpeaker 2 mic HAT, could you link me to a cheap-ish microphone that will definitely work?

Thanks in advance

-------- Original Message -------- On 19/09/2024 16:16, Gaëtan Trellu wrote:

Could you please run this command manually:

sudo dtparam -v i2c_arm=on

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

goldyfruit commented 5 days ago

When I run sudo dtparam -v i2c_arm=on, it says '0_dtparam" is already loaded.

Could you please run this again but with the echo this time?

sudo dtparam -v i2c_arm=on
echo $?
RichB-1 commented 5 days ago

This is the output, having copied that:

$ sudo dtparam -v i2c_arm=on && echo $? DTOVERLAY [debug]: using platform 'bcm2712' DTOVERLAY [debug]: overlay map loaded run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre run_cmd: dtc -I fs -0 dtb -o '/tmp/.dtoverlays/base.dtb' /proc/device-tree 1>/dev/null 2>&1 DTOVERLAY [debug]: loading file '/tmp/.dtoverlays/base.dtb' DTOVERLAY [debug]: found override i2c_arm DTOVERLAY [debug]: override i2c_arm: string target 'status' DTOVERLAY[debug]: wrote 162 bytes to '/tmp/.dtoverlays/0_dtparam.dtbo' * Overlay '0_dtparam' is already loaded run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post

goldyfruit commented 5 days ago

This is the output, having copied that: $ sudo dtparam -v i2c_arm=on && echo $? DTOVERLAY [debug]: using platform 'bcm2712' DTOVERLAY [debug]: overlay map loaded run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre run_cmd: dtc -I fs -0 dtb -o '/tmp/.dtoverlays/base.dtb' /proc/device-tree 1>/dev/null 2>&1 DTOVERLAY [debug]: loading file '/tmp/.dtoverlays/base.dtb' DTOVERLAY [debug]: found override i2c_arm DTOVERLAY [debug]: override i2c_arm: string target 'status' DTOVERLAY[debug]: wrote 162 bytes to '/tmp/.dtoverlays/0_dtparam.dtbo' * Overlay '0_dtparam' is already loaded run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post

I don't see the output of the echo, it should be a number; 0 if everything is fine.

RichB-1 commented 5 days ago

Doing 'echo $' or 'echo $?' ?

And I was thinking that too! I'm unsure as to why it wasn't parsed through

Doing echo $? On its own prints 1, not 0. What would the issue here be/what's a fix for it?

Thanks

goldyfruit commented 5 days ago

echo $?

echo $?, this return the exit code from the code, 1 means that there is an error and this is why the ovos-installer stops!

I gonna check what I can do!

Thanks! :+1:

RichB-1 commented 5 days ago

Thank you!

RichB-1 commented 5 days ago

Thank you!

May I ask what microphone and speakers you are using with your setup? I feel I may need to start from scratch with another microphone. Having a look, would the Tonor TC30 be any good?

I'm starting to think that the issue is lying with the drivers for the microphone, so maybe switching to another microphone will work

Thanks for all the help

The reason why I'm asking is that I'm doing a project making a voice assistant and I'm presenting it, so as long as I can get it working, that's all that matters.

Could you advise as to my next steps? Thank you for your help so far

goldyfruit commented 5 days ago

Thank you! May I ask what microphone and speakers you are using with your setup?

I got multiple microphones; I would recommend this one, not the best but works decently https://a.co/d/bvLYplN

Could you advise as to my next steps? Thank you for your help so far

I'm looking into the issue.

goldyfruit commented 5 days ago

Did you see this issue https://github.com/HinTak/seeed-voicecard/issues/19

RichB-1 commented 5 days ago

Thank you,

I'm from the UK, can that product be bought on Amazon UK?

JarbasAl commented 5 days ago

@j1nx are respeaker drivers even needed? havet you been recommending everyone to NOT use them?

RichB-1 commented 5 days ago

Yes I did, I used the alternate install.sh (wm8960) but it hasn't worked thus far

goldyfruit commented 5 days ago

Thank you, I'm from the UK, can that product be bought on Amazon UK?

You gonna have to check or find an equivalent.

I think there is an issue with your module installation, I'm gonna wait before applying a workaround to the ovos-installer.

RichB-1 commented 5 days ago

It was my understanding that the drivers were needed for the microphone to function - if this is incorrect please let me know.

goldyfruit commented 5 days ago

Actually I got a ReSpeaker 2 HAT from Seeed Studio... I'm gonna check if it works for me.

RichB-1 commented 5 days ago

Thank you for all of your help, Gaëtan

RichB-1 commented 5 days ago

Thank you! If you get it working, please let me know what you had to do

goldyfruit commented 5 days ago

Its working for me.

$ curl https://raw.githubusercontent.com/ubopod/ubo_app/main/ubo_app/system/install_wm8960.sh | sudo bash
$ sudo reboot

Then check for microphone and speakers:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: wm8960soundcard [wm8960-soundcard], device 0: 1f000a0000.i2s-wm8960-hifi wm8960-hifi-0 [1f000a0000.i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: wm8960soundcard [wm8960-soundcard], device 0: 1f000a0000.i2s-wm8960-hifi wm8960-hifi-0 [1f000a0000.i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Running the ovos-installer works fine.

RichB-1 commented 5 days ago

Thank you!

I'll try that tomorrow - I was using wget rather than curl so that explains the potential issue.

So, to be clear, first, update everything, then install the drivers from HinTak, before installing the wm8960 drivers and then rebooting.

After that, use aplay/arecord to double check, and use the ovos-installer.

For reference, what version of Bookworm are you using, Lite or Full?

Thank you so much for everything, I'll try doing it tomorrow and if I have any other issues I'll let you know

goldyfruit commented 5 days ago

I was using wget rather than curl so that explains the potential issue.

Gonna be the same, I'm just not using https://github.com/HinTak/seeed-voicecard as it doesn't seem to work with RPi 5B.

So, to be clear, first, update everything, then install the drivers from HinTak, before installing the wm8960 drivers and then rebooting.

Don't used https://github.com/HinTak/seeed-voicecard, use the link from my previous message.

After that, use aplay/arecord to double check, and use the ovos-installer.

Yes.

For reference, what version of Bookworm are you using, Lite or Full?

Lite.

Thank you so much for everything, I'll try doing it tomorrow and if I have any other issues I'll let you know

No problem!

RichB-1 commented 5 days ago

Ohhh okay, so just use the wm8960 drivers rather than the HinTak ones?

Have you tested the microphone out to see if it works? (Just double checking)

goldyfruit commented 5 days ago

Ohhh okay, so just use the wm8960 drivers rather than the HinTak ones?

Yeah, two different repositories.

Have you tested the microphone out to see if it works? (Just double checking)

I'm in the process of doing that, running the ovos-installer just after a Raspberry Pi OS fresh install. :stuck_out_tongue:

goldyfruit commented 5 days ago

Yes, wake word is picked up.

Sep 19 18:29:46 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:29:46.222 - voice - ovos_dinkum_listener.voice_loop.voice_loop:start:177 - INFO - Listening mode: ListeningMode.WAKEWORD
Sep 19 18:29:46 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:29:46.224 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:203 - INFO - Starting loop in mode: ListeningMode.WAKEWORD
Sep 19 18:29:46 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:29:46.224 - voice - ovos_dinkum_listener.service:on_ready:90 - INFO - DinkumVoiceService is ready.
Sep 19 18:29:46 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:29:46.226 - voice - ovos_dinkum_listener.service:reload_configuration:1107 - INFO - Reload Completed
Sep 19 18:29:46 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:29:46.228 - voice - ovos_config.config:_on_file_change:311 - INFO - /home/goldyfruit/.config/mycroft/mycroft.conf unchanged
Sep 19 18:30:41 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:30:41.925 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:234 - INFO - Wakeword detected
Sep 19 18:30:44 rpi5b ovos-dinkum-listener[22953]: 2024-09-19 18:30:44.733 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:268 - INFO - speech finished
RichB-1 commented 5 days ago

Absolutely perfect, thank you!!

So from this point, if there are any issues, it must be hardware, and at that point, I'll get a new microphone.

j1nx commented 4 days ago

@j1nx are respeaker drivers even needed? havet you been recommending everyone to NOT use them?

Indeed , the wm8960 is included in the default rpi linux kernel. Just load the dtoverlay from the kernel and it works. No need to install different module driver from seeed or hintak.

for the 2mic that is, the 4 and 6 mic need the hintak driver.

RichB-1 commented 4 days ago

So, to be clear, I just need to run the ovos-installer on a fresh install?

j1nx commented 4 days ago

So, to be clear, I just need to run the ovos-installer on a fresh install?

If I understand the above correctly, you are best to add the dtoverlay=wm8960 (check official names as I do this out the top of my head) to config.txt and reboot first before you run the installer.

RichB-1 commented 4 days ago

Its working for me.

$ curl https://raw.githubusercontent.com/ubopod/ubo_app/main/ubo_app/system/install_wm8960.sh | sudo bash
$ sudo reboot

Then check for microphone and speakers:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: wm8960soundcard [wm8960-soundcard], device 0: 1f000a0000.i2s-wm8960-hifi wm8960-hifi-0 [1f000a0000.i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: wm8960soundcard [wm8960-soundcard], device 0: 1f000a0000.i2s-wm8960-hifi wm8960-hifi-0 [1f000a0000.i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Running the ovos-installer works fine.

With running the wm8960 installer then rebooting, the wm8960 service fails

goldyfruit commented 4 days ago

With running the wm8960 installer then rebooting, the wm8960 service fails

Failing for me as well but not an issue apparently.

RichB-1 commented 4 days ago

With running the wm8960 installer then rebooting, the wm8960 service fails

Failing for me as well but not an issue apparently.

Mhm okay, for some reason it isn't hearing me, I've gone into alsamixer and boosted the input as much as I can, and nothing happens - it heard me say 'hey, mycroft' a couple of times but didn't understand what I said after that.

Should I not have used alsamixer and used pulseaudio instead? Also, did you have to change the mycroft.conf file or not? Just wondering

RichB-1 commented 4 days ago

So, to be clear, I just need to run the ovos-installer on a fresh install?

If I understand the above correctly, you are best to add the dtoverlay=wm8960 (check official names as I do this out the top of my head) to config.txt and reboot first before you run the installer.

Just doing this results in the 2 mic HAT not even being recognised by arecord -l - I am yet to run the ovos-installer

For reference, I have 2 SD cards and am trying both approaches on each