M8 remote display - Rust

Related tags

Utilities rm8
Overview

RM8

Remote display for the Dirtywave M8

I first tried M8WebDisplay then discovered m8c and decided to use it as a starting point for my own version in rust..

Config

SDL scancodes

Alt + Enter will toggle fullscreen.

Shift + R key will reset the display (enable and reset display)

Alt + Shift + R key will do a full reset of the display (disconnect + enable and reset display)

Ctrl + r will help you redefine all the mappings and save the result to rm8.json. Use Esc to cancel the process.

Default key mapping

UP        = UP           # M8's `UP` key
DOWN      = DOWN         # M8's `DOWN` key
LEFT      = LEFT         # M8's `LEFT` key
RIGHT     = RIGHT        # M8's `RIGHT` key

SHIFT     = LSHIFT       # M8's `SHIFT` key
PLAY      = SPACE        # M8's `PLAY` key

EDIT      = LCTRL        # M8's `EDIT` key
OPTION    = LALT         # M8's `OPTION` key

KEYJAZZ   = RETURN       # Enter keyjazz mode
OCTAVE+   = RIGHTBRACKET # Increment octave
OCTAVE-   = LEFTBRACKET  # Decrement octave
VELOCITY+ = MINUS        # Increment velocity (use the keyboard's `Shift` key to go faster)
VELOCITY- = EQUALS       # Decrement velocity (use the keyboard's `Shift` key to go faster)

NOTE: If the keys do not overlap with keyjazz keys, then keyjazz can be left ON

Usage

Run rm8 -help to display the help screen.

Run rm8 -list to list available M8 devices.

Run rm8 -dev DEVICE to connect to the specified M8 device.

Run rm8 -wc to print the default config to the standard output.

Run rm8 -wc <FILE> to write the config to the given file.

Run rm8 -rc <FILE> to load the config from FILE.

NOTE: The default config file name is rm8.json.

Build

This project uses rust

You need to install rust and then issue: cargo build --release in the project's directory.

The program can then be found in the directory target/release.

You can strip symbols from this binary using strip rm8.

You can also compress the binary to gain some extra bytes using upx --best --lzma rm8.

Dependencies

This project uses:

Similar projects

g0m8

m8c

M8WebDisplay

Font

This project uses a bitmap render of the font stealth57.ttf by Trash80.

Original font available at https://fontstruct.com/fontstructions/show/413734/stealth57

Originally licensed under a Creative Commons Attribution Share Alike license, https://creativecommons.org/licenses/by-sa/3.0/

Info from discord

discord

M8 SLIP Serial Receive command list
'S' - Theme Color command: 4 bytes. First byte is index (0 to 12), following 3 bytes is R, G, and B
'C' - Joypad/Controller command: 1 byte. Represents all 8 keys in hardware pin order: LEFT|UP|DOWN|SELECT|START|RIGHT|OPT|EDIT
'K' - Keyjazz note command: 1 or 2 bytes.
       First byte is note, second is velocity, if note is zero stops note and does not expect a second byte.
'D' - Disable command. Send this command when disconnecting from M8. No extra bytes following
'E' - Enable display command: No extra bytes following
'R' - Reset display command: No extra bytes following

M8 SLIP Serial Send command list
251 - Joypad key pressed state (hardware M8 only) - sends the keypress state as a single byte in hardware pin order:
      LEFT|UP|DOWN|SELECT|START|RIGHT|OPT|EDIT
252 - Draw oscilloscope waveform command:
      zero bytes if off - uint8 r, uint8 g, uint8 b, followed by 320 byte value array containing the waveform
253 - Draw character command: 12 bytes. char c, int16 x position, int16 y position,
      uint8 r, uint8 g, uint8 b, uint8 r_background, uint8 g_background, uint8 b_background
254 - Draw rectangle command: 12 bytes. int16 x position, int16 y position,
      int16 width, int16 height, uint8 r, uint8 g, uint8 b

