News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - benh

#31
Building pi-Stomp / Re: Encoder issue on first build
October 25, 2021, 02:41:05 AM
So it looks like interrupts shouldn't be a problem if we are a bit careful.

We have 4 cores in the Pi3. modep is single threaded. So it can be pinned to a core. In fact I want to play with using nohz_full and isolcpus to see if we can pin it to a completely isolated core (not even timer interrupts other than the ones requested by userspace). We can also ensure all interrupts (other maybe than the audio ones, see below) are routed to other cores.

That leaves 3 cores to handle buttons, GUI, web, network .. that's plenty and none of it needs to have real-time characteristics.

What I'm not sure is whether it's worth pinning jackd as well, and whether it should be on the same core as modep or can be on a different one. I'll do some experiments over the next few days see if I can come with a sane "default setup" that tries to avoid anything bothering the cpu doing audio processing.

Once we have that, we might want to generalize the use of interrupts for polling controls to see if we can reduce the speed of the main polling loop. I suppose we'll still need it for the ADC .. how often do we really need to poll this ? I'm thinking things like expression pedals might be a tad "sensitive". Reducing that speed would reduce CPU usage on the non-processing cores, thus reducing heat and power consumption.
#32
Building pi-Stomp / Re: Encoder issue on first build
October 24, 2021, 06:38:17 PM
The attached patch fixes it for me. I'll let others verify it doesn't affect performance (I'm not the musician, this is a present for my son, so I am really not qualified to test the audio part :-)
#33
Building pi-Stomp / Re: Encoder issue on first build
October 24, 2021, 05:20:24 PM
It's a software problem I think. If I change the polling loop to sleep 0.001 it works prefectly fine. I think we just don't get enough samples per transition to accurately debouce. I'll play around with the algorithm, or maybe see if I can get a small kernel driver to do the job more efficiently than python :-)
#34
Building pi-Stomp / Re: Encoder issue on first build
October 24, 2021, 04:36:03 AM
Is it a Bourns PEC11-4320K-S0012 ? The dimensions *seem* to match according to the datasheet I found there: https://cdn-shop.adafruit.com/datasheets/pec11.pdf

ie,  20mm shaft, 7mm of screw (not sure the right word in english), push button, 12 steps per rotation, body 3.5mm thick...

(Or another ref because this specific one or the PEC11R version are nowhere in stock, at least not anywhere near australia)
#35
Building pi-Stomp / Re: Encoder issue on first build
October 24, 2021, 03:48:50 AM
Exact same problem here ... I don't think it's worth trying to ship one to Australia though, I'll grab one myself. Anything special to look for ? Will this do (available locally here in Canberra) https://www.jaycar.com.au/rotary-encoder-with-pushbutton/p/SR1230 ?
Otherwise can I have the mouser ref ?
#36
They share an SPI bus but they surely have different chip selects no ? Would it be possible to switch the speed dynamically then when accessing them ? The ADC should ignore the clock when it's CS isn't asserted... or it doesn't ?
#37
Using pi-Stomp / Re: Clean shutdown
October 16, 2021, 05:29:23 PM
Talking of shutdown... I wonder how much work it would be to have the system boot with the sdcard mounted read-only. That would be a generally safer option long term. Maybe have a separate partition that can be mounted rw "on demand" for permanent setting (and gets unmounted as soon as the settings are saved).

It probably requires tinkering with Patchbox OS / Raspbian but a quick google shows that's something commonly done with the latter at least.