Precise-collect not recording any sounds

Hi All,

I have built a Picroft on a Raspberry Pi 4 using a Google AIY voice hat as the mic and speaker. This works very well with the default ‘Wake Word’ but I decided to try and create my own custom ‘Wake Word’, first I tried using PocketSphinx defining the Phonemes for my ‘Wake Word’ and this worked reasonably well. I now decided to try and using the Precise engine and train my “Wake Word”. I started with a fresh install of Picroft (Picroft_Buster-Keaton_2020-01-10) applying all the latest updates. I installed Mycroft Precise using the source install method, downloading the source using ‘git clone https://github.com/mycroftai/mycroft-precise’ and then running setup.sh in the Mycroft-precise directory. This worked fine. I then set ‘source .venv/bin/activate’ and used ‘precise-collect’ to record some sample utterances of my ‘Wake Word’. The records seem to work but when I checked the wav files they all seem to just be flat lines as if the mic was mute. The default ‘Wake Word’ still works so the mic configuration would seem to be correct.

Can anyone suggest why I may not be getting any successful recordings?

Ernie

if you try “arecord -d 3 test.wav” (say something, of course) and then play that back, does it work?

Hi baconator,

Thanks for your reply. I have tried what you suggested and it does work but the play back is at a very low amplitude. I loaded the wav file into Audacity and the wave form is only just noticeable. If I use ‘precise-listen /home/pi/.mycroft/precise/hey-mycroft.pb’ that seems to work as I would expect.

Ernie

1 Like

That seems to suggest you might need to check the levels in alsamixer.

Hi,

I tried alsamixer and pressed F6 and selected the google sound card I believer, but it says ‘This sound device does not have any controls’.

Ernie

The “default” is Master. Just hit F4 as you enter alsamixer.

Hi SGee,

Thanks for you reply.

When I enter alsamixer is shows a single column marked ‘Master’ with a value of 99. If I hit F4 the program drops out back to the command prompt.

Ernie

Do you SSH in? The F-keys act weirdly in this case ( the 99 is the output level btw)

Hi SGee,

Thanks for your reply.

I didn’t realise there was a problem with SSH. I connect a HDMI monitor and keyboard so I could run alsamixer without a problem.

I didn’t know what a lot of this means but I think it looks OK. Top left corner shows Card: PulseAudio, when I press F4 / F5 I get the levels for ‘Master’ & ‘’, both set to 100.

F2 gives a lot of system information

Version:	K5.4.51-V71+
Card:		snd-rpi-googlevoicehat-soundcard
Devices:	0:[ 0]: control
		16: [0- 0]: digital audio playback
		24: [0- 0]: digital audio capture
		33:	: timer

Timer	G0:	system timer: 10000.000us (10000000 ticks)
		P0-0-0:	PCM: Playback 0-0-0 SLAVE
		P0-0-1:	PCM: Capture 0-0-1 SLAVE

PCM		00-00 GooglevoiceHAT SoundCard HiFi Voicehat-codec:0  ……….

Does this help at all? As I say the default Mycroft voice capture works as it recognises the default ‘Wake-Word’ so the sound card is working. So it seems strange that the ‘precise-collect’ command fails to record any sound since I assume it’s using the same method.

Thanks again for any help you can give.

Ernie

Maybe this is something for you - if using AIYv2. And if using AIYv2 there is another question if the setup process covered all things needed. Since i think its taylored to AIYv1. But that is all guesswork. @andlo might be able to add something substantial.

If using v1 there is a similar skill in the marketplace.

Another member described a somewhat similar problem, yet there was no answer. Maybe PM him?

about precise/mycroft: Do you use the stable or the dev version of mycroft-core? Since the resulting precise model (mycroft-precise default branch; precise v0.3) wouldn’t be compatible with mycroft-core stable (precise v0.2). It’s not relevant to the problem (i guess) but it’s good to know further down the line.

Hi SGee,

Thanks again for your reply.

As you should see I took your advice and contacted Randal to see if he made any progress with his problem. I also checked what version of the Google AIY I was using, I was not familiar with the version 2, but mine is a hat that attaches directly on a Raspberry Pi 4 so I think this a version 1.

I noticed from the post you directed me to by chiisaa, that someone called Andreas Lorensen wrote the code for AIY v1, would this be the code used in the current release of picroft? If so do you think it may be worth contacting Andreas himself to see if he could help?

Thanks again Ernie

You should file issues on the github repos as first step.

This is why i called @andlo (klick :wink: ) to have a look.

Hi SGee,

Sorry if I misunderstood that you. So you have already been in contact with Andreas. Before I file an issue on the github repos as suggested by baconator should I wait to see what Andreas says or should I do it now?

Ernie

Haven’t seen him around lately, so go ahead and file an issue. Always beneficial to ring the bell on more than one place :wink: You might also consider engaging with the team/community on https://chat.mycroft.ai

Hi SGee,

I posted an issue for this problem on the forum over a week ago, first one I have done. Would expect to get a response by now even if it is a negative one?

Have you seen Andreas about yet?

Ernie

On my Pi4
Maybe you can use arecord -l or -L and find the capture device.
Then the /etc/asound.conf is kind of like
(you’ll have to sudo “vi”, or “emacs”)

pcm.!default
{
playback.pcm
{
type hw
card 2
device 0
}

playback.capture
{
	type hw
	card 0
	device 0
}

}

I was also not able to record.
I think this is what did it for me, but I’m not sure.
It’s basically combining mu usb mic from Best Buy into the default pcm.
I think you need to reboot.
Nate

Raspberry Pi4 doesn’t come with a microphone

No haven#t seen him around.

During your installation you should’ve came across this setup option, right? If so and followed this path, check if all steps under 4) got applied. And i would guess the firmware applied in this setup is rather old and may conflict with some newer software. Lastly, is there a way to make sure you are running v1? Just to rule out that you’re not running the wrong drivers.

I’m speculating that there are not much GoogleHATs around in this community, thus unsufficient feedback.

Hi SGee,

Thanks for your comments. Yes when I was installing Picroft I took the option 4 to install the Google AIY device. Using drivers the ‘arecord –l’ command seems to recognise the device, see output below.

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sndrpigooglevoi [snd_rpi_googlevoicehat_soundcar], device 0: Google voiceHAT SoundCard HiFi voicehat-codec-0 [Google voiceHAT SoundCard HiFi voicehat-codec-0]
Subdevices: 0/1
Subdevice #0: subdevice #0

Also it’s the only device with a mic & speaker that is attached to my raspberry pi and in normal working picroft recognises the wake word even from several metres away (3m to 4m)

On the AIY version question my understanding the V1 connects to standard raspberry pi 3 / 4 and V2 connectors to a raspberry pi zero. See attached photo of mine.

Thanks again for your help.

Ernie