Converting a mycroft mk2 to retropie (or other debian)

So i managed to score a mk2 (i’m pretty sure production unit) and it works well with Neon AI.
I’ve booted it with stock images of RetroPi and Batocera and it runs as well as a pi4 would for old retro games. The problem is i can’t seem to setup the SJ201 “hat”.
I can set the GPIO13 at boot and turn the fan off, and have the button round button shutdown the pi on press, but thats about as far as i’ve got.

I’ve found quite a few places that talk about the SJ201 and a rough guide on getting sound working, but following them leaves me with no sound still and no errors in dmesg.
Any pointers other than these links ?

https://github.com/MycroftAI/hardware-mycroft-mark-II/blob/master/mark-II-Rpi-devkit/KiCAD/SJ201-Raspberry%20Pi%204%20Daughterboard/README.md

https://github.com/OpenVoiceOS/VocalFusionDriver/tree/main

https://github.com/xmos/vocalfusion-rpi-setup

1 Like

If all the ports are at the back then it’s a production unit :slight_smile: . For some background, the switches/buttons are just basic GPIO connections, the fan uses a PWM output to adjust speed to anything other than 100%, and the audio (VF input and TI amp for speaker output) uses a serial connection on the GPIO header. The VF chip and TI amp need to be initialized on every boot, so Neon OS uses a system service to do this at boot, before PulseAudio loads and detects input/output devices.

I have this file overlay and use this install script to setup the SJ201 in Neon OS images. There’s also the ovos-i2caudio project which supports a few audio HATs, including the SJ201.

2 Likes

Thanks for this, got the sound card loaded, but it doesn’t seem to play any thing. I did read something about having to full GPIO5 high to enable the amp ? or is that all handled by the loading of the firmware and bits ?

pi@retropie:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample snooping device
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions
default:CARD=sndxmosvocalfus
    snd_xmos_vocalfusion_card, simple-card_codec_link snd-soc-dummy-dai-0
    Default Audio Device
sysdefault:CARD=sndxmosvocalfus
    snd_xmos_vocalfusion_card, simple-card_codec_link snd-soc-dummy-dai-0
    Default Audio Device
dmix:CARD=sndxmosvocalfus,DEV=0
    snd_xmos_vocalfusion_card, simple-card_codec_link snd-soc-dummy-dai-0
    Direct sample mixing device
dsnoop:CARD=sndxmosvocalfus,DEV=0
    snd_xmos_vocalfusion_card, simple-card_codec_link snd-soc-dummy-dai-0
    Direct sample snooping device
hw:CARD=sndxmosvocalfus,DEV=0
    snd_xmos_vocalfusion_card, simple-card_codec_link snd-soc-dummy-dai-0
    Direct hardware device without any conversions
plughw:CARD=sndxmosvocalfus,DEV=0
    snd_xmos_vocalfusion_card, simple-card_codec_link snd-soc-dummy-dai-0
    Hardware device with all software conversions
pi@retropie:~ $ aplay -D sysdefault:CARD=sndxmosvocalfus /etc/emulationstation/themes/carbon-2021/art/scroll.wav
Playing WAVE '/etc/emulationstation/themes/carbon-2021/art/scroll.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono

looking at systemctl i think i’m missing “sj201”
whereis and find can’t see think as a binary

● sj201.service - SJ201 Service
   Loaded: loaded (/lib/systemd/system/sj201.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2024-05-01 12:36:50 BST; 8min ago
  Process: 538 ExecStart=/bin/bash /opt/neon/configure_sj201_on_boot.sh (code=exited, status=0/SUCCESS)
 Main PID: 538 (code=exited, status=0/SUCCESS)

May 01 12:36:50 retropie systemd[1]: Starting SJ201 Service...
May 01 12:36:50 retropie bash[538]: /opt/neon/configure_sj201_on_boot.sh: line 40: sj201: command not found
May 01 12:36:50 retropie systemd[1]: sj201.service: Succeeded.
May 01 12:36:50 retropie systemd[1]: Started SJ201 Service.

sj201 is a python package, so is sj201-interface, smbus2, smbus (still not working yet, gonna try a fresh install see if messed something up)

Do you know what kernel you’re using (uname -r will tell you)? 6.6 changed the way GPIO pins are handled and might cause some issues with the sj201 scripts, though the audio part shouldn’t be impacted…

I think 5.10 but will have to check tomorrow.
If it all fails on retropie I’ll try on stock raspberry pi

just tried 6.1 64bit raspberry pi os, I can get the fan spin down and the + - buttons to get reconised, but still no sound. I had to install sj201-interface, smbus2, smbus as root as the ovos-i2csound script needs to be sudoed/root

I think as i’m copying overlays from some repos and services/scripts for others its just a bit of a balance/fiddle to get working for me for now :frowning:

Did you install the VocalFusion drivers too?

If the devices do show up but aren’t capturing/playing audio, it might be a Pulse configuration issue… For the SJ201 I’m using this daemon.conf and this system.pa.

1 Like