Precise-collect not recording any sounds

Hi Nate,

Thanks for your feedback.

I don’t understand much about Linux audio systems, the output from the ‘arecord –L’ command looks complicated !

See the output from my pi below:

I had a search for an ‘asound.conf’ file and didn’t find one is that what you would expect after a standard install of picroft?

Do I have to create one in that case?

Thanks again for your help.

Ernie

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

arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
jack
JACK Audio Connection Kit
pulse
PulseAudio Sound Server
default
Playback/recording through the PulseAudio sound server
sysdefault:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
front:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
rear:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
center_lfe:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
side:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
surround21:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
surround40:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
surround41:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
surround50:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
surround51:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
surround71:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
iec958:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
hdmi:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
dmix:CARD=sndrpigooglevoi,DEV=0
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Direct sample mixing device
dsnoop:CARD=sndrpigooglevoi,DEV=0
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Direct sample snooping device
modem:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
phoneline:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Default Audio Device
hw:CARD=sndrpigooglevoi,DEV=0
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Direct hardware device without any conversions
plughw:CARD=sndrpigooglevoi,DEV=0
snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
Hardware device with all software conversions
usbstream:CARD=sndrpigooglevoi
snd_rpi_googlevoicehat_soundcar
USB Stream Output

since i think there is nothing big to loose,
try sudo apt-get install -y aiy-python-wheels
as this part was skipped due to an error back in 2018.

and as i can see asound.conf is configured this way (just to make this clear fore other readers)

options snd_rpi_googlevoicehat_soundcard index=0

pcm.softvol {
    type softvol
    slave.pcm dmix
    control {
        name Master
        card 0
    }
}

pcm.micboost {
    type route
    slave.pcm dsnoop
    ttable {
        0.0 30.0
        1.1 30.0
    }
}

pcm.!default {
    type asym
    playback.pcm "plug:softvol"
    capture.pcm "plug:micboost"
}

ctl.!default {
    type hw
    card 0
}

Hi SGee,

Tried the install as you suggested be get an error

sudo apt-get install -y aiy-python-wheels
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package aiy-python-wheels

I then tried echo “deb https://packages.cloud.google.com/apt aiyprojects-stable main” | sudo tee /etc/apt/sources.list.d/aiyprojects.list

followed by:

sudo apt-get update
sudo apt-get upgrade
reboot

but get the same error.

Ernie

Hi Ernie,
I didn’t realize you are using picroft . I am actually trying to get my own picroft off the ground. Also, I am not familiar with the googlevoiceHAT thing.

Pulseaudio is very confusing I am finding. Your capture device is a “source” and the output is a “sink.” There are modules that get loaded for pulse. You can learn what works by loading modules after picroft% pulseaudio -nC ,

I am about to try and do some precise-collecting myself with the new picroft. I was able to with my other install. Also, I was using the app “apulse” to prefix commands and it worked for my other install. It’s acually just alsa, but pretends it’s pulse with programs. It worked for me. :wink:

so you could try “% apulse precise-collect [command]”
-nate

Hi Nate,

The googleVoiceHat was a Hat designed by Google to fit a Raspberry 3 format and initially was given away free with the PiMag. It comprised a cardboard box to be used as an enclosure, the Hat itself with speaker, stereo mic and button to activate it. Software was provided to convert the Raspberry Pi into a Google assistant. It was later sold as a separate item which is when I got one. I believe Google now sell a version 2 which is designed to connect to a Raspberry Pi Zero.

It seemed the ideal attached for picroft and works well with the default picroft installation even having an option during the installation to load the drivers. The mic picks up the ‘Wake word’ from several meters at normal volume. This is why I find it strange that the ‘precise-collect’ command does not seem to work for me when all the necessary drivers must be loaded.

Ernie

1 Like

Hmm… i’m only running mycroft-precise on an Arch VirtualBox “headless” (:without mycroft-core), yet saw that mycroft-precise comes with its own venv. Maybe this throws things off. (last time used it 2 months ago, therfor had no instant recollection of the inner workings)

