Comments (6)
In PD I'm directly calling monome_grid_key_handler from inside a liblo server thread (set to receive monome keypresses), because there's no BEES event loop and was the quickest way to get things more-or-less working (ignoring obvious thread safety issues for now)...
It seems that BEES proper is asynchronously polling midi/monome drivers for keypress/events on a 20ms timer loop... umm that means 20ms jitter between physical keypress & the device actually responding - not exactly snappy!
https://github.com/monome/aleph/blob/dev/apps/bees/src/app_timers.c#L154-L179
So any reason we shouldn't be constantly polling for fresh midi/monome data from inside main right after calling check_events, and do away with polling timers for monome & midi stimuli?
https://github.com/monome/aleph/blob/dev/avr32_lib/src/main.c#L402-L404
Obviously conscious this kind of change will further complicate the libavr32 merge a bit...
from aleph.
here - like this...
https://github.com/rick-monster/aleph/commit/9a81042bd4ad74026af883db03f367eee9c98428
works on my machine! didn't implement/test midi but monome serial seems to work well...
from aleph.
not exactly snappy!
no argument there. if it works to switch to busy-loop USB reads, and doesn't impact other stuff, then surely, go for it.
i would just be a little careful. ultimately all usb endpoint reads end up here:
https://github.com/monome/aleph/blob/dev/avr32_lib/asf-3.7.3/avr32/drivers/usbb/usbb_host.c#L895
i would want to make sure this is reentrant. if it's not, then you would need to be disabling interrupts on every read; that could get unpleasant.
also of course we could reduce the 20ms time. that does seem like a very high number, i assume faster polling was problematic.
from aleph.
i would want to make sure this is reentrant. if it's not, then you would need to be disabling interrupts on every read; that could get unpleasant.
I guess stress-testing serial with a grid plugged in would be sufficient to know whether this is 'reentrant'? (had to google that word!)
The way I see it, the function ftdi_read() was being also called before from main, but using several more layers of indirection (i.e the monome_poll_timer_callback song & dance). So (imho) this change can only exacerbate any concurrency problems...
Well it's squished down into a single, easily reversible commit at any rate!
from aleph.
the function ftdi_read() was being also called before from main
is that true? i'm pretty sure it's like:
irq_tc() -> process_timers() -> monome_poll_timer_callback() -> ftdi_read()
that is, it's being called from the timer interrupt. so it can't be interrupted.
i'm just not sure what would happen if an interrupt came along right while uhc_ep_run()
was messing with the IRQ registers...
from aleph.
is that true?
Nope, total bs! You are correct, this is a bigger, more controversial change than I thought.
Dunno how I managed to convince myself there was an extra level of event-loop indirection there, thanks for pointing out the mistake!
from aleph.
Related Issues (20)
- Build aleph-serial -> OSC bridge in pure C HOT 12
- SVF topology review HOT 13
- net_midi/net_hid linked list implementation bug? HOT 9
- Make BEES serial protocol less crash-prone
- PD op emulator & patch editor
- Improve BEES' Output Split Feature HOT 1
- Create BEES MAGINC operator
- Make monome grid come up cleanly on boot HOT 2
- Create Param Scaler for Text Labels HOT 2
- BEES pages UI enhancements
- using bfin for graphics HOT 3
- Cheap MIDI interface fails with MIDINOTE operator HOT 24
- optimization flags HOT 3
- CV output glitches HOT 10
- lines unused slew params & 'stuck states' HOT 2
- globalTimescale seems to be getting intermittently banged with random numbers HOT 9
- Release 0.8.0 firmware (modules & BEES)
- lines write head clicks & pops
- SD card formatting details HOT 2
- Lines module crashes when loop < delay
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aleph.