This is a test to port C++'s ymfm and Rust's vgmplay to ESP32(Xtensa).

Overview

m5stack-chipstream

This is a test to port C++'s ymfm and Rust's vgmplay to ESP32(Xtensa).

Still slow and impractical, depending on the sound chip you choose.

Environment

Demo

Main Board

πŸŽ₯ https://twitter.com/h1romas4/status/1629345305861947393

TODO

  • The transfer of PCM waveforms from Rust to C is shifted depending on the memory state. (Is it due to int16_t alignment?)
  • I may be using the ring buffer or I2S DMA incorrectly. The process slows down from the same time, independent of the waveform generation process time.
  • Player control is not complete. May stop when transitioning to next song.
  • There is no interface to stop playback.

Build

@see .github/workflows/build.yml

Setup

get_idf

alias get_idf='. $HOME/esp/esp-idf/export.sh'
$ get_idf
Detecting the Python interpreter
... snip ...
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build

$ echo ${IDF_PATH}
/home/hiromasa/devel/toolchain/esp/esp-idf

$ xtensa-esp32-elf-gcc -v
Using built-in specs.
COLLECT_GCC=xtensa-esp32-elf-gcc
COLLECT_LTO_WRAPPER=/home/hiromasa/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../libexec/gcc/xtensa-esp32-elf/8.4.0/lto-wrapper
lto-wrapper
Target: xtensa-esp32-elf
... snip ...
Thread model: posix
gcc version 8.4.0 (crosstool-NG esp-2021r2-patch5)
  • Setup Rust Xtensa toolchaine

https://github.com/esp-rs/espup

curl -L https://github.com/esp-rs/espup/releases/latest/download/espup-x86_64-unknown-linux-gnu -o espup
chmod a+x espup
./espup install
cat ~/export-esp.sh
export LIBCLANG_PATH="/home/hiromasa/.espressif/tools/xtensa-esp32-elf-clang/esp-15.0.0-20221201-x86_64-unknown-linux-gnu/esp-clang/lib"
export CLANG_PATH="/home/hiromasa/.espressif/tools/xtensa-esp32-elf-clang/esp-15.0.0-20221201-x86_64-unknown-linux-gnu/esp-clang/bin/clang"
$ ls -laF ~/.rustup/toolchains/esp/
合計 28
drwxrwxr-x 7 hiromasa hiromasa 4096  2月 14 20:56 ./
drwxrwxr-x 9 hiromasa hiromasa 4096  2月 14 20:55 ../
drwxr-xr-x 2 hiromasa hiromasa 4096  2月 14 20:56 bin/
drwxr-xr-x 3 hiromasa hiromasa 4096  2月 14 20:56 etc/
drwxr-xr-x 3 hiromasa hiromasa 4096  2月 14 20:56 lib/
drwxr-xr-x 2 hiromasa hiromasa 4096  2月 14 20:56 libexec/
drwxr-xr-x 5 hiromasa hiromasa 4096  2月 14 20:56 share/
$ ~/.rustup/toolchains/esp/bin/rustc -V
rustc 1.67.0-nightly (725e31c21 2023-01-25)
$ ls -laF ~/.espressif/tools/xtensa-esp32-elf-clang/
合計 12
drwxrwxr-x  3 hiromasa hiromasa 4096  2月 14 20:58 ./
drwxrwxr-x 13 hiromasa hiromasa 4096  2月 14 20:58 ../
drwxrwxr-x  3 hiromasa hiromasa 4096  2月 14 20:58 esp-15.0.0-20221201-x86_64-unknown-linux-gnu/

Compile and Flash

  1. git clone and build
git clone --recursive https://github.com/h1romas4/m5stack-chipstream
cd m5stack-chipstream
idf.py build
  1. Restart M5Stack Core 2
idf.py flash monitor

Dependencies

Thanks for all the open source.

