AI prompts
base on m8 headless for rg351 devices # m8 Headless for RG351 devices
#### Requires M8 headless on Teensy 4.1. See: https://github.com/DirtyWave/M8Docs/blob/main/docs/M8HeadlessSetup.md
This setup should work for a variety of rg351 devices, including the rg351m, rg351mp, and rg351v. It requires a custom firmware install. Instructions will focus on ArkOS but it may also work with 351Elec or TheRA with a few tweaks.
Source files are included in the releases, so it may be possible to compile on desktop systems, consoles, and other devices.
## Thanks to lamaa for the m8c code that makes this thing work ##
lamaa's repo is here: https://github.com/laamaa/m8c/
## Download a release here
https://github.com/jasonporritt/rg351_m8c/releases
Download one of the rg351_m8c releases from the link above if you don't want to compile m8c yourself.
## Setup
1. Install ArkOS following their directions. https://github.com/christianhaitian/arkos/wiki
- See also [ArkOS cheatsheet](https://github.com/jasonporritt/rg351_m8c/blob/master/ArkOS_cheatsheet.md)
2. Copy the M8 folder into /roms/ports/ directory (or /roms2/ports if you're using the second SD card on an rg351mp)
3. Put the SD card in your device and boot it up
4. Under Ports you should now see an m8 item with a few scripts
- SETUP folder
- GAMEPAD-CONFIG - see Features below
- SETUP - will install libserialport and add your user to the proper group to interact with serial devices.
- SETUP_PULSE - installs pulseaudio if you prefer that audio subsystem
- _setup_build_tools.sh - install headers and build tools for compiling m8c
- _build_m8c.sh - build the binary
- M8 - launches m8c with cpu locked to powersave (uses alsaloop for audio)
- M8_PERFORMANCE - launches m8c with cpu locked to "performance" (uses alsaloop for audio)
- M8_PULSE - run m8c using pulseaudio with cpu locked to powersave
- M8_PULSE_PERFORMANCE - run m8c using pulseaudio with cpu locked to "performance"
- MIDI_CONNECT - automatically map every MIDI device onto every other MIDI device.
- MIDI_DISCONNECT - disconnects all mappings on all midi devices.
5. Connect your device to the internet (Wifi dongle or built-in wifi). It's required for SETUP so that packages can be installed, but not for running m8c itself.
6. Run the SETUP or SETUP_PULSE task and then reboot the device to ensure the user group changes take effect
7. Now try running M8 or M8_PULSE. If you're lucky it'll all work!
## Building m8c on the device
You can run the provided scripts to rebuild m8c on the device.
- `_setup_build_tools.sh` - MUST BE ONLINE to install build tools
- `_build_m8c.sh`
I recommend running them in a terminal session so you can see the output, but you're welcome to try your luck from the menu.
## Features
### Emulation Station friendly shell scripts
Includes scripts to run it directly from EmulationStation.
Currently tested in ArkOS, but should work with 351ELEC or TheRA and
possibly other rpi-based distributions, desktop systems, consoles, and other devices.
### setup/gamepad_config
`gamepad_config` is a console based program that lets you see what joysticks
and game controllers are detected by SDL and configure SDL mappings.
In most cases, once running, the program can be controlled exclusively by the
connected joystick/gamepad.
Includes a config helper for m8c that will translate m8c
button inputs to the proper values and output a snippet that can be dropped
in to the m8c config.ini file found in `/home/<user>/.local/share/m8c/`
### midi_connect
Automatically connect midi usb devices using ALSA (aconnect)
- midi_connect.sh - automatically map every MIDI device onto every other MIDI device.
- midi_disconnect.sh - disconnects all mappings on all midi devices.
## Problems
### No audio
The pulseaudio setup uses device numbers to avoid needing to look up device names. It has worked consistently for me but you may need to use different device numbers or names depending on your setup. You can see device names and numbers using these commands:
- sudo pulseaudio --start &
- sudo pacmd list-sources | grep -e 'name:' -e 'index:' -e device.string
- sudo pacmd list-sinks | grep -e 'name:' -e 'index:'
Also check alsamixer settings. You may have a device muted or set to low volume.
### Audio glitches
Update to latest OS. In ArkOS you can do Options > Update while connected to the internet.
If wifi is enabled you can sometimes hear audible wifi noise on the bus. Try disabling wifi before running m8c.
Try running M8_PERFORMANCE to lock the cpu to performance mode.
If the alsaloop setup (default) has audio glitches or crashes, you can use the pulseaudio variant of the commands.
- Connect your device to the internet
- Run the setup_pulse script
- Then you can run the M8_pulse script to run M8 using the pulseaudio subsystem
[Advanced Audio notes](https://github.com/jasonporritt/rg351_m8c/blob/master/advanced_audio.md)
", Assign "at most 3 tags" to the expected json: {"id":"7883","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"