So, if something pip related is needed, change venv, pip install it and stay in venv to process precise-collect.

Or -first and foremost- change the venv without doctoring to see if this changes the outcome.

Hi SGee,

Thanks for still taking an interest in my problem.

Sorry you have lost me! I am not familiar this virtualBox. I just built picroft from the instructions on the website. I notice that when you ssh to the Raspberry Pi it automatically starts the Mycroft client and if I quit out of that the prompt is ‘(.venv) pi@picroft:~ $’. So this is running in a virtualbox! I am not sure how to try your suggestions.

Ernie

the venv problem has nothing to do with virtual box.

do:

deactivate (now your promptline should change to `pi@picroft:~ $` )
source ~/mycroft-precise/.venv/bin/activate (given the path is mycroft-precise)

(Now you're in the mycroft-precise virtual environment)

(on a side note: one should rename the venvs to a descriptive name)

and then

precise-collect

and then check the .wavs’

you might want to check this to get up to speed on venvs’ (“Picroft” resp. mycroft-core by default living in one) To know about that will save headaches later on if you chose to add additional stuff.
(don’t ever do a sudo pip in a venv)

If this is too technical don’t hesitate to ask further

Hi SGee,

Thanks again for all your suggestions. I may have got to the bottom of the problem. I am sure when I was first read about using ‘precise-collect’ to record the wav files it said when you press the space bar to start the recording to wait about 1 to 2 seconds before speaking and then terminate the recording straight after. I have done some more experiments using the initial approach and wot you suggested but this time leaving a much longer gap before speaking and this seems to record successfully. It plays back using ‘aplay’ but is at a very low amplitude. I’ll give it a try creating a training set and then try the training process.

Thanks again for your help, I’ll let you know how I get on.

Ernie

I really don’t know where the “bottom” is.

The “1 to 2 seconds” gap isn’t meant that way. The record (in all facets) has to work with pushing the button. Full stop.

I know what instrustions you are reffering to; and btw disagree strongly to that approach. If you don’t record in perfectly silent conditions (or/and post process the results thoroughly), the resulting model will recognize this sounds as a wake word. For instance my subterain low-watt ventilator 2 stories below got picked up resulting in mycroft reacting to this sound. There were many other sounds that got picked up in the process. And since these are what you consider wake word you can’t train effectively against them (with the non wake words - including environmental sounds)

Given you volume problem - that is still present as i understand - you have no way of recognizing that without analyzing software - and manually edit that. And since the problem remains (“very low amplitude”), there is no way to a proper model to begin with.

I won’t be suprised if precise-listen is still using ALSA while Mycroft now already uses PulseAudio for a while.

Perhaps if you change asound.conf to push everything to PulseAudio perhaps precise-listen picks the right mic up.

From the code i’m seeing that the PyAudio package (which is btw not in the core venv) is used… yet no clue what that entails

Me neither, but Mimic1 is also still build with alsa support by default, so perhaps precise-listen as well.

Google AIY requires quite a special asound.conf while pulseaudio and udev configures everything itself.

Saw that earlier this week when I hooked up a AIY v1 in my own OS. After just loading the overlay PulseAudio just picked everything up and was working out of the box with Mycroft that way.

The softvol threw me off. Wasn’t a “soft vol” issued here? :clown_face:

J1nx refers to something along those lines

1 Like

Exactly! Thx for digging that up for this lazy person😜

Hi Nate & SGee,

Thank you both for your help, it is much appreciated.

I retired from work a few back and came new to Linux with no experience with audio software. So I am sorry if you feel I have been lazy in asking so many questions on this matter. I also have had little experience in using any forums, I thought the idea of a forum was somewhere to get help from other likeminded people.

Thanks again.

Ernie

To elaborate on the lazy stuff. I was talking about myself as being the lazy one😜

1 Like

Hi J1nx,

Sorry again, I misunderstood.

Ernie