monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
630 stars 145 forks source link

"libmonome: error in write: Resource temporarily unavailable" #634

Closed okyeron closed 5 years ago

okyeron commented 5 years ago

I've run into this error a few times and I'm trying to track it down. However, it seems a bit over my head at the moment.

NOTE: This is on RasPi with my DIY teensy-grid. I'm not sure it's happening the same for stock norns and grids.

I can replicate this error running loom.lua and the cause seems to be the grid refresh rate (GRID_FRAMERATE variable in loom). If the grid is being refreshed at a rate of 27 fps or higher, the grid will basically lock up and then after about 25-30 seconds, maiden (or matron from the cmd-line) will start dumping an endless stream of "libmonome: error in write: Resource temporarily unavailable" errors. At a framerate of 26, no errors.

Questions:

catfact commented 5 years ago

i think it's coming from here:

https://github.com/monome/libmonome/blob/master/src/platform/posix.c#L163

and it suggests that the grid device is taking too long to process incoming bytes.

okyeron commented 5 years ago

OK - I've narrowed down this particular instance to a problem in my Teensy grid code where 0x12 /grid/led/all off was getting triggered after every 0x1A /grid/led/map message so there was twice the amount of LED traffic happening. (still no idea why that's happening as yet)

EDIT: followup question - do recent monome devices still use 0x12 to set all leds off with is it all with 0x19 now?

Should I close this issue, or leave it open for other instances of this error?

tehn commented 5 years ago

glad you found it. i'll close it until we see another issue.