Norns on Raspberry Pi

norns

#201

Why not using a pi compatible usb soundcard?
Latency?


#202

seems that you could use a very small HDMI screen (since the plug and circuitry is there, why not use it?)

then you need 9 pins for encoders (2 per) and keys (1 per).

the key/encoder DT overlays are easy to modify (just change pin numbers) then you don’t need to write a driver.

yes, USB sound cards have to pipe audio through the USB subsystem which means latency. pisound and norns codec use I2S which put it much closer to the low level guts


#203

is it only the norns-buttons-encoders.dtbo which manages the gpios for the encoders and keys?

or is there another place where the gpio pins get configured (HIGH/LOW IN/OUT)?


#204

Okidoki. Its only this overlay.

To change the pins it’s necessary to convert dtbo in dts

Change that new file and compile to get dtbo again

Happy hacking


#205

ok, finally Ive manage to get the performance I wanted…

this means -p 128 buffer -n 2, and no audio glitches if you use full polyphony on earthsea and flin!

the 3 issues that cause my pain were

  1. pisound was disabling preemption
    to fix, Ive now patched sound/soc/bcm/pisound.c to remove midi/spi (temp solution, but id do no use midi din)
  2. norns-init.service
    was only setting performance governor on cpu0 , so i needed to add cpu1-3
  3. performance governor was being reset back to ondemand, during initialisation.
    I think its another service, so there is an underlying dependancy missing,
    however, for now ive resolved it, by moving the norns-init into a shell script, which waits 1 second before setting the governors, now i can see the performance governor ‘sticks’ :slight_smile:

took a while to figure out, but now the whole thing is silky smooth…

to celebrate ive ordered a rPI3b+ to add a bit more processing power, which the pisound will go on.
(this rPI3 will not miss out, it gets the hifiberry dac+, and the poor old rpi2 gets retired)


#206

would you mind to explain what you did?


#207

created an init script called init.sh

echo stopped > /home/we/status.wifi
chown we.we /home/we/status.wifi

sleep 2
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

changed norns-init.service to:

we@norns:~ $ cat /etc/systemd/system/norns-init.service 
[Unit]
Description=norns-init

[Service]
Type=oneshot

ExecStart=/bin/sh -c /home/we/init.sh 

[Install]
WantedBy=norns.target

the pisound changes are bit involved to post, and as they are temporary im not sure its a good idea to distribute the change - also blokas have said they will take a look at underlying problem in a few weeks, so thats should be fine for most.
(I needed to hack it now, as I needed to ensure this was the cause of the performance issue I was facing)


#208

Yeah - I think it’s this. The SPI pins are not available there, so an SPI OLED is not gonna work.

An i2c OLED would be doable, but you can’t get framebuffer spit out to i2c - so I think that would require a special driver to be written, or reworking the screen output in norns.


#209

Pisound can pass through some GPIO pins.
https://blokas.io/pisound/docs/Specs/#raspberry-pi-pins-used-by-pisound


#210

This is not necessary. Setting governor on any core will change it on all governors.


#211

Cool
Do you know which service (?) it was that’s resetting it back to ondemand , I asume this is not happening on the norms hardware


#212

The default CPU governor is specified in kernel config (it’s powersave in stock kernel). It’s being switched to ondemand by the raspi-config service, which is also started on norns hardware but later overridden by norns-init.


#213

hmm, for some reason on my setup raspi-config must be running later…
thanks I’ll look into it.


#214

Anyone willing to upload a working Rpi norns image?


#215

Norns on a hacked up Terminal Tedium (for it’s DAC) with buttons and encoders!


#216

@TheTechnobear: how did you resize the norns display to work on the push display?

Did you rewrite the whole menu?

edit: just saw your previous post about scaling…searched for size and not for scale…lost in translation :flushed:


#217

Anyone an idea why LEVELS does not show up in the menu?

:man_shrugging:


#218

Go to the menu, press key 2 (back)

(Then key3 to exit which always stumps me :wink: )

Btw, my demo video is rendering/uploading so you can see what I’ve been up to


#219

nope that doesn’t work for me :frowning: I just end up with the screen for the script.

and/but

when I’m in the menu and press key 2 I get following message in the matron window in maiden:

/home/we/norns/lua/screen.lua:161: bad argument #1 to 's_extents' (string expected, got nil)

here is the part form screen.lua (starting with line 160):

s_text_right = function(str)
  local x, y = s_extents(str)
  s_move_rel(-x, 0)
  s_text(str)
end

#220

Ah, that’s caused by not having the battery hardware.
I updated the script to check for nil when no battery is present.