I have a fully operational Pycroft with the latest code released last week and using the
Jabra 410 USB conference speaker/microphone.
Briefly the steps were:
-
Build a new Pycroft as per https://github.com/MycroftAI/enclosure-picroft/tree/stretch
-
Run through the first time install wizard as normal.
-
Reboot.
-
As this point I had everything working except the speaker.
(The microphone worked out of the box) -
Make the changes as below to DISABLE the onboard BCM2835 speaker
hardware. This means the Jabra becomes Card 0 and the default.
(I do plan to work with this further to see if I can leave the hardware
enabled and change the default to the Jabra as card 1. This is yet to be
started.Your best friend thorough this is the command alsa-info .
When you run it respond ‘no’ to sending the data to the Alsa team to get
to the file name containing your configuration details Save this, and refer to it for
an exact description of your Alsa configuration.
Here are the steps. The steps include commands to cut/paste to run.
#1. Disable BCM2835 overlay from loading at boot time.
#- Edit /boot.config.txt
sudo cp -p /boot/config.txt /boot/config.txt.orig
sudo bash -c 'cat >> /boot/config.txt << __EOF
dtparam=audio=off
__EOF'
more /boot/config.txt
sudo shutdown -r now
#2. Force USB Audio to be card 0 I also forced the snd_bcm2835 to never be card 0 as well
#- Create /etc/modprobe.d/alsa-base.conf
sudo bash -c 'cat > /etc/modprobe.d/alsa-base.conf << __EOF
options snd_usb_audio index=0
options snd_bcm2835 index=-2
__EOF'
more /etc/modprobe.d/alsa-base.conf
sudo shutdown -r now
#3. Change default to USB
#- Replace /etc/asound.conf
sudo mv /etc/asound.conf /etc/asound.conf.orig
sudo bash -c 'cat > /etc/asound.conf << __EOF
pcm.!default {
type plug
slave {
pcm "hw:0,0"
}
}
ctl.!default {
type hw
card 0
}
__EOF'
cat /etc/asound.conf
#4. Replace ./audio_setup.sh created by the wizard so set Control 3 (Playback) to card 0
echo 'sudo amixer cset numid=3 "0" > /dev/null' > ~/audio_setup.sh
echo "amixer set PCM 79%" >> ~/audio_setup.sh
bash ~/audio_setup.sh
#5. Test Output Audio with noise, then WAV files if they are on pycroft
#- First check the speaker volume. Use the -/+ on the Jabra and set it at about 75%
#- (Use control-C to stop if necessary)
cat /dev/urandom | aplay
speaker-test -t wav -c 2 -D hw:0
#6. Test Input Audio with noise (stop mycroft first to release the microphone driver)
mycroft-core/stop-mycroft.sh
cat /dev/urandom | arecord -d 5 /tmp/noise.wav
aplay /tmp/noise.wav
#7. Update /etc/mycroft/mycroft.conf to use the default alsa device.
# Use an editor and change lines 2 and 3 to look like this. ** Sorry no command here.
“play_wav_cmdline”: “aplay %1”,
“play_mp3_cmdline”: “mpg123 %1”,
#The entire default /etc/mycroft/mycroft.conf file shroud now look like:
#- /etc/mycroft/mycroft.conf
{
“play_wav_cmdline”: “aplay %1”,
“play_mp3_cmdline”: “mpg123 %1”,
“enclosure”: {
“platform”: “picroft”
},
“tts”: {
“mimic”: {
“path”: “/home/pi/mycroft-core/mimic/bin/mimic”
}
},
“ipc_path”: “/ramdisk/mycroft/ipc/”
}
#8. Do a final reboot to get everything started in a predictable manner.
sudo shutdown -r now
Hopefully it should all be working for you.