Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen support. #8

Closed
Mylab6 opened this issue Dec 17, 2021 · 6 comments
Closed

Screen support. #8

Mylab6 opened this issue Dec 17, 2021 · 6 comments

Comments

@Mylab6
Copy link

Mylab6 commented Dec 17, 2021

Hi, I have an old Mikro and I'm trying to turn it into a wireless midi controller. If I could get the screen to work as well( from a Raspberry Pi ) that would open up tons of possibilities .

Do you know what this would entail ?

@harryhaaren
Copy link
Contributor

Hi @Mylab6,

The code here already supports screen blanking; https://github.com/wrl/maschine.rs/blob/trunk/src/devices/mk2/mikro.rs#L299

Further the Ctlra library (disclaimer; I'm the author) supports some screen blitting too:
https://github.com/openAVproductions/openAV-Ctlra/blob/master/ctlra/devices/ni_maschine_mikro_mk2.c#L469

Overall, its just a bitmap (1 = on, 0 = off) screen of ~8192 pixels IIRC. The way to "blit" the image is in 4 seperate writes to the USB endpoint, see https://github.com/wrl/maschine.rs/blob/trunk/src/devices/mk2/mikro.rs#L307 or https://github.com/openAVproductions/openAV-Ctlra/blob/master/ctlra/devices/ni_maschine_mikro_mk2.c#L507.

I've had various Maschine's working with RPi before, using the newer RPi's (with better performing USB implementations) will give better results. I could only get about 5 to 10 FPS on the Maschine Mk3 (with 2x full colour 420x272 px screens) on the RPi 4. I guess with a much simpler (1 bit per pixel) interface like the Mikro Mk2 has, it should work fine.

Hope that helps, -Harry

@Mylab6
Copy link
Author

Mylab6 commented Dec 24, 2021

Thanks Harry, I'm actually a bit stuck even getting the PI to see Maschine's USB connection , if you could assist in automating getting the PI to find Maschine, I'd greatly appreciate it !

I'd like to add an auto-setup script for Machine to my existing repo which automatically sets up Midi wireless.

https://github.com/Mylab6/PiBluetoothMidSetup

@harryhaaren
Copy link
Contributor

@Mylab6; there's nothing "special" about how a RPi uses a USB device vs normal linux. Following the instructions on the README page, https://github.com/wrl/maschine.rs/ says run cargo run --release /dev/hidraw0 and replace hidraw0 with hidrawX where X comes from the output of dmesg (look at dmesg 5 secs after plugging it in, it will list what hidraw it allocated for the device).

@Mylab6
Copy link
Author

Mylab6 commented Jan 1, 2022

Thanks, I think I'm close , but I'm stuck on this error.

 Running `target/release/maschine /dev/hdraw3`

thread 'main' panicked at 'couldn't open /dev/hdraw3: No such file or directory', src/main.rs:385:21
stack backtrace:
0: rust_begin_unwind
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
1: std::panicking::begin_panic_fmt
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
2: maschine::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

@harryhaaren
Copy link
Contributor

@Mylab6; did you typo the /dev/hdraw3? It should be hid not hd. The "no such file or directory" error suggests that...

@Mylab6
Copy link
Author

Mylab6 commented Jan 1, 2022

Thank you !

I have it working via Bluetooth Midi.

@Mylab6 Mylab6 closed this as completed Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants