chiisaa / picroft-google-aiy2-voicebonnet-skill

Enables google aiy2 voicebonnet button
GNU General Public License v3.0
4 stars 0 forks source link

aiy-voicebonnet-soundcard-dkms Error #1

Open CJConnor opened 3 years ago

CJConnor commented 3 years ago

Hello,

I have tried installing this skill onto my picroft but each time I try I receive multiple errors mostly associated with the module build on kernel: 5.4.51+. On the bottom of the install, it states that it could not install aiy-voicebonnet-soundcard-dkms. Which makes sense as the button works as intended, however the speaker and microphone do not work and are not picked up by picroft when I run the pactl info command. I have attached a file which contains the entire install trail after calling the sh mycroft-core/skills/picroft-google-aiy2-voicebonnet-skill.chiisaa/install_AIY2.sh command. My set up is the Raspberry Pi 3B+ and the AIY V2 Voice bonnet.

If anyone could help that would be great :)

Cheers, Ciaran aiy-install.txt

builderjer commented 3 years ago

I am running into the same issue, but with kernel 5.10.11+ Here is the log from /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/make.log

DKMS make.log for aiy-voicebonnet-soundcard-3.0 for kernel 5.10.11+ (armv7l) Fri Feb 19 21:58:42 GMT 2021 make: Entering directory '/usr/src/linux-headers-5.10.11+' CC [M] /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.o CC [M] /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/rt5645.o CC [M] /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/rl6231.o /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c: In function ‘snd_rpi_aiy_voicebonnet_init’: /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c:39:43: error: ‘struct snd_soc_pcm_runtime’ has no member named ‘codec_dai’ struct snd_soc_component *component = rtd->codec_dai->component; ^~ /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c:48:34: error: ‘struct snd_soc_pcm_runtime’ has no member named ‘codec_dai’ ret = snd_soc_dai_set_sysclk(rtd->codec_dai, RT5645_SCLK_S_MCLK, ^~ /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c: In function ‘snd_rpi_aiy_voicebonnet_hw_params’: /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c:73:31: error: ‘struct snd_soc_pcm_runtime’ has no member named ‘codec_dai’ ret = snd_soc_dai_set_pll(rtd->codec_dai, 0, RT5645_PLL1_S_MCLK, ^~ /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c:80:34: error: ‘struct snd_soc_pcm_runtime’ has no member named ‘codec_dai’ ret = snd_soc_dai_set_sysclk(rtd->codec_dai, RT5645_SCLK_S_PLL1, freq, ^~ /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.c:87:34: error: ‘struct snd_soc_pcm_runtime’ has no member named ‘codec_dai’ ret = snd_soc_dai_set_sysclk(rtd->codec_dai, RT5645_SCLK_S_PLL1, freq, ^~ make[1]: *** [scripts/Makefile.build:279: /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/snd-aiy-voicebonnet.o] Error 1 make[1]: *** Waiting for unfinished jobs.... /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/rt5645.c: In function ‘is_sys_clk_from_pll’: /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/rt5645.c:869:8: error: implicit declaration of function ‘snd_soc_component_read32’; did you mean ‘snd_soc_component_read’? [-Werror=implicit-function-declaration] val = snd_soc_component_read32(component, RT5645_GLB_CLK); ^~~~~~~~~~~~~~~~~~~~~~~~ snd_soc_component_read cc1: some warnings being treated as errors make[1]: *** [scripts/Makefile.build:279: /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build/rt5645.o] Error 1 make: *** [Makefile:1808: /var/lib/dkms/aiy-voicebonnet-soundcard/3.0/build] Error 2 make: Leaving directory '/usr/src/linux-headers-5.10.11+'

Any help would be great as I'd love to use this

WhyNine commented 3 years ago

This issue has been reported elsewhere (such as here) but there is no proper resolution that I have found yet. The best that I have come up with is to start from the official Google Raspbian image and add Mycroft to that. These are the approximate steps that I have used (not thoroughly checked, so use carefully):

Do NOT do a "sudo apt upgrade" 
curl https://sh.rustup.rs -sSf | sh
sudo apt install    libatlas3-base
echo "raspberrypi-bootloader hold" | sudo dpkg --set-selections
echo "raspberrypi-kernel hold" | sudo dpkg --set-selections
echo "raspberrypi-kernel-headers hold" | sudo dpkg --set-selections
echo "libraspberrypi0 hold" | sudo dpkg --set-selections
echo "libraspberrypi-bin hold" | sudo dpkg --set-selections
echo "libraspberrypi-dev hold" | sudo dpkg --set-selections
echo "libraspberrypi-doc hold" | sudo dpkg --set-selections

sudo apt update
sudo apt upgrade

Install Mycroft as per https://github.com/MycroftAI/enclosure-picroft/blob/stretch/image_recipe.md#recipe-for-creating-the-picroft-img
Select jack audio output and 'other' microphone input     <--- HMM, NEVER ASKED FOR THESE (run the setup wizard?)

/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip

Edit /etc/mycroft/mycroft.conf to have:
   "play_wav_cmdline": "aplay %1",
   "play_mp3_cmdline": "mpg123 %1",

Edit /etc/pulse/default.pa to have [these steps add echo cancellation so are not strictly required]:
#set-default-sink alsa_output.platform-soc_sound.HiFi__hw_aiyvoicebonnet__sink
#set-default-source alsa_output.platform-soc_sound.HiFi__hw_aiyvoicebonnet__source
.ifexists module-echo-cancel.so
load-module module-echo-cancel aec_method=webrtc source_name=echocancel sink_name=echocancel1
set-default-source echocancel
set-default-sink echocancel1
.endif

Check /var/log/mycroft/audio.log and look for any errors (may need to manually install stuff)

sudo mkdir -p /etc/pulse/daemon.conf.d/
echo "default-sample-rate = 48000" | sudo tee /etc/pulse/daemon.conf.d/aiy.conf

Use alsamixer on CLI to set bonnet to default output (via F6)

The following steps are required before installing the new aiy2 skill:
git clone https://github.com/google/aiyprojects-raspbian.git AIY-projects-python
sudo pip3 install -e AIY-projects-python/src
echo "/home/pi/AIY-projects-python/src" > ~/mycroft-core/.venv/lib/python3.7/site-packages/aiy.pth

If you follow the above steps, I'm not sure how much, if any, of the install script is still required.

chiisaa commented 3 years ago

Guys,

Sorry I have taken so long to get back around to this issue.

Quick question. Did you install Raspbian and then install Mycroft?

I just downloaded the Picroft img file: Picroft Stable 2020-09-07 image

Wrote the img with etcher to the SD card, booted, registered, installed the skill, ran the script

Everything appears to be working correctly.

Pi3 Google AIY2 Picroft Stable 2020-09-07

I will update the instructions accordingly.

-chiisaa

WhyNine commented 3 years ago

Hi Chiisaa,

I always start from Raspbian rather than the Picroft image. I think I had an issue with downloading and writing the image so I just follwed the instructions on their website to create my own.

WhyNine