so when connecting via serial, first send a E, then a R to get all the data back from M8
its also important to end with a D
Comments
  • Pulseaudio 2s (2000ms) audio delay

    Pulseaudio 2s (2000ms) audio delay

    Hi @booss

    Really appreciate having an alternate option to m8c, and your additional menu items for controls, etc. I have an issue rm8 for both my laptop (amd64) and handheld (Odroid Go Advanced - aarch64) where pulseaudio creates a 2s delay on the audio - see requested latency for pulseaudio output.

    1 source output(s) available.
        index: 0
    	driver: <protocol-native.c>
    	flags: DONT_MOVE 
    	state: RUNNING
    	source: 1 <alsa_input.usb-DirtyWave_M8_11417570-02.analog-stereo>
    	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
    	        balance 0.00
    	muted: no
    	current latency: 0.00 ms
    	requested latency: 2000.00 ms
    	sample spec: s16le 2ch 44100Hz
    	channel map: front-left,front-right
    	             Stereo
    	resample method: (null)
    	owner module: 9
    	client: 3 <rm8-audio>
    	properties:
    		media.name = "Simple DirectMedia Layer"
    		application.name = "rm8-audio"
    		native-protocol.peer = "UNIX socket client"
    		native-protocol.version = "33"
    		application.process.id = "2523"
    		application.process.user = "ark"
    		application.process.host = "rgb10"
    		application.process.binary = "rm8-audio"
    		application.language = "C"
    		application.process.machine_id = "82b7b768bc7742e6a5f379cd3c48dd47"
    		module-stream-restore.id = "source-output-by-application-name:rm8-audio"
    

    I was able to get around this by commenting out anything relating to audio from the src and just using jackd or pulseaudio loopback instead which has no delay, but would love to see it working through your app. How can I help?

    Caleb

    opened by chaolue 13
  • looser M8 check

    looser M8 check

    This should resolve #3 on more devices.

    On mac x86_64, I still don't get sound, but it does start and seem to work (which it didn't before.)

    I can open quicktime player, and do an audio-recording (no need to record, just turn up monitor volume) and get output though, so it's at same feature-level as m8c on mac. Screenshot 2022-12-26 at 6 49 38 PM

    opened by konsumer 1
  • Need Maintainer?

    Need Maintainer?

    @booss I know you don't use rm8 as much, now that you have a real M8. I'd be happy to take over (share) maintaining it. rm8 is great, and is closer to working with audio on most platforms than m8c. I'd love to just get some PRs in around improving basic functionality, and compatibility, but otherwise keep it the same.

    opened by konsumer 0
  • CI builds & looser device-name check

    CI builds & looser device-name check

    This will build several pre-compiled releases in Github CI (#6)

    The idea is that it's triggered with a semver git-tag (like v0.0.1) but we can set it up some other way, if this is not convenient. For testing, I used dummy tags like vtest24. If you don't want to use semver, I think any tag could also trigger it, with a small change (so you can just tag your releases and it will generate a release for it.)

    • Here is an example build
    • Here is what that looks like, as a release.

    Currently, it can build:

    • linux (x86-64, arm64, arm32)
    • mac (x86-64)
    • windows (x86-64)

    It will add a new tagged release with assets so users can download the built runtime for their platform (including some config examples and the README.)

    This should have pi and handheld Anberinic devices (like this) covered, as well as windows, and older macs. I need to do more testing. I have a Mac M1, and an Intel-mac, and a few different platforms for linux, so I will try to get those all verified (and windows, in a vmachine.)

    Linux cross-building is very slow, since it builds in qemu. I think we could improve this using rust's cross-building stuff, but it seems a bit tricky with SDL2/libudev native deps.

    Main build-things left to do is mac arm64 (for M1/M2 apple silicone) and I can't seem to get it, but I made an issue over here asking for help. There is also currently an error trying to cross-build on linux spurious network error - Value too large for defined data type; class=Os (2) which I need to look into. It just started doing this, so maybe I need to adjust something in the docker-build.

    I think for mac/linux, users will probly also need instructions for installing SDL, since it's dynamically-linked. For windows, I include a SDL2.dll in build.

    # mac
    brew install sdl2
    
    # ubuntu/debian/etc
    sudo apt update
    sudo apt install libsdl2 libudev
    
    # fedora/etc
    sudo dnf install SDL2
    
    # arch linux
    sudo pacman -S sdl2
    
    opened by konsumer 4
  • More CI builds

    More CI builds

    It would be handy to have a few Github action automatic release-builds for linux/arm (for use on pi and anbernic devices) and mac/win. It has so few system-deps (sdl2 is the only one one) it would make it very easy to install on just about everything (maybe just tell users to install SDL2.)

    I'd be happy to PR for it. Generally, I set this up to happen on tag (I like semver, like v*.*.*) so to make a release you just tag & push. Alternately, non-tag/releases work too, if you set the "asset output" for the build, but it's a bit less convenient, since you have to dig through the builds to find the release.

    I don't have a great deal of experience with rust cross-building, but I have a few C-based projects that do this kid of thing, and can try to figure it out. It seems much simpler with rust.

    What targets should I set it up for? I am thinking these would be most useful:

    • linux arm32
    • linux arm64
    • linux amd64
    • windows amd64
    • mac amd64
    • mac arm64

    For mac, normally I would suggest a "universal build" since it has good built-in support for "fat binaries", but I will need to research how to do it, a bit. Using cmake with C, I can do this on github action with a few env-vars, but I think it is different in rust. I found this which might be helpful. Basically, it seems like you build the 2 binaries separately, then use lipo to merge them into a fat-binary. Maybe a first step could be the basic targets that can be built with just cargo, then I can work on trying to get a universal binary.

    opened by konsumer 2
  • Pops & clicks in audio

    Pops & clicks in audio

    Running on Rpi3B, running with and then without pulseaudio installed, I could never completely eliminate small pops and clicks every few seconds. Disabled wifi and bluetooth, same issue. With ALSA only (pulseaudio removed) I was getting ALSA 8545 buffer underrun errors. Increasing the -smp buffer setting didn't help, maybe made if worse at settings above 256.

    I then used Jack to route the USB audio from the m8 to my soundcard according to https://github.com/laamaa/m8c/blob/main/AUDIOGUIDE.md and then run rm8 -noaudio In this case the audio runs clean with no pops.

    I may have messed something up on my system, I am also having some low voltage issues, but audio is still clean with Jack.

    opened by Richsl 1
  • Additional packages required for Rpi

    Additional packages required for Rpi

    Fresh install on Rpi 3b using latest Raspian OS Need to install Rust, (duh) and sudo apt-get install libudev-dev sudo apt install libsdl2-dev

    Some compile warnings but builds after packages installed

    opened by Richsl 0
  • Error:

    Error: "No M8 audio device found"

    Hello - I'm trying the app on my Win desktop to connect to M8 and I get an error about "No M8 audio device found". The app only runs if I specify -noaudio option, but then I lose ability to get audio through the desktop. If it matters, the M8 is connected via original USB cable, so that shouldn't be affecting it. Thanks.

    opened by miroslavplese 7
Releases(v0.5.3)
Owner
Alex Boussinet
Alex Boussinet
A self-contained, single-binary Rust and Leptos application for remote Wake-on-LAN

Remote Wake-on-LAN with Rust and Leptos A self-contained, single-binary Rust and Leptos application serving a web interface to wake another device on

Valentin Bersier 6 Jan 28, 2023
🌲 Open the current remote repository in your browser

gitweb Some of the flags and options are subject to change in the future. Ideas are welcome. Ideas are bulletproof (V). gitweb is a command line inter

Yoann Fleury 26 Dec 17, 2022
Remote Secret Editor for AWS Secret Manager

Barberousse - Remote Secrets Editor About Usage Options Printing Editing Copying RoadMap 1.0 1.1 Future About A project aimed to avoid downloading sec

Mohamed Zenadi 18 Sep 28, 2021
🚧 (Alpha stage software) Binary that supports remote filesystem and process operations. 🚧

distant Binary to connect with a remote machine to edit files and run programs. ?? (Alpha stage software) This program is in rapid development and may

Chip Senkbeil 296 Dec 28, 2022
Incremental, multi-version remote backup tool for block devices.

bsync Incremental, multi-version remote backup tool for block devices. The on-disk backup format is a SQLite database and I've been dogfooding this on

Heyang Zhou 7 Aug 21, 2022
Mobile safari / webview remote debugging and e2e testing libraries

Canter (WIP) (WIP) Mobile safari / webview remote debugging and e2e testing libraries. Developed for safari/webview e2e testing on iPhone. Works only

Han Lee 9 Aug 16, 2022
The system for remote workers to prevent their family members from interrupting conference calls

onair The system for remote workers to prevent their family members from interrupting conference calls. The system is designed to automatically detect

Yushi OMOTE 6 Sep 21, 2022
📮 load, write, and copy remote and local assets

axoasset This library offers read, write, and copy functions, for local and remote assets given a string that contains a relative or absolute local pa

axo 7 Jan 25, 2023
A program written in pure Rust to query music info from mpd and display it in a notification.

musinfo A program written in pure Rust to query music info from mpd and display it in a notification. Note: Cover art is expected to be placed at /tmp

Cpt.Howdy 10 Aug 16, 2022
Small utility to display hour in a binary format on the Novation's Launchpad X.

lpx-binary-clock Small utility to display hour in a binary format on the Novation's Launchpad X. Hours, minutes and seconds are displayed one digit pe

Alexis LOUIS 1 Feb 13, 2022
k-mer counter in Rust using the rust-bio and rayon crates

krust is a k-mer counter written in Rust and run from the command line that will output canonical k-mers and their frequency across the records in a f

null 14 Jan 7, 2023
Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

null 255 Dec 30, 2022
Aws-sdk-rust - AWS SDK for the Rust Programming Language

The AWS SDK for Rust This repo contains the new AWS SDK for Rust (the SDK) and its public roadmap. Please Note: The SDK is currently released as a dev

Amazon Web Services - Labs 2k Jan 3, 2023
Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps.

rust-yew-axum-tauri-desktop template Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps. Crates frontend: Yew frontend app for de

Jet Li 54 Dec 23, 2022
A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator

tmux-thumbs A lightning fast version of tmux-fingers written in Rust for copy pasting with vimium/vimperator like hints. Usage Press ( prefix + Space

Ferran Basora 598 Jan 2, 2023
A command-line tool collection to assist development written in RUST

dtool dtool is a command-line tool collection to assist development Table of Contents Description Usage Tips Installation Description Now dtool suppor

GB 314 Dec 18, 2022
Rust mid-level IR Abstract Interpreter

MIRAI MIRAI is an abstract interpreter for the Rust compiler's mid-level intermediate representation (MIR). It is intended to become a widely used sta

Facebook Experimental 793 Jan 2, 2023
Migrate C code to Rust

C2Rust helps you migrate C99-compliant code to Rust. The translator (or transpiler) produces unsafe Rust code that closely mirrors the input C code. T

Immunant 3k Jan 8, 2023
C to Rust translator

Corrode: Automatic semantics-preserving translation from C to Rust This program reads a C source file and prints an equivalent module in Rust syntax.

Jamey Sharp 2.1k Dec 14, 2022