Mycroft Community Forum

Picroft Setup Steps - Quick Setup - USB Mic/Headphones Output

PiCroft: 21.2.0
Raspberry Pi 4 - Revision: d03114

Picroft Stable 2020-09-07 image

These are my setup notes on how to quickly get a Picrofy system up and running using a speaker plugged into the headphone jack and a generic USB mic.

  1. Write the image to the sdcard as instructed
  2. Setup picroft with the wizard.
    a. The options I select:
    Output: Speakers via 3.5
    Mic: Other - Unsupported
    b. Tests will most likely fail at this stage, this is expected
  3. Once you get to the mycroft-cli and register your device, it’s time to apply some updates.
    a. Update package list
    $ sudo apt update
    b. Upgrade Packages
    $ sudo apt upgrade -y
    c. Remove unused packages
    $ sudo apt autoremove -y
    d. Reboot
    $ sudo reboot
  4. When things boot back up, it’s time to get the audio working. I usually do this via SSH.
    a. Review default audio devices
    $ pactl info
    b. Set the default output device to the headphone jack
    $ pactl set-default-sink alsa_output.platform-bcm2835_audio.analog-stereo
    c. Verify that the correct default devices are set
    $ pactl info
    d. Tell MyCroft to use the pulse system by default
    $ mycroft-config set listener.device_name "pulse"
    e. Reboot
    $ sudo reboot
  5. Update the /etc/mycroft/mycroft.conf
    a. Update the following lines:
    "play_wav_cmdline": "aplay -Dhw:0,0 %1",
    "play_mp3_cmdline": "mpg123 -a hw:0,0 %1",
    b. To look like this:
    "play_wav_cmdline": "aplay %1",
    "play_mp3_cmdline": "mpg123 %1",
  6. Update the DuckDuckGo skill
    $ msm install https://github.com/JarbasSkills/skill-ddg
  7. When the system is back online, run a mycroft-mic-test
    $ mycroft-mic-test

Notes

  • Set mic gain to 100% (I’ve got a crappy mic)
    $ amixer set Capture 100%

  • Check alsamixer to make sure all audio levels are up

  • Change listen engine to Precise

       > Hey Mycroft, tell me what Listener you are using
       > Hey Mycroft, set the Listener to Precise
  • Install additional Skills
    $ mycroft-msm install fallback-aiml
    $ mycroft-msm install skill-finished-booting
    $ mycroft-msm install mycroft-spotify
  • Ensure MyCroft beeps when it hears the wake word - Should return “true”
    $ mycroft-config get confirm_listening
  • Install raspotify (I still need to get this working)
    $ curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
  • Optional Packages
    $ sudo apt install rustc libpulse-dev python3-venv libatlas-base-dev -y
1 Like

Hey, thanks for sharing all these learnings. I’ve been doing a little work to switch all the old ALSA manipulation to use pulseaudio instead and it includes a bunch of these suggestions.

  • Sets input and output devices as default devices in PA
  • Provides a new selection menu for non-standard devices using the output of pactl info list sinks/sources short
  • Set volume using PA
  • As the devices are now set as defaults, we no longer need to set custom play_type_cmdline settings for each device, hence these mycroft.conf settings have been removed.
  • Simplifies the speak function as Mimic can now output audio directly, reducing chance of tmp file issues

If anyone wants to give it a try I’ve added the changes into the latest release candidate:
https://downloads.mycroft.ai/releases/picroft/rc/

Interested to hear if you do try it out.

1 Like

Gez. is there a set of commits that we can take a look at that represents this work? FWIW, I only ask because I’d like to follow along with changes to the installer without necessarily running it each time.

Thanks for the updates!

There is - you can find the PR for this here:

This release candidate also includes this PR:

1 Like