Name Version License
esp-idf v4.4.3 BSD License
arduino-esp32 2.0.6 LGPL-2.1 License
M5Core2 0.1.5 MIT License
M5EPD 0.1.4 The FreeType License(FreeType Part)
M5GFX 0.1.4 MIT license
ymfm d641a806 BSD-3-Clause license
libymfm.wasm v0.16.0 BSD-3-Clause license (include MAME's soundchip ports)

License

BSD-3-Clause License

You might also like...
A Rust port of parinfer.

parinfer-rust Infer parentheses for Clojure, Lisp and Scheme. https://github.com/eraserhd/parinfer-rust A full-featured, super fast implementation of

Quickly mint NFT(able)s port forwards remotely

Easy expose A really simple way to expose some service behind a NAT, similar to rathole and frp. WARNING: This does not secure the channel, or even do

πŸ“¦ Port of tauri-bundler

πŸ“¦ Port of tauri-bundler You can now easily create installers for your Deno apps, thanks to the amazing work of Tauri πŸ’ͺ

Log defmt messages over the serial port.
Log defmt messages over the serial port.

defmt-serial A defmt target for logging over a serial port. Messages can e.g. be read using socat and passed through defmt-print, see example-artemis

Rust port of the official Windows Driver Samples on Github. Leverages windows-drivers-rs

Rust Driver Samples This is a Rust port of the driver samples from the original Windows Driver Samples on Github. The repository provides examples and

KFtray - A tray application that manages port forwarding in Kubernetes.
KFtray - A tray application that manages port forwarding in Kubernetes.

Ktray is written in Rust and React, with Tauri framework. The app simplifies the process of starting and stopping multiple port forwarding configurations through a user-friendly interface.

Fusion is a cross-platform App Dev ToolKit build on Rust . Fusion lets you create Beautiful and Fast apps for mobile and desktop platform.
Fusion is a cross-platform App Dev ToolKit build on Rust . Fusion lets you create Beautiful and Fast apps for mobile and desktop platform.

Fusion is a cross-platform App Dev ToolKit build on Rust . Fusion lets you create Beautiful and Fast apps for mobile and desktop platform.

List of Persian Colors and hex colors for CSS, SCSS, PHP, JS, Python, and Ruby.

Persian Colors (Iranian colors) List of Persian Colors and hex colors for CSS, SCSS, PHP, C++, QML, JS, Python, Ruby and CSharp. Persian colors Name H

 Northstar is a horizontally scalable and multi-tenant Kubernetes cluster provisioner and orchestrator
Northstar is a horizontally scalable and multi-tenant Kubernetes cluster provisioner and orchestrator

Northstar Northstar is a horizontally scalable and multi-tenant Kubernetes cluster provisioner and orchestrator. Explore the docs Β» View Demo Β· Report

Owner
hiromasa
Retro Futuristic Gadget
hiromasa
Wait Service is a pure rust program to test and wait on the availability of a service.

Wait Service Wait Service is a pure rust program to test and wait on the availability of a service.

Magic Len (Ron Li) 3 Jan 18, 2022
Watches changes in a rust project, runs test and shows friendly notification

Cargo testify Automatically runs tests on your Rust project and notifies about the result. Install Install prerequisites (for Debian/Ubuntu): apt-get

Sergey Potapov 77 May 16, 2022
Cargo-BOJ: test and submit solutions to BOJ problems

Cargo-BOJ Test and submit solutions to BOJ (Baekjoon Online Judge) problems. Defaults are geared towards Rust solutions, but non-Rust usage is support

null 5 Apr 3, 2023
A simple workshop to learn how to write, test and deploy AWS Lambda functions using the Rust programming language

Rust Lambda Workshop Material to host a workshop on how to build and deploy Rust Lambda functions with AWS SAM and Cargo Lambda. Intro What is Serverl

Luciano Mammino 13 Mar 28, 2024
Transmute - a binary that works alone or in coordination with coverage formatter to report test quality

Transmute is a binary that works alone or in coordination with coverage formatter to report test quality. It will change your code and make the tests fail. If don't, we will raise it for you.

Victor Antoniazzi 5 Nov 17, 2022
Repo for Monaco, a DCA engine for Solana. Built on Solend and lending protocols (Jet, Solend, Port, etc...)

Monaco Monaco is a DCA protocol for solana built on top of Serum and compatible with any program that implements or extends the instruction interface

Rohan Kapur 19 Apr 13, 2022
⚑️ Fast MagicString port driven by Rust and N-API

magic-string-rs 100% API compatible (port) MagicString by Rich-Harris implementation for Node and modern browsers, also, for rust, of course. Installa

Hana 35 Nov 21, 2022
Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.

embedded-iconoir - Icons for every device, ever. What is embedded-iconor? embedded-iconoir is a library that allows you to use Iconoir on embedded dev

null 9 Mar 25, 2023
A cross-platform serial port library in Rust.

Introduction serialport-rs is a general-purpose cross-platform serial port library for Rust. It provides a blocking I/O interface and port enumeration

Bryant Mairs 143 Nov 5, 2021
A port of OxidGB to the Raspberry Pi Pico

OxidGB Pico Port This is a simple, display-only (for now) port of OxidGB to the Raspberry Pi Pico. Note that this by default overclocks your device -

James 57 Dec 7, 2022