├── install
├── norns
│ ├── files
│ │ ├── interfaces
│ │ ├── raspi-blacklist.conf
│ │ ├── common_audio.tar
│ │ ├── matron.sh
│ │ ├── matron4.sh
│ │ ├── asound.conf
│ │ ├── cmdline.txt
│ │ ├── asound-rpiproto.conf
│ │ ├── cmdline4.txt
│ │ ├── alsa-base.conf
│ │ ├── norns-matron-launcher.sh
│ │ ├── norns-init.service
│ │ ├── norns-matron.service-rpi3
│ │ ├── norns-matron.service-rpi4
│ │ ├── ttymidi.service
│ │ ├── norns-crone.service
│ │ ├── norns-matron.service
│ │ ├── norns-sclang.service
│ │ ├── norns.target
│ │ ├── norns-jack.service
│ │ ├── dnsmasq.conf
│ │ ├── rc.local
│ │ ├── aliases.conf
│ │ ├── matronrc-pi3.lua
│ │ ├── matronrc-pi4.lua
│ │ ├── smb.conf
│ │ ├── init-norns.sh
│ │ ├── systemd-udevd.service
│ │ ├── dphys-swapfile
│ │ ├── dphys-swapfile-swap
│ │ ├── crone
│ │ │ └── wscript
│ │ ├── samba
│ │ ├── config.txt
│ │ ├── config4.txt
│ │ ├── setup.sh
│ │ ├── device
│ │ │ ├── device_monitor.c
│ │ │ └── device_monitor-201029.c
│ │ └── alsa.conf
│ ├── scripts
│ │ ├── crone_wscript_fix.sh
│ │ ├── pull_norns.sh
│ │ ├── diy_device_fix.sh
│ │ ├── fates_networkmanager.sh
│ │ ├── fates_prepare_rpi3.sh
│ │ ├── fates_prepare_rpi4.sh
│ │ ├── fates_prepare_5.4.sh
│ │ ├── fates_prepare_rpi3-5.4.sh
│ │ ├── fates_prepare_rpi3buster.sh
│ │ ├── fates_packages.sh
│ │ ├── fates_install_1.2.sh
│ │ ├── fates_install.sh
│ │ ├── fates_install_5.4.sh
│ │ ├── fates_install_pi3buster.sh
│ │ └── fates_install_pi4.sh
│ ├── Norns_disk_image_install.md
│ └── Norns_install_instructions_1.8.md
├── README.md
└── orac
│ ├── README.md
│ └── scripts
│ ├── fates_prepare.sh
│ ├── fates_prepare_rpi3.sh
│ ├── fates_prepare_rpi4.sh
│ ├── fates_prepare_rpi3buster.sh
│ └── fates_packages.sh
├── .gitattributes
├── hardware
├── buildpix
│ ├── 100R.png
│ ├── 100n.png
│ ├── 10k.png
│ ├── 18p.png
│ ├── 220R.png
│ ├── 220p.png
│ ├── 2k2.png
│ ├── 47k.png
│ ├── 5k1.png
│ ├── 5k6.png
│ ├── dac.png
│ ├── vreg.png
│ ├── buttons.png
│ ├── crystal.png
│ ├── voltage.png
│ ├── standoffs.jpg
│ ├── voltage1.png
│ ├── display_pins.jpg
│ ├── display_pins2.jpg
│ ├── fates_usbjack.png
│ └── fates_usb_soldered.jpg
├── fates1.8.1_top.png
├── fates-case-v1.8.1.ai
├── fates-case-v2-minimum.ai
├── fates-top-bottom-v1.8.1.ai
├── fates-case-v1.8.1-bigholes.ai
├── fates-case-v1.8.1-hex-ponoko.eps
├── fates-case-v1.8.1-lines-ponoko.eps
├── AcrylicCase.md
├── BOM-thruhole.md
├── Build.md
└── BOM.md
├── norns-stopall.sh
├── norns-restart.sh
├── .gitignore
├── overlays
├── README.md
├── fates1.5-ssd1322-overlay.dts
├── fates1.7-ssd1322-overlay.dts
├── fates1.2-ssd1322-overlay.dts
├── fates1.8-ssd1322-overlay.dts
├── fates1.2-buttons-encoders-overlay.dts
├── fates1.7-buttons-encoders-overlay.dts
├── fates1.5-buttons-encoders-overlay.dts
└── fates1.7-buttons-4encoders-overlay.dts
├── FAQ.md
├── troubleshooting.md
└── README.md
/install/norns/files/interfaces:
--------------------------------------------------------------------------------
1 | auto wlan0
2 |
--------------------------------------------------------------------------------
/install/norns/files/raspi-blacklist.conf:
--------------------------------------------------------------------------------
1 |
2 | blacklist snd_bcm2835
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/hardware/buildpix/100R.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/100R.png
--------------------------------------------------------------------------------
/hardware/buildpix/100n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/100n.png
--------------------------------------------------------------------------------
/hardware/buildpix/10k.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/10k.png
--------------------------------------------------------------------------------
/hardware/buildpix/18p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/18p.png
--------------------------------------------------------------------------------
/hardware/buildpix/220R.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/220R.png
--------------------------------------------------------------------------------
/hardware/buildpix/220p.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/220p.png
--------------------------------------------------------------------------------
/hardware/buildpix/2k2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/2k2.png
--------------------------------------------------------------------------------
/hardware/buildpix/47k.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/47k.png
--------------------------------------------------------------------------------
/hardware/buildpix/5k1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/5k1.png
--------------------------------------------------------------------------------
/hardware/buildpix/5k6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/5k6.png
--------------------------------------------------------------------------------
/hardware/buildpix/dac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/dac.png
--------------------------------------------------------------------------------
/hardware/buildpix/vreg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/vreg.png
--------------------------------------------------------------------------------
/hardware/fates1.8.1_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates1.8.1_top.png
--------------------------------------------------------------------------------
/hardware/buildpix/buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/buttons.png
--------------------------------------------------------------------------------
/hardware/buildpix/crystal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/crystal.png
--------------------------------------------------------------------------------
/hardware/buildpix/voltage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/voltage.png
--------------------------------------------------------------------------------
/hardware/fates-case-v1.8.1.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates-case-v1.8.1.ai
--------------------------------------------------------------------------------
/hardware/buildpix/standoffs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/standoffs.jpg
--------------------------------------------------------------------------------
/hardware/buildpix/voltage1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/voltage1.png
--------------------------------------------------------------------------------
/hardware/buildpix/display_pins.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/display_pins.jpg
--------------------------------------------------------------------------------
/hardware/fates-case-v2-minimum.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates-case-v2-minimum.ai
--------------------------------------------------------------------------------
/hardware/buildpix/display_pins2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/display_pins2.jpg
--------------------------------------------------------------------------------
/hardware/buildpix/fates_usbjack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/fates_usbjack.png
--------------------------------------------------------------------------------
/hardware/fates-top-bottom-v1.8.1.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates-top-bottom-v1.8.1.ai
--------------------------------------------------------------------------------
/install/norns/files/common_audio.tar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/install/norns/files/common_audio.tar
--------------------------------------------------------------------------------
/hardware/fates-case-v1.8.1-bigholes.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates-case-v1.8.1-bigholes.ai
--------------------------------------------------------------------------------
/install/norns/files/matron.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./build/ws-wrapper/ws-wrapper ws://*:5555 ./build/matron/matron -f/dev/fb1
3 |
--------------------------------------------------------------------------------
/install/norns/files/matron4.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ./build/ws-wrapper/ws-wrapper ws://*:5555 ./build/matron/matron -f/dev/fb0
3 |
--------------------------------------------------------------------------------
/hardware/buildpix/fates_usb_soldered.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/buildpix/fates_usb_soldered.jpg
--------------------------------------------------------------------------------
/hardware/fates-case-v1.8.1-hex-ponoko.eps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates-case-v1.8.1-hex-ponoko.eps
--------------------------------------------------------------------------------
/hardware/fates-case-v1.8.1-lines-ponoko.eps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/okyeron/fates/HEAD/hardware/fates-case-v1.8.1-lines-ponoko.eps
--------------------------------------------------------------------------------
/norns-stopall.sh:
--------------------------------------------------------------------------------
1 | sudo systemctl stop norns-jack.service
2 | sudo systemctl stop norns-matron.service
3 | sudo systemctl stop norns-crone.service
4 |
5 |
--------------------------------------------------------------------------------
/norns-restart.sh:
--------------------------------------------------------------------------------
1 | sudo systemctl restart norns-jack.service
2 | sudo systemctl restart norns-matron.service
3 | sudo systemctl restart norns-crone.service
4 |
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | install/norns/scripts/fates_install_5.10.sh
3 | install/norns/scripts/fates_prepare_5.10.sh
4 | install/norns/Norns_install_instructions_1.8_2022.md
5 |
--------------------------------------------------------------------------------
/install/norns/files/asound.conf:
--------------------------------------------------------------------------------
1 | pcm.!default {
2 | type hw card 0
3 | }
4 |
5 | ctl.!default {
6 | type hw card 0
7 | }
8 |
--------------------------------------------------------------------------------
/install/norns/files/cmdline.txt:
--------------------------------------------------------------------------------
1 | dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
2 |
--------------------------------------------------------------------------------
/install/norns/scripts/crone_wscript_fix.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | cd /home/we/norns
3 | sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
4 | ./waf configure
5 | ./waf
--------------------------------------------------------------------------------
/install/norns/files/asound-rpiproto.conf:
--------------------------------------------------------------------------------
1 | pcm.!default {
2 | type hw card sndrpiproto
3 | }
4 |
5 | ctl.!default {
6 | type hw card sndrpiproto
7 | }
8 |
--------------------------------------------------------------------------------
/install/norns/files/cmdline4.txt:
--------------------------------------------------------------------------------
1 | dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline consoleblank=0 fbcon=map:1 fsck.repair=yes rootwait
2 |
--------------------------------------------------------------------------------
/install/norns/scripts/pull_norns.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | cd /home/we/norns
3 | git pull
4 | sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
5 | ./waf configure
6 | ./waf
7 | sed -i '1s/.*/191230/' /home/we/version.txt
--------------------------------------------------------------------------------
/install/norns/files/alsa-base.conf:
--------------------------------------------------------------------------------
1 | # This sets the index value of the cards but doesn't reorder.
2 | options snd_usb_audio index=-2
3 | options snd_soc_rpi_proto index=0
4 |
5 | # Does the reordering.
6 | options snd slots=snd_soc_rpi_proto, snd_usb_audio
7 |
--------------------------------------------------------------------------------
/install/norns/files/norns-matron-launcher.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | framebuffer="/dev/fb0"
3 | if [ -e /dev/fb1 ] ; then
4 | framebuffer="/dev/fb1"
5 | fi
6 | /home/we/norns/build/ws-wrapper/ws-wrapper ws://*:5555 /home/we/norns/build/matron/matron -f${framebuffer}
7 |
8 |
9 |
--------------------------------------------------------------------------------
/install/norns/files/norns-init.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=norns-init
3 |
4 | [Service]
5 | Type=oneshot
6 |
7 | ExecStart=/bin/sh -c "/bin/echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
8 |
9 | [Install]
10 | WantedBy=norns.target
11 |
--------------------------------------------------------------------------------
/install/norns/files/norns-matron.service-rpi3:
--------------------------------------------------------------------------------
1 | [Unit]
2 |
3 | [Service]
4 | Type=simple
5 | User=we
6 | Group=we
7 | ExecStart=/home/we/norns/build/ws-wrapper/ws-wrapper ws://*:5555 /home/we/norns/build/matron/matron -f/dev/fb1
8 | [Install]
9 | WantedBy=norns.target
10 |
--------------------------------------------------------------------------------
/install/norns/files/norns-matron.service-rpi4:
--------------------------------------------------------------------------------
1 | [Unit]
2 |
3 | [Service]
4 | Type=simple
5 | User=we
6 | Group=we
7 | ExecStart=/home/we/norns/build/ws-wrapper/ws-wrapper ws://*:5555 /home/we/norns/build/matron/matron -f/dev/fb0
8 | [Install]
9 | WantedBy=norns.target
10 |
--------------------------------------------------------------------------------
/install/norns/files/ttymidi.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=ttyMIDI daemon
3 | After=sound.target
4 |
5 | [Service]
6 | ExecStart=/usr/bin/ttymidi -s /dev/ttyAMA0 -b 38400 -n Fates
7 | EnvironmentFile=/etc/environment
8 |
9 | [Install]
10 | WantedBy=multi-user.target
11 |
--------------------------------------------------------------------------------
/hardware/AcrylicCase.md:
--------------------------------------------------------------------------------
1 | ## Fates Acrylic Case Kits
2 |
3 |
4 | ### Standoff guide
5 |
6 |
7 |
8 | ### Assembly
9 |
10 | I made an assembly video which you can [watch over on Youtube](https://youtu.be/23gvgvg2Bow)
11 |
--------------------------------------------------------------------------------
/install/norns/scripts/diy_device_fix.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | cd /home/we/norns
3 | sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
4 | sudo cp -f /home/we/fates/install/norns/files/device/device_monitor.c /home/we/norns/matron/src/device/device_monitor.c
5 | ./waf configure
6 | ./waf
--------------------------------------------------------------------------------
/install/norns/files/norns-crone.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | After=norns-jack.service
3 | Requires=norns-jack.service
4 |
5 | [Service]
6 | Type=simple
7 | User=we
8 | Group=we
9 | LimitRTPRIO=95
10 | LimitMEMLOCK=infinity
11 | ExecStart=/home/we/norns/build/crone/crone
12 |
13 | [Install]
14 | WantedBy=norns.target
15 |
--------------------------------------------------------------------------------
/install/norns/files/norns-matron.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | After=norns-jack.service
3 | #Requires=norns-jack.service
4 |
5 | [Service]
6 | Type=simple
7 | User=we
8 | Group=we
9 | ExecStart=/home/we/norns/build/ws-wrapper/ws-wrapper ws://*:5555 /home/we/norns/build/matron/matron
10 |
11 | [Install]
12 | WantedBy=norns.target
13 |
--------------------------------------------------------------------------------
/install/norns/files/norns-sclang.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | After=norns-jack.service
3 | Requires=norns-jack.service
4 |
5 | [Service]
6 | Type=simple
7 | User=we
8 | Group=we
9 | LimitRTPRIO=95
10 | LimitMEMLOCK=infinity
11 | ExecStart=/home/we/norns/build/ws-wrapper/ws-wrapper ws://*:5556 /usr/local/bin/sclang -i maiden
12 |
13 | [Install]
14 | WantedBy=norns.target
15 |
--------------------------------------------------------------------------------
/install/norns/files/norns.target:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=norns
3 |
4 | Requires=sockets.target
5 | Requires=sound.target
6 |
7 | Requires=norns-jack.service
8 | Requires=norns-crone.service
9 | Requires=norns-sclang.service
10 | Requires=norns-matron.service
11 | Requires=norns-maiden.service
12 |
13 | AllowIsolate=yes
14 |
15 | [Install]
16 | WantedBy=multi-user.target
17 |
--------------------------------------------------------------------------------
/install/norns/files/norns-jack.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | After=sound.target
3 |
4 | [Service]
5 | Type=simple
6 | User=we
7 | Group=we
8 | Environment="JACK_NO_AUDIO_RESERVATION=1"
9 | LimitRTPRIO=95
10 | LimitMEMLOCK=infinity
11 | ExecStart=/usr/bin/jackd -R -P 95 -d alsa -d hw:sndrpiproto -r 48000 -n 3 -p 128 -S -s
12 | ExecStartPost=/usr/bin/jack_wait -w -t 10
13 | TimeoutStopSec=1
14 |
15 | [Install]
16 | WantedBy=norns.target
17 |
--------------------------------------------------------------------------------
/install/norns/files/dnsmasq.conf:
--------------------------------------------------------------------------------
1 | interface=wlan0 # Use interface wlan0
2 | listen-address=172.24.1.1 # Explicitly specify the address to listen on
3 | bind-interfaces # Bind to the interface to make sure we aren't sending things elsewhere
4 | server=8.8.8.8 # Forward DNS requests to Google DNS
5 | domain-needed # Don't forward short names
6 | bogus-priv # Never forward addresses in the non-routed address spaces.
7 | dhcp-range=172.24.1.50,172.24.1.150,12h # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time
8 |
--------------------------------------------------------------------------------
/install/README.md:
--------------------------------------------------------------------------------
1 | # Fates DAC board for raspberry pi
2 |
3 | See:
4 |
5 | - [Installing Fates 1.8+ from disk image](https://github.com/okyeron/fates/blob/master/install/norns/Norns_disk_image_install.md) **(recommended)**
6 |
7 | - [Installing Norns on Fates 1.8+ (Full Install Procedure)](https://github.com/okyeron/fates/blob/master/install/norns/Norns_install_instructions_1.8.md)
8 |
9 | # Important - regarding norns software updates
10 | If you are on a version of norns before 200218 ***DO NOT*** run the on device SYSTEM > UPDATE from the norns menu.
11 |
12 | You will need to update manually. [See here](https://github.com/fates-project/norns/releases)
13 |
--------------------------------------------------------------------------------
/install/norns/files/rc.local:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 | #
3 | # rc.local
4 | #
5 | # This script is executed at the end of each multiuser runlevel.
6 | # Make sure that the script will "exit 0" on success or any other
7 | # value on error.
8 | #
9 | # In order to enable or disable this script just change the execution
10 | # bits.
11 | #
12 | # By default this script does nothing.
13 |
14 | # Print the IP address
15 | _IP=$(hostname -I) || true
16 | if [ "$_IP" ]; then
17 | printf "My IP address is %s\n" "$_IP"
18 | fi
19 |
20 | printf "Setting WM8731 Codec Headphone Level\n"
21 | i2cset -f -y 1 0x1a 0x05 0x70
22 |
23 | echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
24 |
25 | exit 0
26 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_networkmanager.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 | sudo apt install network-manager -y
3 | sudo cp /home/we/fates/install/norns/files/interfaces /etc/network/interfaces
4 | sudo cp /home/we/norns-image/config/network-manager/100-disable-wifi-mac-randomization.conf /etc/NetworkManager/conf.d/
5 | sudo cp /home/we/norns-image/config/network-manager/101-logging.conf /etc/NetworkManager/conf.d/
6 | sudo cp /home/we/norns-image/config/network-manager/200-disable-nmcli-auth.conf /etc/NetworkManager/conf.d/
7 | sudo systemctl disable pppd-dns.service
8 | sudo apt-get -y remove modemmanager
9 |
10 | sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant_bak.conf
11 |
12 | sudo reboot
--------------------------------------------------------------------------------
/install/norns/files/aliases.conf:
--------------------------------------------------------------------------------
1 | # These are the standard aliases and dependencies.
2 | # This file does not need to be modified.
3 |
4 | # prevent unusual drivers from appearing as the first sound device ###########
5 | options snd-pcsp index=-2
6 | #options snd-usb-audio index=-2
7 | options cx88_alsa index=-2
8 | options snd-atiixp-modem index=-2
9 | options snd-intel8x0m index=-2
10 | options snd-via82xx-modem index=-2
11 |
12 | # work around other kernel issues ############################################
13 | # The EHCI driver should be loaded before the ones for low speed controllers
14 | # or some devices may be confused when they are disconnected and reconnected.
15 | softdep uhci-hcd pre: ehci-hcd
16 | softdep ohci-hcd pre: ehci-hcd
17 |
18 |
--------------------------------------------------------------------------------
/install/orac/README.md:
--------------------------------------------------------------------------------
1 | # Fates DAC board for raspberry pi
2 |
3 | # Orac BETA
4 |
5 | Everything here depends on having a working norns setup. Please see that installation first.
6 |
7 | NOTE - This thread on the lines forum is the best place to get information on running Orac on Fates.
8 |
9 | Installation information is in the Top Post:
10 |
11 | https://llllllll.co/t/orac-sidekick-and-pure-data-for-norns/26198
12 |
13 | ### Video:
14 |
15 | https://youtu.be/Ukzc3W_lcjk
16 |
17 | ### Download
18 |
19 | Orac, Sidekick - https://patchstorage.com/orac-2-0-for-norns/
20 |
21 | ### Demo Pure Data apps featured in Video
22 |
23 | SimplePd - https://patchstorage.com/simple-demo-patch-for-norns/ 1
24 | PolyPd - https://patchstorage.com/polypd-for-norns/
--------------------------------------------------------------------------------
/install/norns/files/matronrc-pi3.lua:
--------------------------------------------------------------------------------
1 | function init_norns()
2 | _boot.add_io('screen:fbdev', {dev='/dev/fb1'})
3 | _boot.add_io('keys:gpio', {dev='/dev/input/by-path/platform-keys-event'})
4 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob1-event', index=1})
5 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob2-event', index=2})
6 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob3-event', index=3})
7 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob4-event', index=4})
8 | end
9 |
10 | function init_desktop()
11 | -- desktop window
12 | _boot.add_io('screen:sdl', {})
13 | -- _boot.add_io('input:sdl', {})
14 |
15 | -- i/o via maiden
16 | -- _boot.add_io('screen:json', {})
17 | -- _boot.input_add('web_input', 'json', {})
18 | end
19 |
20 | init_norns()
21 |
22 |
--------------------------------------------------------------------------------
/install/norns/files/matronrc-pi4.lua:
--------------------------------------------------------------------------------
1 | function init_norns()
2 | _boot.add_io('screen:fbdev', {dev='/dev/fb0'})
3 | _boot.add_io('keys:gpio', {dev='/dev/input/by-path/platform-keys-event'})
4 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob1-event', index=1})
5 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob2-event', index=2})
6 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob3-event', index=3})
7 | _boot.add_io('enc:gpio', {dev='/dev/input/by-path/platform-soc:knob4-event', index=4})
8 | end
9 |
10 | function init_desktop()
11 | -- desktop window
12 | _boot.add_io('screen:sdl', {})
13 | -- _boot.add_io('input:sdl', {})
14 |
15 | -- i/o via maiden
16 | -- _boot.add_io('screen:json', {})
17 | -- _boot.input_add('web_input', 'json', {})
18 | end
19 |
20 | init_norns()
21 |
22 |
--------------------------------------------------------------------------------
/install/norns/files/smb.conf:
--------------------------------------------------------------------------------
1 | [global]
2 | browseable = no
3 | workgroup = WORKGROUP
4 | dns proxy = no
5 | log file = /var/log/samba/log.%m
6 | max log size = 1000
7 | syslog = 0
8 | panic action = /usr/share/samba/panic-action %d
9 | server role = standalone server
10 | passdb backend = tdbsam
11 | obey pam restrictions = yes
12 | unix password sync = yes
13 | passwd program = /usr/bin/passwd %u
14 | passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
15 | pam password change = yes
16 | map to guest = bad user
17 | usershare allow guests = no
18 |
19 | [dust]
20 | Comment = dust
21 | Path = /home/we/dust
22 | Browseable = yes
23 | Writeable = yes
24 | read only = no
25 | only guest = no
26 | create mask = 0777
27 | directory mask = 0777
28 | Public = no
29 | Guest ok = no
30 | veto files = /._*/.DS_Store/
31 | delete veto files = yes
32 |
--------------------------------------------------------------------------------
/overlays/README.md:
--------------------------------------------------------------------------------
1 | # Fates DAC board for raspberry pi version 1.7+
2 |
3 | # Overlays and GPIO assignments
4 |
5 | ## Key/button GPIO (v1.7+)
6 |
7 | - K1 : GPIO 24
8 | - K2 : GPIO 25
9 | - K3: GPIO 23
10 |
11 |
12 | ## Encoder GPIO (v1.7+)
13 |
14 | - E1A : GPIO 5
15 | - E1B : GPIO 6
16 |
17 | - E2A : GPIO 13
18 | - E2B : GPIO 12
19 |
20 | - E3A : GPIO 27
21 | - E3B : GPIO 22
22 |
23 | - E4A : GPIO 26
24 | - E4B : GPIO 16
25 |
26 | ## OLED display (v1.7+)
27 |
28 | - RES : GPIO 4
29 | - DC : GPIO 17
30 |
31 |
32 | ## for reference (this is handled by install script)
33 | ```
34 | # compile the overlays (buttons and encoders + ssd1322)
35 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-encoders-overlay.dts
36 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-ssd1322.dtbo /home/we/fates/overlays/fates1.7-ssd1322-overlay.dts
37 | ```
38 |
--------------------------------------------------------------------------------
/install/orac/scripts/fates_prepare.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | sudo apt-get -y install libncurses5-dev
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth 1 --branch rpi-4.14.y-rt https://github.com/raspberrypi/linux
5 | cd linux
6 | git checkout 22bb67b8e2e809d0bb6d435c1d20b409861794d2
7 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/pi/linux/drivers/staging/fbtft/
8 | cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/pi/linux/arch/arm/configs/bcm2709_defconfig
9 | cp ~/norns-linux-bits/.config /home/pi/linux/.config
10 |
11 | cd ~/linux
12 | export KERNEL=kernel7
13 | make mrproper
14 | make bcm2709_defconfig
15 | make modules_prepare
16 |
17 | make -j4 zImage modules dtbs
18 | sudo make modules_install
19 | sudo cp arch/arm/boot/dts/*.dtb /boot/
20 | sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
21 | sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
22 | sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
23 |
24 | sudo reboot
25 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_prepare_rpi3.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 |
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth 1 --branch rpi-4.14.y-rt https://github.com/raspberrypi/linux
5 |
6 | cd ~/linux
7 | git checkout 22bb67b8e2e809d0bb6d435c1d20b409861794d2
8 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
9 | cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
10 | cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
11 | cp ~/norns-linux-bits/.config /home/we/linux/.config
12 |
13 | cd ~/linux
14 | export KERNEL=kernel7
15 | make mrproper
16 | make bcm2709_defconfig
17 | make modules_prepare
18 |
19 | make -j4 zImage modules dtbs
20 | sudo make modules_install
21 | sudo cp arch/arm/boot/dts/*.dtb /boot/
22 | sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
23 | sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
24 | sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
25 |
26 | sudo reboot
27 |
--------------------------------------------------------------------------------
/install/norns/files/init-norns.sh:
--------------------------------------------------------------------------------
1 | #init gpio
2 |
3 | # turn analog gain stages to unity
4 | # note this gain stage is only applicable to round 1 prototypes
5 | # this will throw an error on others.
6 | # Channel 0 0000 0000
7 | #sudo i2cset -y 1 0x28 0x00
8 | # Channel 1 0100 0000
9 | #sudo i2cset -y 1 0x28 0x40
10 |
11 | # input gain stage. the default is mute so we skip this. we let matron turn it on.
12 | # but the values below are sane defaults otherwise (unity gain)
13 | #sudo i2cset -y 1 0x29 0x00
14 | #sudo i2cset -y 1 0x29 0x40
15 |
16 | # unmute soundcard output
17 | #amixer set Master 100% on
18 |
19 | # enable headphone driver (let matron handle this)
20 | #sudo i2cset -y 1 0x60 1 192 # enable HP outputs
21 | #sudo i2cset -y 1 0x60 2 32 # unmute, set vol to -10db
22 | #sudo i2cset -y 1 0x60 2 52 # unmute, set vol to 0.1db
23 |
24 | # start norns
25 | su we -c "cd /home/we/norns; ./start.sh;"
26 |
27 | # start maiden
28 | su we -c "cd /home/we/maiden; ./start.sh;"
29 |
30 | # clean up stale wifi status from shutdown
31 | echo stopped > $HOME/status.wifi
32 |
--------------------------------------------------------------------------------
/install/orac/scripts/fates_prepare_rpi3.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 | sudo apt-get -y install libncurses5-dev
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth 1 --branch rpi-4.14.y-rt https://github.com/raspberrypi/linux
5 | cd linux
6 | git checkout 22bb67b8e2e809d0bb6d435c1d20b409861794d2
7 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
8 | cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
9 | cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
10 | cp ~/norns-linux-bits/.config /home/we/linux/.config
11 |
12 | cd ~/linux
13 | export KERNEL=kernel7
14 | make mrproper
15 | make bcm2709_defconfig
16 | make modules_prepare
17 |
18 | make -j4 zImage modules dtbs
19 | sudo make modules_install
20 | sudo cp arch/arm/boot/dts/*.dtb /boot/
21 | sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
22 | sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
23 | sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
24 |
25 | sudo reboot
26 |
--------------------------------------------------------------------------------
/install/norns/files/systemd-udevd.service:
--------------------------------------------------------------------------------
1 | # This file is part of systemd.
2 | #
3 | # systemd is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU Lesser General Public License as published by
5 | # the Free Software Foundation; either version 2.1 of the License, or
6 | # (at your option) any later version.
7 |
8 | [Unit]
9 | Description=udev Kernel Device Manager
10 | Documentation=man:systemd-udevd.service(8) man:udev(7)
11 | DefaultDependencies=no
12 | Wants=systemd-udevd-control.socket systemd-udevd-kernel.socket
13 | After=systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-sysusers.service
14 | Before=sysinit.target
15 | ConditionPathIsReadWrite=/sys
16 |
17 | [Service]
18 | Type=notify
19 | OOMScoreAdjust=-1000
20 | Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
21 | Restart=always
22 | RestartSec=0
23 | ExecStart=/lib/systemd/systemd-udevd
24 | KillMode=mixed
25 | WatchdogSec=3min
26 | TasksMax=infinity
27 | MountFlags=shared
28 | MemoryDenyWriteExecute=yes
29 | RestrictRealtime=yes
30 | RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6
31 |
--------------------------------------------------------------------------------
/install/norns/files/dphys-swapfile:
--------------------------------------------------------------------------------
1 | # /etc/dphys-swapfile - user settings for dphys-swapfile package
2 | # author Neil Franklin, last modification 2010.05.05
3 | # copyright ETH Zuerich Physics Departement
4 | # use under either modified/non-advertising BSD or GPL license
5 |
6 | # this file is sourced with . so full normal sh syntax applies
7 |
8 | # the default settings are added as commented out CONF_*=* lines
9 |
10 |
11 | # where we want the swapfile to be, this is the default
12 | #CONF_SWAPFILE=/var/swap
13 |
14 | # set size to absolute value, leaving empty (default) then uses computed value
15 | # you most likely don't want this, unless you have an special disk situation
16 | #CONF_SWAPSIZE=
17 |
18 | # set size to computed value, this times RAM size, dynamically adapts,
19 | # guarantees that there is enough swap without wasting disk space on excess
20 | #CONF_SWAPFACTOR=2
21 |
22 | # restrict size (computed and absolute!) to maximally this limit
23 | # can be set to empty for no limit, but beware of filled partitions!
24 | # this is/was a (outdated?) 32bit kernel limit (in MBytes), do not overrun it
25 | # but is also sensible on 64bit to prevent filling /var or even / partition
26 | #CONF_MAXSWAP=2048
27 |
--------------------------------------------------------------------------------
/install/norns/files/dphys-swapfile-swap:
--------------------------------------------------------------------------------
1 | # /etc/dphys-swapfile - user settings for dphys-swapfile package
2 | # author Neil Franklin, last modification 2010.05.05
3 | # copyright ETH Zuerich Physics Departement
4 | # use under either modified/non-advertising BSD or GPL license
5 |
6 | # this file is sourced with . so full normal sh syntax applies
7 |
8 | # the default settings are added as commented out CONF_*=* lines
9 |
10 |
11 | # where we want the swapfile to be, this is the default
12 | CONF_SWAPFILE=/var/swap
13 |
14 | # set size to absolute value, leaving empty (default) then uses computed value
15 | # you most likely don't want this, unless you have an special disk situation
16 | CONF_SWAPSIZE=1024
17 |
18 | # set size to computed value, this times RAM size, dynamically adapts,
19 | # guarantees that there is enough swap without wasting disk space on excess
20 | #CONF_SWAPFACTOR=2
21 |
22 | # restrict size (computed and absolute!) to maximally this limit
23 | # can be set to empty for no limit, but beware of filled partitions!
24 | # this is/was a (outdated?) 32bit kernel limit (in MBytes), do not overrun it
25 | # but is also sensible on 64bit to prevent filling /var or even / partition
26 | CONF_MAXSWAP=2048
27 |
--------------------------------------------------------------------------------
/install/orac/scripts/fates_prepare_rpi4.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | sudo apt-get install git bc vim bison flex libssl-dev i2c-tools libncurses5-dev -y
3 | sudo apt-get install raspberrypi-kernel-headers
4 |
5 | git clone https://github.com/okyeron/norns-linux-bits.git
6 | git clone --depth=1 https://github.com/raspberrypi/linux
7 |
8 | cd ~/linux
9 |
10 | cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
11 | cp /usr/src/linux-headers-$(uname -r)/.config .
12 |
13 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/pi/linux/drivers/staging/fbtft/
14 | cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/pi/linux/arch/arm/configs/bcm2709_defconfig
15 | cp ~/norns-linux-bits/.config /home/pi/linux/.config
16 |
17 | cd ~/linux
18 | KERNEL=kernel7l
19 | make bcm2711_defconfig
20 |
21 | make modules_prepare
22 | make menuconfig
23 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
24 | ## SSD1322 driver
25 |
26 | make prepare
27 |
28 | ## compile the drivers
29 | make -C ~/linux SUBDIRS=drivers/staging/fbtft modules
30 |
31 | ## move the drivers
32 | sudo cp -v ~/linux/drivers/staging/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/staging/fbtft/
33 |
34 | sudo reboot
35 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_prepare_rpi4.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 |
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth=1 https://github.com/raspberrypi/linux
5 |
6 | cd ~/linux
7 |
8 | cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
9 | cp /usr/src/linux-headers-$(uname -r)/.config .
10 |
11 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
12 | cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
13 | cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
14 | cp ~/norns-linux-bits/.config /home/we/linux/.config
15 |
16 | cd ~/linux
17 | KERNEL=kernel7l
18 | make bcm2711_defconfig
19 |
20 | make modules_prepare
21 | #make menuconfig
22 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
23 | ## SSD1322 driver
24 |
25 | make prepare
26 |
27 | ## compile the drivers
28 | make -C ~/linux SUBDIRS=drivers/staging/fbtft modules
29 |
30 | ## move the drivers
31 | sudo cp -v ~/linux/drivers/staging/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/staging/fbtft/
32 |
33 | sudo depmod -a
34 |
35 | rm ~/.config
36 |
37 | sudo reboot
38 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_prepare_5.4.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 |
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth=1 https://github.com/raspberrypi/linux
5 |
6 | cd ~/linux
7 |
8 | cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
9 | cp /usr/src/linux-headers-$(uname -r)/.config .
10 |
11 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
12 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
13 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
14 | #cp ~/norns-linux-bits/.config /home/we/linux/.config
15 |
16 | #cd ~/linux
17 | #KERNEL=kernel7
18 | #make mrproper
19 | #make bcm2709_defconfig
20 |
21 | make modules_prepare
22 | #make menuconfig
23 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
24 | ## SSD1322 driver
25 |
26 | make prepare
27 |
28 | ## compile the drivers
29 | make -C ~/linux SUBDIRS=drivers/staging/fbtft modules
30 |
31 | ## move the drivers
32 | sudo cp -v ~/linux/drivers/staging/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/staging/fbtft/
33 |
34 | sudo depmod -a
35 |
36 | rm ~/.config
37 |
38 | sudo reboot
39 |
--------------------------------------------------------------------------------
/install/orac/scripts/fates_prepare_rpi3buster.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 |
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth=1 https://github.com/raspberrypi/linux
5 |
6 | cd ~/linux
7 |
8 | cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
9 | cp /usr/src/linux-headers-$(uname -r)/.config .
10 |
11 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
12 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
13 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
14 | #cp ~/norns-linux-bits/.config /home/we/linux/.config
15 |
16 | #cd ~/linux
17 | #KERNEL=kernel7
18 | #make mrproper
19 | #make bcm2709_defconfig
20 |
21 | make modules_prepare
22 | #make menuconfig
23 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
24 | ## SSD1322 driver
25 |
26 | make prepare
27 |
28 | ## compile the drivers
29 | make -C ~/linux SUBDIRS=drivers/staging/fbtft modules
30 |
31 | ## move the drivers
32 | sudo cp -v ~/linux/drivers/staging/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/staging/fbtft/
33 |
34 | sudo depmod -a
35 |
36 | rm ~/.config
37 |
38 | sudo reboot
39 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_prepare_rpi3-5.4.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 |
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth=1 https://github.com/raspberrypi/linux
5 |
6 | cd ~/linux
7 |
8 | cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
9 | cp /usr/src/linux-headers-$(uname -r)/.config .
10 |
11 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
12 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
13 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
14 | #cp ~/norns-linux-bits/.config /home/we/linux/.config
15 |
16 | #cd ~/linux
17 | #KERNEL=kernel7
18 | #make mrproper
19 | #make bcm2709_defconfig
20 |
21 | make modules_prepare
22 | #make menuconfig
23 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
24 | ## SSD1322 driver
25 |
26 | make prepare
27 |
28 | ## compile the drivers
29 | make -C ~/linux SUBDIRS=drivers/staging/fbtft modules
30 |
31 | ## move the drivers
32 | sudo cp -v ~/linux/drivers/staging/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/staging/fbtft/
33 |
34 | sudo depmod -a
35 |
36 | rm ~/.config
37 |
38 | sudo reboot
39 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_prepare_rpi3buster.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 |
3 | git clone https://github.com/okyeron/norns-linux-bits.git
4 | git clone --depth=1 https://github.com/raspberrypi/linux
5 |
6 | cd ~/linux
7 |
8 | cp /usr/src/linux-headers-$(uname -r)/Module.symvers .
9 | cp /usr/src/linux-headers-$(uname -r)/.config .
10 |
11 | cp ~/norns-linux-bits/drivers-staging-fbtft/* /home/we/linux/drivers/staging/fbtft/
12 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2709_defconfig /home/we/linux/arch/arm/configs/bcm2709_defconfig
13 | #cp ~/norns-linux-bits/arch-arm-configs/bcm2711_defconfig /home/we/linux/arch/arm/configs/bcm2711_defconfig
14 | #cp ~/norns-linux-bits/.config /home/we/linux/.config
15 |
16 | #cd ~/linux
17 | #KERNEL=kernel7
18 | #make mrproper
19 | #make bcm2709_defconfig
20 |
21 | make modules_prepare
22 | #make menuconfig
23 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
24 | ## SSD1322 driver
25 |
26 | make prepare
27 |
28 | ## compile the drivers
29 | make -C ~/linux SUBDIRS=drivers/staging/fbtft modules
30 |
31 | ## move the drivers
32 | sudo cp -v ~/linux/drivers/staging/fbtft/*.ko /lib/modules/$(uname -r)/kernel/drivers/staging/fbtft/
33 |
34 | sudo depmod -a
35 |
36 | rm ~/.config
37 |
38 | sudo reboot
39 |
--------------------------------------------------------------------------------
/FAQ.md:
--------------------------------------------------------------------------------
1 | # Fates - Frequently Asked Questions
2 |
3 | ### SLEEP
4 |
5 | > when i go to SYSTEM - SLEEP. Fates does not turn off, it stays on with ‘sleep’ dimmed on screen.
6 |
7 | This is "normal" behavior. SLEEP is actually invoking the `sudo shutdown now` command, so the pi will shut off with this command. However, power is still going to the pi (red led will be lit) and to the display. Thus the display will continue to show the last thing on screen.
8 |
9 | When you use SLEEP - Make sure you have a solid red indicator light on the pi (no flashing green) and then disconnect from power.
10 |
11 | An inline usb power switch (like one from [CanaKit](https://www.canakit.com/raspberry-pi-4-on-off-power-switch.html)) is very handy to switch power off after shutdown.
12 |
13 | ### Wake from SLEEP
14 |
15 | The norns docs mention this:
16 |
17 | > Hold K1 for three seconds. Be still, and norns will awaken.
18 |
19 | This is a norns hardware only feature and will not work on Fates.
20 |
21 | To turn Fates on, just plug into power (or use a switch as mentioned above)
22 |
23 | Note - as with norns hardware - **For general shut down use the SLEEP menu function. This fully turns off the device with a proper software shutdown.**
24 |
25 | ### How do I update?
26 |
27 | # Important - regarding norns software updates
28 | If you are on a version of norns before 200218 ***DO NOT*** run the on device SYSTEM > UPDATE from the norns menu.
29 |
30 | You will need to update manually. [See here](https://github.com/fates-project/norns/releases)
31 |
--------------------------------------------------------------------------------
/install/norns/files/crone/wscript:
--------------------------------------------------------------------------------
1 | top = '../..'
2 |
3 |
4 | def options(opt):
5 | opt.load('compiler_c compiler_cxx')
6 |
7 | def configure(conf):
8 | conf.load('compiler_c compiler_cxx')
9 |
10 | def build(bld):
11 | crone_sources = [
12 | 'src/main.cpp',
13 | 'src/BufDiskWorker.cpp',
14 | 'src/Commands.cpp',
15 | 'src/MixerClient.cpp',
16 | 'src/OscInterface.cpp',
17 | 'src/SoftCutClient.cpp',
18 | 'src/Taper.cpp',
19 | 'src/Window.cpp',
20 | 'src/softcut/FadeCurves.cpp',
21 | 'src/softcut/SoftCutHead.cpp',
22 | 'src/softcut/SoftCutVoice.cpp',
23 | 'src/softcut/SubHead.cpp',
24 | 'src/softcut/Svf.cpp',
25 | 'src/softcut/TestBuffers.cpp'
26 | ]
27 |
28 | bld.program( features='c cxx cxxprogram',
29 | source=crone_sources,
30 | target='crone',
31 |
32 | includes=[
33 | 'src',
34 | './'
35 | ],
36 |
37 | use=[
38 | 'ALSA',
39 | 'LIBLO',
40 | 'BOOST',
41 | ],
42 | lib=[
43 | 'jack',
44 | 'pthread',
45 | 'm',
46 | 'sndfile',
47 | 'atomic'
48 | ],
49 | cxxflags=[
50 | '-std=c++14',
51 | '-O2',
52 | '-Wall'
53 | ])
54 |
--------------------------------------------------------------------------------
/install/norns/files/samba:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ### BEGIN INIT INFO
4 | # Provides: samba
5 | # Required-Start:
6 | # Required-Stop:
7 | # Default-Start:
8 | # Default-Stop:
9 | # Short-Description: ensure Samba daemons are started (nmbd, smbd and samba)
10 | # Description: Starts Samba, a Windows AD and SMB/CIFS fileserver for UNIX
11 | ### END INIT INFO
12 |
13 | set -e
14 |
15 | # start nmbd, smbd and samba-ad-dc unconditionally
16 | # the init scripts themselves check if they are needed or not
17 | case $1 in
18 | start)
19 | /etc/init.d/nmbd start
20 | /etc/init.d/smbd start
21 | /etc/init.d/samba-ad-dc start
22 | ;;
23 | stop)
24 | /etc/init.d/samba-ad-dc stop
25 | /etc/init.d/smbd stop
26 | /etc/init.d/nmbd stop
27 | ;;
28 | reload)
29 | /etc/init.d/smbd reload
30 | ;;
31 | restart|force-reload)
32 | /etc/init.d/nmbd "$1"
33 | /etc/init.d/smbd "$1"
34 | /etc/init.d/samba-ad-dc "$1"
35 | ;;
36 | status)
37 | status=0
38 | NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true`
39 | SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1 || true`
40 | if [ "$SERVER_ROLE" != "active directory domain controller" ]; then
41 | if [ "$NMBD_DISABLED" != "Yes" ]; then
42 | /etc/init.d/nmbd status || status=$?
43 | fi
44 | /etc/init.d/smbd status || status=$?
45 | else
46 | /etc/init.d/samba-ad-dc status || status=$?
47 | fi
48 | exit $status
49 | ;;
50 | *)
51 | echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
52 | exit 1
53 | ;;
54 | esac
55 |
--------------------------------------------------------------------------------
/overlays/fates1.5-ssd1322-overlay.dts:
--------------------------------------------------------------------------------
1 | /*
2 | Device Tree overlay for SSD1322 SPI controller.
3 |
4 | Default pins (FATES v1.5):
5 | DC# = GPIO17
6 | RESET# = GPIO4
7 |
8 | */
9 |
10 | /dts-v1/;
11 | /plugin/;
12 |
13 | / {
14 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
15 |
16 | fragment@0 {
17 | target = <&spi0>;
18 | __overlay__ {
19 | status = "okay";
20 | };
21 | };
22 |
23 | fragment@1 {
24 | target = <&spidev0>;
25 | __overlay__ {
26 | status = "disabled";
27 | };
28 | };
29 |
30 | fragment@2 {
31 | target = <&spidev1>;
32 | __overlay__ {
33 | status = "disabled";
34 | };
35 | };
36 |
37 | fragment@3 {
38 | target = <&gpio>;
39 | __overlay__ {
40 | ssd1322_pins: ssd1322_pins {
41 | brcm,pins = <4 17>;
42 | brcm,function = <1 1>;
43 | };
44 | };
45 | };
46 |
47 | fragment@4 {
48 | target = <&spi0>;
49 | __overlay__ {
50 | #address-cells = <1>;
51 | #size-cells = <0>;
52 |
53 | ssd1322: ssd1322@0 {
54 | compatible = "solomon,ssd1322";
55 | reg = <0>;
56 | pinctrl-names = "default";
57 | pinctrl-0 = <&ssd1322_pins>;
58 |
59 | spi-max-frequency = <16000000>;
60 | buswidth = <8>;
61 | rotate = <0>;
62 | bgr = <0>;
63 | fps = <20>;
64 |
65 | reset-gpios = <&gpio 4 0>;
66 | dc-gpios = <&gpio 17 1>;
67 | debug = <3>;
68 | };
69 | };
70 | };
71 |
72 | __overrides__ {
73 | speed = <&ssd1322>,"spi-max-frequency:0";
74 | rotate = <&ssd1322>,"rotate:0";
75 | bgr = <&ssd1322>,"bgr:0";
76 | fps = <&ssd1322>,"fps:0";
77 | debug = <&ssd1322>,"debug:0";
78 | };
79 | };
80 |
--------------------------------------------------------------------------------
/overlays/fates1.7-ssd1322-overlay.dts:
--------------------------------------------------------------------------------
1 | /*
2 | Device Tree overlay for SSD1322 SPI controller.
3 |
4 | Default pins (FATES v1.5):
5 | DC# = GPIO17
6 | RESET# = GPIO4
7 |
8 | */
9 |
10 | /dts-v1/;
11 | /plugin/;
12 |
13 | / {
14 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
15 |
16 | fragment@0 {
17 | target = <&spi0>;
18 | __overlay__ {
19 | status = "okay";
20 | };
21 | };
22 |
23 | fragment@1 {
24 | target = <&spidev0>;
25 | __overlay__ {
26 | status = "disabled";
27 | };
28 | };
29 |
30 | fragment@2 {
31 | target = <&spidev1>;
32 | __overlay__ {
33 | status = "disabled";
34 | };
35 | };
36 |
37 | fragment@3 {
38 | target = <&gpio>;
39 | __overlay__ {
40 | ssd1322_pins: ssd1322_pins {
41 | brcm,pins = <4 17>;
42 | brcm,function = <1 1>;
43 | };
44 | };
45 | };
46 |
47 | fragment@4 {
48 | target = <&spi0>;
49 | __overlay__ {
50 | #address-cells = <1>;
51 | #size-cells = <0>;
52 |
53 | ssd1322: ssd1322@0 {
54 | compatible = "solomon,ssd1322";
55 | reg = <0>;
56 | pinctrl-names = "default";
57 | pinctrl-0 = <&ssd1322_pins>;
58 |
59 | spi-max-frequency = <16000000>;
60 | buswidth = <8>;
61 | rotate = <0>;
62 | bgr = <0>;
63 | fps = <20>;
64 |
65 | reset-gpios = <&gpio 4 0>;
66 | dc-gpios = <&gpio 17 1>;
67 | debug = <3>;
68 | };
69 | };
70 | };
71 |
72 | __overrides__ {
73 | speed = <&ssd1322>,"spi-max-frequency:0";
74 | rotate = <&ssd1322>,"rotate:0";
75 | bgr = <&ssd1322>,"bgr:0";
76 | fps = <&ssd1322>,"fps:0";
77 | debug = <&ssd1322>,"debug:0";
78 | };
79 | };
80 |
--------------------------------------------------------------------------------
/overlays/fates1.2-ssd1322-overlay.dts:
--------------------------------------------------------------------------------
1 | /*
2 | Device Tree overlay for SSD1322 SPI controller.
3 |
4 | Default pins (FATES 1.2):
5 | DC# = GPIO14
6 | RESET# = GPIO15
7 |
8 | */
9 |
10 | /dts-v1/;
11 | /plugin/;
12 |
13 | / {
14 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
15 |
16 | fragment@0 {
17 | target = <&spi0>;
18 | __overlay__ {
19 | status = "okay";
20 | };
21 | };
22 |
23 | fragment@1 {
24 | target = <&spidev0>;
25 | __overlay__ {
26 | status = "disabled";
27 | };
28 | };
29 |
30 | fragment@2 {
31 | target = <&spidev1>;
32 | __overlay__ {
33 | status = "disabled";
34 | };
35 | };
36 |
37 | fragment@3 {
38 | target = <&gpio>;
39 | __overlay__ {
40 | ssd1322_pins: ssd1322_pins {
41 | brcm,pins = <15 14>;
42 | brcm,function = <1 1>;
43 | };
44 | };
45 | };
46 |
47 | fragment@4 {
48 | target = <&spi0>;
49 | __overlay__ {
50 | #address-cells = <1>;
51 | #size-cells = <0>;
52 |
53 | ssd1322: ssd1322@0 {
54 | compatible = "solomon,ssd1322";
55 | reg = <0>;
56 | pinctrl-names = "default";
57 | pinctrl-0 = <&ssd1322_pins>;
58 |
59 | spi-max-frequency = <16000000>;
60 | buswidth = <8>;
61 | rotate = <0>;
62 | bgr = <0>;
63 | fps = <20>;
64 |
65 | reset-gpios = <&gpio 15 0>;
66 | dc-gpios = <&gpio 14 1>;
67 | debug = <3>;
68 | };
69 | };
70 | };
71 |
72 | __overrides__ {
73 | speed = <&ssd1322>,"spi-max-frequency:0";
74 | rotate = <&ssd1322>,"rotate:0";
75 | bgr = <&ssd1322>,"bgr:0";
76 | fps = <&ssd1322>,"fps:0";
77 | debug = <&ssd1322>,"debug:0";
78 | };
79 | };
80 |
--------------------------------------------------------------------------------
/install/orac/scripts/fates_packages.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo Adding Monome apt repository...
3 | curl https://keybase.io/artfwo/pgp_keys.asc | sudo apt-key add -
4 | echo "deb https://package.monome.org/ stretch main" | sudo tee /etc/apt/sources.list.d/norns.list
5 |
6 | echo Importing Blokas GPG public key...
7 | wget -q -O - https://blokas.io/gpg.public.key | sudo apt-key add -
8 | echo Adding Blokas apt repository...
9 | sudo wget -q -O /etc/apt/sources.list.d/blokas.list https://blokas.io/blokas.list
10 |
11 | echo Importing GPG public key for serialosc...
12 | gpg --keyserver keyserver.ubuntu.com --recv DD9300F1
13 | gpg --export --armor DD9300F1 | sudo apt-key add -
14 | echo "deb http://ppa.launchpad.net/artfwo/monome/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/monome.list
15 |
16 | echo Updating package list...
17 | sudo apt-get update
18 |
19 | sudo apt update -y
20 |
21 | sudo apt install --no-install-recommends jackd2 -y
22 | sudo apt-get install libboost1.62-dev -y
23 | sudo apt-get install libjack-jackd2-dev -y
24 | sudo apt install libmonome-dev -y
25 | sudo apt install supercollider-common=1:3.9.10-0norns1 supercollider-language=1:3.9.10-0norns1 supercollider-server=1:3.9.10-0norns1 supercollider-supernova=1:3.9.10-0norns1 supercollider-dev=1:3.9.10-0norns1 -y
26 | sudo apt install libnanomsg-dev liblua5.3-dev libudev-dev libevdev-dev liblo-dev libcairo2-dev liblua5.3-dev libavahi-compat-libdnssd-dev libasound2-dev -y
27 | sudo apt install dnsmasq -y
28 | sudo apt install sc3-plugins ladspalist -y
29 | sudo apt install usbmount -y
30 | sudo apt-get install alsa-utils -y
31 | sudo apt-get install libi2c-dev -y
32 | sudo apt-get install amidiauto -y
33 | sudo apt install serialosc -y
34 |
35 |
36 | sudo cp -f /home/we/fates/install/norns/files/interfaces /etc/network
37 | sudo cp -f /home/we/fates/install/norns/files/systemd-udevd.service /lib/systemd/system/
38 | #sudo apt install network-manager
39 | sudo reboot
40 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_packages.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo Adding Monome apt repository...
3 | curl https://keybase.io/artfwo/pgp_keys.asc | sudo apt-key add -
4 | echo "deb https://package.monome.org/ stretch main" | sudo tee /etc/apt/sources.list.d/norns.list
5 |
6 | echo Importing Blokas GPG public key...
7 | wget -q -O - https://blokas.io/gpg.public.key | sudo apt-key add -
8 | echo Adding Blokas apt repository...
9 | sudo wget -q -O /etc/apt/sources.list.d/blokas.list https://blokas.io/blokas.list
10 |
11 | echo Importing GPG public key for serialosc...
12 | gpg --keyserver keyserver.ubuntu.com --recv DD9300F1
13 | gpg --export --armor DD9300F1 | sudo apt-key add -
14 | echo "deb http://ppa.launchpad.net/artfwo/monome/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/monome.list
15 |
16 | echo Updating package list...
17 | sudo apt-get --allow-releaseinfo-change update
18 |
19 | sudo apt update -y
20 |
21 | sudo apt install --no-install-recommends jackd2 -y
22 | sudo apt-get install libboost1.62-dev -y
23 | sudo apt-get install libjack-jackd2-dev -y
24 | sudo apt install libmonome-dev -y
25 | sudo apt install supercollider-common=1:3.9.10-0norns1 supercollider-language=1:3.9.10-0norns1 supercollider-server=1:3.9.10-0norns1 supercollider-supernova=1:3.9.10-0norns1 supercollider-dev=1:3.9.10-0norns1 -y
26 | sudo apt install libnanomsg-dev liblua5.3-dev libudev-dev libevdev-dev liblo-dev libcairo2-dev liblua5.3-dev libavahi-compat-libdnssd-dev libasound2-dev -y
27 | sudo apt install dnsmasq -y
28 | sudo apt install sc3-plugins ladspalist -y
29 | sudo apt install usbmount -y
30 | sudo apt-get install alsa-utils -y
31 | sudo apt-get install libi2c-dev -y
32 | sudo apt-get install amidiauto -y
33 | sudo apt install serialosc -y
34 |
35 |
36 | sudo cp -f /home/we/fates/install/norns/files/interfaces /etc/network
37 | sudo cp -f /home/we/fates/install/norns/files/systemd-udevd.service /lib/systemd/system/
38 | #sudo apt install network-manager
39 | sudo reboot
40 |
--------------------------------------------------------------------------------
/overlays/fates1.8-ssd1322-overlay.dts:
--------------------------------------------------------------------------------
1 | /*
2 | Device Tree overlay for SSD1322 SPI controller.
3 |
4 | Default pins (FATES v1.8):
5 | DC# = GPIO17
6 | RESET# = GPIO4
7 |
8 | */
9 |
10 | /dts-v1/;
11 | /plugin/;
12 |
13 | / {
14 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
15 |
16 | fragment@0 {
17 | target = <&spi0>;
18 | __overlay__ {
19 | status = "okay";
20 | };
21 | };
22 |
23 | fragment@1 {
24 | target = <&spidev0>;
25 | __overlay__ {
26 | status = "disabled";
27 | };
28 | };
29 |
30 | fragment@2 {
31 | target = <&spidev1>;
32 | __overlay__ {
33 | status = "disabled";
34 | };
35 | };
36 |
37 | fragment@3 {
38 | target = <&gpio>;
39 | __overlay__ {
40 | ssd1322_pins: ssd1322_pins {
41 | brcm,pins = <4 17>;
42 | brcm,function = <1 1>;
43 | };
44 | };
45 | };
46 |
47 | fragment@4 {
48 | target = <&spi0>;
49 | __overlay__ {
50 | #address-cells = <1>;
51 | #size-cells = <0>;
52 |
53 | ssd1322: ssd1322@0 {
54 | compatible = "solomon,ssd1322";
55 | reg = <0>;
56 | pinctrl-names = "default";
57 | pinctrl-0 = <&ssd1322_pins>;
58 |
59 | spi-max-frequency = <16000000>;
60 | buswidth = <8>;
61 | rotate = <0>;
62 | bgr = <0>;
63 | fps = <20>;
64 | reset-gpios = <&gpio 4 1>;
65 | dc-gpios = <&gpio 17 0>;
66 | debug = <3>;
67 | };
68 | };
69 | };
70 |
71 | fragment@5 {
72 | target = <&spi0_pins>;
73 | __overlay__ {
74 | brcm,pins = <10 11>;
75 | };
76 | };
77 |
78 | __overrides__ {
79 | speed = <&ssd1322>,"spi-max-frequency:0";
80 | rotate = <&ssd1322>,"rotate:0";
81 | bgr = <&ssd1322>,"bgr:0";
82 | fps = <&ssd1322>,"fps:0";
83 | debug = <&ssd1322>,"debug:0";
84 | // dc_pin = <&ssd1322>,"dc-gpios:4",<&ssd1322_pins>,"brcm,pins:4";
85 | // reset_pin = <&ssd1322>,"reset-gpios:4",<&ssd1322_pins>,"brcm,pins:0";
86 | };
87 | };
88 |
--------------------------------------------------------------------------------
/install/norns/files/config.txt:
--------------------------------------------------------------------------------
1 | # For more options and information see
2 | # http://rpf.io/configtxt
3 | # Some settings may impact device functionality. See link above for details
4 |
5 | # uncomment if you get no picture on HDMI for a default "safe" mode
6 | #hdmi_safe=1
7 |
8 | # uncomment this if your display has a black border of unused pixels visible
9 | # and your display can output without overscan
10 | #disable_overscan=1
11 |
12 | # uncomment the following to adjust overscan. Use positive numbers if console
13 | # goes off screen, and negative if there is too much border
14 | #overscan_left=16
15 | #overscan_right=16
16 | #overscan_top=16
17 | #overscan_bottom=16
18 |
19 | # uncomment to force a console size. By default it will be display's size minus
20 | # overscan.
21 | #framebuffer_width=1280
22 | #framebuffer_height=720
23 |
24 | # uncomment if hdmi display is not detected and composite is being output
25 | #hdmi_force_hotplug=1
26 |
27 | # uncomment to force a specific HDMI mode (this will force VGA)
28 | #hdmi_group=1
29 | #hdmi_mode=1
30 |
31 | # uncomment to force a HDMI mode rather than DVI. This can make audio work in
32 | # DMT (computer monitor) modes
33 | #hdmi_drive=2
34 |
35 | # uncomment to increase signal to HDMI, if you have interference, blanking, or
36 | # no display
37 | #config_hdmi_boost=4
38 |
39 | # uncomment for composite PAL
40 | #sdtv_mode=2
41 |
42 | #uncomment to overclock the arm. 700 MHz is the default.
43 | #arm_freq=800
44 |
45 | # Uncomment some or all of these to enable the optional hardware interfaces
46 | dtparam=i2c_arm=on
47 | dtparam=spi=on
48 | dtparam=i2s=on
49 | dtoverlay=i2s-mmap
50 |
51 | # Uncomment this to enable the lirc-rpi module
52 | #dtoverlay=lirc-rpi
53 |
54 | # Additional overlays and parameters are documented /boot/overlays/README
55 |
56 | enable_uart=1
57 |
58 | # DAC audio
59 | dtoverlay=rpi-proto
60 |
61 | # Buttons and encoders
62 | #dtoverlay=fates-buttons-encoders
63 |
64 | # Alternate overlay for 4 encoders
65 | dtoverlay=fates-buttons-4encoders
66 |
67 |
68 | # Screen
69 | dtoverlay=fates-ssd1322,rotate=180
70 |
71 | # How much memory in MB to assign to the GPU in MB
72 | # Lowest possible value is 16
73 | #gpu_mem=16
74 |
75 | # Enable audio (loads snd_bcm2835)
76 | dtparam=audio=off
77 |
78 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_install_1.2.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 | git clone https://github.com/monome/norns-image.git
3 |
4 | sudo cp -f /home/we/fates/install/norns/files/setup.sh /home/we/norns-image
5 | sudo cp -f /home/we/fates/install/norns/files/norns.target /home/we/norns-image/config
6 | sudo cp -f /home/we/fates/install/norns/files/norns-matron.service /home/we/norns-image/config
7 | sudo cp -f /home/we/fates/install/norns/files/norns-init.service /etc/systemd/system/
8 | sudo cp -f /home/we/fates/install/norns/files/init-norns.sh /home/we/norns-image/scripts
9 | #sudo cp -f /home/we/fates/install/norns/files/aliases.conf /lib/modprobe.d
10 | sudo cp -f /home/we/fates/install/norns/files/raspi-blacklist.conf /etc/modprobe.d
11 | sudo cp -f /home/we/fates/install/norns/files/asound.conf /etc
12 | sudo cp -f /home/we/fates/install/norns/files/alsa.conf /usr/share/alsa
13 |
14 | # compile the overlays (buttons and encoders + ssd1322)
15 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-encoders.dtbo /home/we/fates/overlays/fates1.2-buttons-encoders-overlay.dts
16 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-ssd1322.dtbo /home/we/fates/overlays/fates1.2-ssd1322-overlay.dts
17 |
18 | cd /home/we/norns-image
19 | ./setup.sh
20 |
21 | cd /home/we
22 | git clone https://github.com/monome/norns.git
23 | cd /home/we/norns
24 |
25 | # we need to run sclang
26 | echo | sclang
27 |
28 | ./waf configure
29 | ./waf
30 |
31 | cd /home/we/norns/sc && ./install.sh
32 |
33 | sudo cp -f /home/we/fates/install/norns/files/matron.sh /home/we/norns
34 | sudo cp -f /home/we/fates/install/norns/files/config.txt /boot
35 |
36 | cd ~
37 | mkdir dust
38 | cd dust
39 | mkdir code
40 | cd code
41 | git clone https://github.com/monome/we.git
42 | git clone https://github.com/tehn/awake.git
43 | cd ../
44 | mkdir data
45 | mkdir audio
46 | cd audio
47 | sudo mv /home/we/fates/install/norns/files/common_audio.tar common_audio.tar
48 | tar -xvf common_audio.tar
49 | rm common_audio.tar
50 | mkdir tape
51 |
52 |
53 | cd ~
54 | wget https://github.com/monome/maiden/releases/download/v0.13/maiden-v0.13.tgz
55 | tar -xvf maiden-v0.13.tgz
56 | rm maiden-v0.13.tgz
57 |
58 | #sudo apt install network-manager
59 | #sudo cp ~/norns-linux-bits/interfaces /etc/network/interfaces
60 | #sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant_bak.conf
61 |
62 | sudo reboot
63 |
--------------------------------------------------------------------------------
/install/norns/files/config4.txt:
--------------------------------------------------------------------------------
1 | # For more options and information see
2 | # http://rpf.io/configtxt
3 | # Some settings may impact device functionality. See link above for details
4 |
5 | # uncomment if you get no picture on HDMI for a default "safe" mode
6 | #hdmi_safe=1
7 |
8 | # uncomment this if your display has a black border of unused pixels visible
9 | # and your display can output without overscan
10 | #disable_overscan=1
11 |
12 | # uncomment the following to adjust overscan. Use positive numbers if console
13 | # goes off screen, and negative if there is too much border
14 | #overscan_left=16
15 | #overscan_right=16
16 | #overscan_top=16
17 | #overscan_bottom=16
18 |
19 | # uncomment to force a console size. By default it will be display's size minus
20 | # overscan.
21 | #framebuffer_width=1280
22 | #framebuffer_height=720
23 |
24 | # uncomment if hdmi display is not detected and composite is being output
25 | #hdmi_force_hotplug=1
26 |
27 | # uncomment to force a specific HDMI mode (this will force VGA)
28 | #hdmi_group=1
29 | #hdmi_mode=1
30 |
31 | # uncomment to force a HDMI mode rather than DVI. This can make audio work in
32 | # DMT (computer monitor) modes
33 | #hdmi_drive=2
34 |
35 | # uncomment to increase signal to HDMI, if you have interference, blanking, or
36 | # no display
37 | #config_hdmi_boost=4
38 |
39 | # uncomment for composite PAL
40 | #sdtv_mode=2
41 |
42 | #uncomment to overclock the arm. 700 MHz is the default.
43 | #arm_freq=800
44 |
45 | # Uncomment some or all of these to enable the optional hardware interfaces
46 | dtparam=i2c_arm=on
47 | dtparam=spi=on
48 | dtparam=i2s=on
49 | dtoverlay=i2s-mmap
50 |
51 | # Uncomment this to enable the lirc-rpi module
52 | #dtoverlay=lirc-rpi
53 |
54 | # Additional overlays and parameters are documented /boot/overlays/README
55 |
56 | enable_uart=1
57 |
58 | # DAC audio
59 | dtoverlay=rpi-proto
60 |
61 | # Buttons and encoders
62 | #dtoverlay=fates-buttons-encoders
63 |
64 | # Alternate overlay for 4 encoders
65 | dtoverlay=fates-buttons-4encoders
66 |
67 |
68 | # Screen
69 | dtoverlay=fates-ssd1322,rotate=180
70 |
71 | # How much memory in MB to assign to the GPU in MB
72 | # Lowest possible value is 16
73 | #gpu_mem=16
74 |
75 | # Enable audio (loads snd_bcm2835)
76 | dtparam=audio=off
77 |
78 | [pi4]
79 | # Enable DRM VC4 V3D driver on top of the dispmanx display stack
80 | dtoverlay=vc4-fkms-v3d
81 | max_framebuffers=2
82 |
83 | [all]
84 | #dtoverlay=vc4-fkms-v3d
85 |
86 |
--------------------------------------------------------------------------------
/troubleshooting.md:
--------------------------------------------------------------------------------
1 | # Fates - Troubleshooting
2 |
3 | ### Etcher doesn't work for me
4 |
5 | You can also try [ApplePiBaker](https://www.tweaking4all.com/hardware/raspberry-pi/applepi-baker-v2/) if you're on MacOS. Otherwise you may be looking at various arcane `dd` commands.
6 |
7 | ### Power
8 | - Be sure you are using a good power supply. The Pi 3b+ needs a 5V 2.5A power supply. The Pi 4 requires a 5V 3A power supply. Buy one of the official Raspberry Pi power supplies if you're not sure.
9 |
10 | - Be sure you're using a good quality USB-C cable (and it's not just a "charging" cable)
11 |
12 | - DO NOT TRY TO POWER FATES FROM YOUR LAPTOP USB-C Ports. Use a dedicated 3A power supply.
13 |
14 | - [Check your input voltages](hardware/Build.md#tip---test-voltage)
15 |
16 | ### `SUPERCOLLIDER FAIL` error on boot:
17 | - This happens because the Jack Audio system is not starting properly. A number of things can cause this. There is a information and support thread on the "lines" forum [here](https://llllllll.co/t/fates-a-diy-norns-dac-board-for-raspberry-pi/22999?u=okyeron)
18 |
19 | - Check the orientation of the 2.2K resistors. They should be horizontal, not vertical.
20 |
21 | - Check the 3.3v voltage regulator. This powers the DAC so if it's not right, the DAC won't initialize. See the "check your voltages" link above to test.
22 |
23 | ### Audio tests
24 |
25 | SSH to the pi/fates to conduct these tests. Have your audio outputs and inputs connected to speakers/mixer and a sound source.
26 |
27 | A low level test…
28 | Firstst stop jack, so we can test the DAC directly with ALSA
29 |
30 | `sudo systemctl stop norns-jack.service`
31 |
32 | Now use `aplay` to play a wave file.
33 |
34 | `aplay ~/dust/audio/common/waves/01.wav`
35 | this should play a simple clean bell tone
36 |
37 | An alternate test is speaker-test
38 | `speaker-test -t wav -c 2 -l 3 -D hw:0,0`
39 |
40 | This will play a female voice saying "front right" and "front left" in each channel 3 times.
41 |
42 | Record 15 seconds of audio from the inputs and save to a .wav file
43 | `arecord -f dat -vv -V stereo -d 15 ~/audio-test.wav`
44 |
45 | Play back the same audio file
46 | `aplay -vv -V stereo ~/audio-test.wav`
47 |
48 | `sudo reboot` to get things back to normal.
49 |
50 |
51 | ###[Raspberry Pi LED status messages](https://elinux.org/R-Pi_Troubleshooting#Red_power_LED_is_on.2C_green_LED_does_not_flash.2C_nothing_on_display)
52 |
53 | ### FAQ
54 |
55 | See [Frequently Asked Questions](FAQ.md) for other general info
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Important - regarding norns software updates
2 | If you are on a version of norns before 200218 ***DO NOT*** run the on device SYSTEM > UPDATE from the norns menu.
3 |
4 | If you're still on an old version like this - back up your scripts and install from a new (2022) disk image.
5 |
6 | # Fates DAC board for Raspberry Pi
7 |
8 | Fates is an audio and UI platform for Raspberry Pi 3 Model B+ and Pi 4 Model B that provides a stereo audio codec with headphone driver, 3 (or 4) encoders, 3 buttons, a 128x64 OLED display, 2x audio ins, and 2x audio outs.
9 |
10 | Fates is fully compatible with the [monome norns]() software ecosystem. A “DIY norns” if you like. Once installed, Fates can be used with the primary norns codebase, without any branches or mods.
11 |
12 | Fates can also be used directly with Orac 2.0 (puredata) and also with other Raspberry Pi audio projects like PatchboxOS, etc.
13 |
14 | NOTE - this install and norns software has been tested mostly on the Pi3b+ and Pi4b. It may not work perfectly on older/slower Pi models (3b, etc.) and may need different configuration.
15 |
16 | ### Specs:
17 |
18 | - WM8731 stereo audio codec with headphone driver
19 | - NHD-2.7-12864WDW3 128x64 grayscale OLED display
20 | - 3 pushbuttons
21 | - 3 rotary encoders (optional 4th encoder for Orac or other software)
22 | - 2x 1/8in inputs
23 | - 2x 1/8in outputs
24 | - 1/8in stereo headphone out
25 |
26 | Fates was designed for Raspberry Pi 3 Model B+ and Raspberry Pi 4 Model B. It’s not been performance tested with earlier Raspberry PI models.
27 |
28 | For Raspberry Pi 4, Fates includes a USB-C power jack which fixes the Pi4 issue with "e-marked" USB-C cables not powering the device.
29 |
30 | Fates can be powered either from it's own USB-C power jack, or the Raspberry Pi power jack (but NOT both).
31 |
32 | ![]()
33 |
34 | ## BOM and Build
35 |
36 | [BOM](hardware/BOM.md)
37 |
38 | [BOM - Thru-hole only](hardware/BOM-thruhole.md) (for SMD assembled boards)
39 |
40 | [Build Guide](hardware/Build.md)
41 |
42 | [Acrylic Case Assembly](hardware/AcrylicCase.md)
43 |
44 |
45 |
46 | ## Install instructions
47 |
48 | - [Installing Fates 1.8+ from disk image](https://github.com/okyeron/fates/blob/master/install/norns/Norns_disk_image_install.md)
49 |
50 |
51 | ## Troubleshooting
52 |
53 | [See this troubleshooting doc for more](troubleshooting.md)
54 |
55 |
56 | ## UART
57 |
58 | Fates includes UART pins broken out for a serial connection to another computer using a UART-USB cable.
59 |
60 | For example - the [Adafruit 954 cable](https://www.adafruit.com/product/954):
61 | - white lead TX
62 | - green lead RX
63 | - black lead GND
64 | - ***red lead (5v) from the UART cable is not connected on Fates***
65 |
66 | Then connect using `screen`
67 |
68 | `screen /dev/cu.usbserial* 115200`
69 |
70 | If this does not work, try swapping TX and RX
71 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_install.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 | git clone https://github.com/monome/norns-image.git
3 |
4 | cd ~
5 | mkdir ~/.local/
6 | mkdir ~/.local/share/
7 | mkdir ~/.local/share/SuperCollider
8 | mkdir ~/.local/share/SuperCollider/Extensions
9 |
10 | echo '191028' >> version.txt
11 | mkdir ~/update
12 | mkdir ~/dust
13 | mkdir ~/dust/data
14 | mkdir ~/dust/audio
15 | mkdir ~/dust/code
16 |
17 | sudo cp -f /home/we/fates/install/norns/files/setup.sh /home/we/norns-image
18 | sudo cp -f /home/we/fates/install/norns/files/norns.target /home/we/norns-image/config
19 | sudo cp -f /home/we/fates/install/norns/files/norns-matron.service /home/we/norns-image/config
20 | sudo cp -f /home/we/fates/install/norns/files/norns-init.service /etc/systemd/system/
21 | sudo cp -f /home/we/fates/install/norns/files/init-norns.sh /home/we/norns-image/scripts
22 | #sudo cp -f /home/we/fates/install/norns/files/aliases.conf /lib/modprobe.d
23 | sudo cp -f /home/we/fates/install/norns/files/raspi-blacklist.conf /etc/modprobe.d
24 | sudo cp -f /home/we/fates/install/norns/files/asound.conf /etc
25 | sudo cp -f /home/we/fates/install/norns/files/alsa.conf /usr/share/alsa
26 | sudo cp -f /home/we/fates/install/norns/files/alsa-base.conf /etc/modprobe.d/alsa-base.conf
27 | sudo cp -f /home/we/fates/install/norns/files/rc.local /etc/rc.local
28 |
29 | # compile the overlays (buttons and encoders + ssd1322)
30 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-encoders-overlay.dts
31 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-4encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-4encoders-overlay.dts
32 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-ssd1322.dtbo /home/we/fates/overlays/fates1.7-ssd1322-overlay.dts
33 |
34 | cd /home/we/norns-image
35 | ./setup.sh
36 |
37 | cd /home/we
38 | git clone https://github.com/monome/norns.git
39 | cd /home/we/norns
40 | git submodule update --recursive --init
41 |
42 | sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
43 |
44 | # we need to run sclang
45 | echo | sclang
46 |
47 | ./waf clean
48 | ./waf configure --enable-ableton-link
49 | ./waf build
50 |
51 | cd /home/we/norns/sc && ./install.sh
52 |
53 | sudo cp -f /home/we/fates/install/norns/files/restart.sh /home/we/norns/restart.sh
54 | sudo cp -f /home/we/fates/install/norns/files/matron.sh /home/we/norns
55 | sudo cp -f /home/we/fates/install/norns/files/config.txt /boot
56 |
57 | cd ~/dust/code
58 | git clone https://github.com/monome/we.git
59 | git clone https://github.com/tehn/awake.git
60 | cd ~/dust/audio
61 | mkdir tape
62 | sudo mv /home/we/fates/install/norns/files/common_audio.tar common_audio.tar
63 | tar -xvf common_audio.tar
64 | rm common_audio.tar
65 |
66 | cd ~
67 | wget https://github.com/monome/maiden/releases/download/v1.0.1/maiden-v1.0.1.tgz
68 | tar -xvf maiden-v1.0.1.tgz
69 | rm maiden-v1.0.1.tgz
70 |
71 | #sudo apt install network-manager
72 | #sudo cp ~/norns-linux-bits/interfaces /etc/network/interfaces
73 | #sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant_bak.conf
74 |
75 | sudo systemctl disable serialosc.service
76 |
77 | sudo reboot
78 |
--------------------------------------------------------------------------------
/install/norns/files/setup.sh:
--------------------------------------------------------------------------------
1 | # monome package apt
2 | sudo cp config/norns.list /etc/apt/sources.list.d/
3 |
4 | # hold packages we don't want to update
5 | echo "raspberrypi-kernel hold" | sudo dpkg --set-selections
6 |
7 | # uninstall old network packages
8 | sudo apt-get purge -y hostapd
9 |
10 | # install needed packages
11 | #sudo apt install network-manager dnsmasq-base midisport-firmware
12 |
13 | # systemd
14 | sudo mkdir -p /etc/systemd/system.conf.d
15 | sudo cp --remove-destination config/10-default-env-vars.conf /etc/systemd/system.conf.d/10-default-env-vars.conf
16 | sudo cp --remove-destination config/norns-crone.service /etc/systemd/system/norns-crone.service
17 | #sudo rm /etc/systemd/system/norns-supernova.service
18 | #sudo cp --remove-destination config/norns-supernova.service /etc/systemd/system/norns-supernova.service
19 | sudo cp --remove-destination config/norns-sclang.service /etc/systemd/system/norns-sclang.service
20 | sudo cp --remove-destination config/norns-jack.service /etc/systemd/system/norns-jack.service
21 | sudo cp --remove-destination config/norns-maiden.service /etc/systemd/system/norns-maiden.service
22 | sudo cp --remove-destination config/norns-maiden.socket /etc/systemd/system/norns-maiden.socket
23 | sudo cp --remove-destination config/norns-matron.service /etc/systemd/system/norns-matron.service
24 | sudo cp --remove-destination config/norns.target /etc/systemd/system/norns.target
25 | sudo cp --remove-destination config/55-maiden-systemctl.pkla /etc/polkit-1/localauthority/50-local.d/55-maiden-systemctl.pkla
26 | sudo systemctl enable norns.target
27 |
28 | # motd
29 | sudo cp config/motd /etc/motd
30 |
31 | # profile
32 | sudo cp config/10-default-env-vars.sh /etc/profile.d/10-default-env-vars.sh
33 |
34 | # bashrc
35 | sudo cp config/bashrc /home/we/.bashrc
36 |
37 | # Wifi
38 | # Use the upstream rtl8192cu driver instead of the problematic realtek 8192cu driver
39 | sudo rm -f /etc/modprobe.d/blacklist-rtl8192cu.conf
40 | sudo cp config/blacklist-8192cu.conf /etc/modprobe.d/
41 | # NetworkManager config
42 | #sudo cp config/interfaces /etc/network/interfaces
43 | #sudo cp config/network-manager/100-disable-wifi-mac-randomization.conf /etc/NetworkManager/conf.d/
44 | #sudo cp config/network-manager/101-logging.conf /etc/NetworkManager/conf.d/
45 | #sudo cp config/network-manager/200-disable-nmcli-auth.conf /etc/NetworkManager/conf.d/
46 | #sudo systemctl disable pppd-dns.service
47 |
48 | # limit log sizes
49 | sudo cp config/journald.conf /etc/systemd/
50 | sudo cp config/logrotate.conf /etc/
51 | sudo cp config/rsyslog.conf /etc/
52 | sudo cp config/rsyslog /etc/rsyslog.d/
53 |
54 | # Plymouth
55 | # Get rid of our old masked plymouth units
56 | sudo systemctl unmask plymouth-read-write.service
57 | sudo systemctl unmask plymouth-start.service
58 | sudo systemctl unmask plymouth-quit.service
59 | sudo systemctl unmask plymouth-quit-wait.service
60 | sudo apt-get purge -y plymouth
61 |
62 | # Apt timers
63 | sudo systemctl mask apt-daily.timer
64 | sudo systemctl mask apt-daily-upgrade.timer
65 |
66 | # alsa state (handled by norns-init)
67 | sudo systemctl mask alsa-restore.service
68 | sudo systemctl mask alsa-state.service
69 |
70 | # disable swap
71 | sudo apt purge dphys-swapfile
72 | sudo swapoff -a
73 | sudo rm /var/swap
74 |
75 | # speed up boot
76 | sudo apt purge exim4-* nfs-common triggerhappy
77 |
78 | # ensure we don't override kernel option for 'ondemand' frequency
79 | # governor
80 | sudo systemctl mask raspi-config.service
81 |
82 | sudo apt --purge -y autoremove
83 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_install_5.4.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | git clone https://github.com/monome/norns-image.git
3 |
4 | cd ~
5 | mkdir ~/.local/
6 | mkdir ~/.local/share/
7 | mkdir ~/.local/share/SuperCollider
8 | mkdir ~/.local/share/SuperCollider/Extensions
9 |
10 | echo '201201' >> version.txt
11 | mkdir ~/update
12 | mkdir ~/dust
13 | mkdir ~/dust/data
14 | mkdir ~/dust/audio
15 | mkdir ~/dust/code
16 |
17 | sudo cp -f /home/we/fates/install/norns/files/setup.sh /home/we/norns-image
18 | sudo cp -f /home/we/fates/install/norns/files/norns.target /home/we/norns-image/config
19 | sudo cp -f /home/we/fates/install/norns/files/norns-matron.service /home/we/norns-image/config/norns-matron.service
20 | sudo cp -f /home/we/fates/install/norns/files/norns-init.service /etc/systemd/system/
21 | sudo cp -f /home/we/fates/install/norns/files/init-norns.sh /home/we/norns-image/scripts
22 | #sudo cp -f /home/we/fates/install/norns/files/aliases.conf /lib/modprobe.d
23 | sudo cp -f /home/we/fates/install/norns/files/raspi-blacklist.conf /etc/modprobe.d
24 | sudo cp -f /home/we/fates/install/norns/files/asound.conf /etc
25 | sudo cp -f /home/we/fates/install/norns/files/alsa.conf /usr/share/alsa
26 | sudo cp -f /home/we/fates/install/norns/files/dnsmasq.conf /etc/dnsmasq.conf
27 |
28 | # compile the overlays (buttons and encoders + ssd1322)
29 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-encoders-overlay.dts
30 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-4encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-4encoders-overlay.dts
31 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-ssd1322.dtbo /home/we/fates/overlays/fates1.8-ssd1322-overlay.dts
32 |
33 | cd /home/we/norns-image
34 | ./setup.sh
35 |
36 | cd /home/we
37 | git clone https://github.com/fates-project/norns.git
38 | cd /home/we/norns
39 | git submodule update --recursive --init
40 |
41 | #sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
42 |
43 | # we need to run sclang
44 | echo | sclang
45 |
46 | ./waf clean
47 | ./waf configure --enable-ableton-link
48 | ./waf build
49 |
50 | cd /home/we/norns/sc && ./install.sh
51 |
52 | #sudo cp -f /home/we/fates/install/norns/files/norns-restart.sh /home/we/norns-restart.sh
53 | #sudo cp -f /home/we/fates/install/norns/files/norns-stopall.sh /home/we/norns-stopall.sh
54 | sudo cp -f /home/we/fates/install/norns/files/matron.sh /home/we/norns/matron.sh
55 | sudo cp -f /home/we/fates/install/norns/files/config.txt /boot/config.txt
56 |
57 | cd ~/dust/code
58 | git clone https://github.com/monome/we.git
59 | git clone https://github.com/tehn/awake.git
60 | cd ~/dust/audio
61 | mkdir tape
62 | sudo mv /home/we/fates/install/norns/files/common_audio.tar common_audio.tar
63 | tar -xvf common_audio.tar
64 | rm common_audio.tar
65 |
66 | cd ~
67 | wget https://github.com/monome/maiden/releases/download/v1.0.1/maiden-v1.0.1.tgz
68 | tar -xvf maiden-v1.0.1.tgz
69 | rm maiden-v1.0.1.tgz
70 |
71 | #sudo apt install network-manager
72 | #sudo cp ~/norns-linux-bits/interfaces /etc/network/interfaces
73 | #sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant_bak.conf
74 |
75 | sudo systemctl disable serialosc.service
76 |
77 | # webdav
78 | #cp -a webdav /home/we/
79 | #sudo cp webdav/webdav.service /etc/systemd/system/
80 | #sudo systemctl enable webdav.service
81 | if [ -d /home/we/webdav ]; then
82 | sudo rm -rf /home/we/webdav
83 | sudo systemctl disable webdav.service
84 | sudo rm /etc/systemd/system/webdav.service
85 | fi
86 |
87 | # samba - alternate install
88 | cd ~/fates
89 | git pull
90 | if [ "$SAMBA" == "" ]; then
91 | sudo apt-get update
92 | sudo apt-get install samba samba-common-bin
93 | (echo "sleep"; echo "sleep") | sudo smbpasswd -s -a we
94 | fi
95 | sudo cp ~/fates/install/norns/files/smb.conf /etc/samba/
96 | sudo cp ~/fates/install/norns/files/samba /etc/init.d/
97 | sudo /etc/init.d/samba restart
98 |
99 | sudo reboot
100 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_install_pi3buster.sh:
--------------------------------------------------------------------------------
1 | cd ~
2 | git clone https://github.com/monome/norns-image.git
3 |
4 | cd ~
5 | mkdir ~/.local/
6 | mkdir ~/.local/share/
7 | mkdir ~/.local/share/SuperCollider
8 | mkdir ~/.local/share/SuperCollider/Extensions
9 |
10 | echo '200328' >> version.txt
11 | mkdir ~/update
12 | mkdir ~/dust
13 | mkdir ~/dust/data
14 | mkdir ~/dust/audio
15 | mkdir ~/dust/code
16 |
17 | sudo cp -f /home/we/fates/install/norns/files/setup.sh /home/we/norns-image
18 | sudo cp -f /home/we/fates/install/norns/files/norns.target /home/we/norns-image/config
19 | sudo cp -f /home/we/fates/install/norns/files/norns-matron.service-rpi3 /home/we/norns-image/config/norns-matron.service
20 | sudo cp -f /home/we/fates/install/norns/files/norns-init.service /etc/systemd/system/
21 | sudo cp -f /home/we/fates/install/norns/files/init-norns.sh /home/we/norns-image/scripts
22 | #sudo cp -f /home/we/fates/install/norns/files/aliases.conf /lib/modprobe.d
23 | sudo cp -f /home/we/fates/install/norns/files/raspi-blacklist.conf /etc/modprobe.d
24 | sudo cp -f /home/we/fates/install/norns/files/asound.conf /etc
25 | sudo cp -f /home/we/fates/install/norns/files/alsa.conf /usr/share/alsa
26 | sudo cp -f /home/we/fates/install/norns/files/dnsmasq.conf /etc/dnsmasq.conf
27 |
28 | # compile the overlays (buttons and encoders + ssd1322)
29 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-encoders-overlay.dts
30 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-4encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-4encoders-overlay.dts
31 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-ssd1322.dtbo /home/we/fates/overlays/fates1.7-ssd1322-overlay.dts
32 |
33 | cd /home/we/norns-image
34 | ./setup.sh
35 |
36 | cd /home/we
37 | git clone https://github.com/fates-project/norns.git
38 | cd /home/we/norns
39 | git submodule update --recursive --init
40 |
41 | sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
42 |
43 | # we need to run sclang
44 | echo | sclang
45 |
46 | ./waf clean
47 | ./waf configure --enable-ableton-link
48 | ./waf build
49 |
50 | cd /home/we/norns/sc && ./install.sh
51 |
52 | #sudo cp -f /home/we/fates/install/norns/files/norns-restart.sh /home/we/norns-restart.sh
53 | #sudo cp -f /home/we/fates/install/norns/files/norns-stopall.sh /home/we/norns-stopall.sh
54 | sudo cp -f /home/we/fates/install/norns/files/matron.sh /home/we/norns/matron.sh
55 | sudo cp -f /home/we/fates/install/norns/files/config.txt /boot/config.txt
56 |
57 | cd ~/dust/code
58 | git clone https://github.com/monome/we.git
59 | git clone https://github.com/tehn/awake.git
60 | cd ~/dust/audio
61 | mkdir tape
62 | sudo mv /home/we/fates/install/norns/files/common_audio.tar common_audio.tar
63 | tar -xvf common_audio.tar
64 | rm common_audio.tar
65 |
66 | cd ~
67 | wget https://github.com/monome/maiden/releases/download/v1.0.1/maiden-v1.0.1.tgz
68 | tar -xvf maiden-v1.0.1.tgz
69 | rm maiden-v1.0.1.tgz
70 |
71 | #sudo apt install network-manager
72 | #sudo cp ~/norns-linux-bits/interfaces /etc/network/interfaces
73 | #sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant_bak.conf
74 |
75 | sudo systemctl disable serialosc.service
76 |
77 | # webdav
78 | #cp -a webdav /home/we/
79 | #sudo cp webdav/webdav.service /etc/systemd/system/
80 | #sudo systemctl enable webdav.service
81 | if [ -d /home/we/webdav ]; then
82 | sudo rm -rf /home/we/webdav
83 | sudo systemctl disable webdav.service
84 | sudo rm /etc/systemd/system/webdav.service
85 | fi
86 |
87 | # samba - alternate install
88 | cd ~/fates
89 | git pull
90 | if [ "$SAMBA" == "" ]; then
91 | sudo apt-get update
92 | sudo apt-get install samba samba-common-bin
93 | (echo "sleep"; echo "sleep") | sudo smbpasswd -s -a we
94 | fi
95 | sudo cp ~/fates/install/norns/files/smb.conf /etc/samba/
96 | sudo cp ~/fates/install/norns/files/samba /etc/init.d/
97 | sudo /etc/init.d/samba restart
98 |
99 | sudo reboot
100 |
--------------------------------------------------------------------------------
/install/norns/scripts/fates_install_pi4.sh:
--------------------------------------------------------------------------------
1 | cd /home/we
2 | git clone https://github.com/monome/norns-image.git
3 |
4 | cd ~
5 | mkdir ~/.local/
6 | mkdir ~/.local/share/
7 | mkdir ~/.local/share/SuperCollider
8 | mkdir ~/.local/share/SuperCollider/Extensions
9 |
10 | echo '200328' >> version.txt
11 | mkdir ~/update
12 | mkdir ~/dust
13 | mkdir ~/dust/data
14 | mkdir ~/dust/audio
15 | mkdir ~/dust/code
16 |
17 | sudo cp -f /home/we/fates/install/norns/files/setup.sh /home/we/norns-image
18 | sudo cp -f /home/we/fates/install/norns/files/norns.target /home/we/norns-image/config
19 | sudo cp -f /home/we/fates/install/norns/files/norns-matron.service-rpi4 /home/we/norns-image/config/norns-matron.service
20 | sudo cp -f /home/we/fates/install/norns/files/norns-init.service /etc/systemd/system/
21 | sudo cp -f /home/we/fates/install/norns/files/init-norns.sh /home/we/norns-image/scripts
22 | #sudo cp -f /home/we/fates/install/norns/files/aliases.conf /lib/modprobe.d
23 | sudo cp -f /home/we/fates/install/norns/files/raspi-blacklist.conf /etc/modprobe.d
24 | sudo cp -f /home/we/fates/install/norns/files/asound.conf /etc
25 | sudo cp -f /home/we/fates/install/norns/files/alsa.conf /usr/share/alsa
26 | sudo cp -f /home/we/fates/install/norns/files/alsa-base.conf /etc/modprobe.d/alsa-base.conf
27 | sudo cp -f /home/we/fates/install/norns/files/rc.local /etc/rc.local
28 | sudo cp -f /home/we/fates/install/norns/files/dnsmasq.conf /etc/dnsmasq.conf
29 |
30 | # compile the overlays (buttons and encoders + ssd1322)
31 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-encoders-overlay.dts
32 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-buttons-4encoders.dtbo /home/we/fates/overlays/fates1.7-buttons-4encoders-overlay.dts
33 | sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/fates-ssd1322.dtbo /home/we/fates/overlays/fates1.7-ssd1322-overlay.dts
34 |
35 | cd /home/we/norns-image
36 | ./setup.sh
37 |
38 | cd /home/we
39 | git clone https://github.com/fates-project/norns.git
40 | cd /home/we/norns
41 | git submodule update --recursive --init
42 |
43 | sudo cp -f /home/we/fates/install/norns/files/crone/wscript /home/we/norns/crone/wscript
44 |
45 | # we need to run sclang
46 | echo | sclang
47 |
48 | ./waf clean
49 | ./waf configure --enable-ableton-link
50 | ./waf build
51 |
52 | cd /home/we/norns/sc && ./install.sh
53 |
54 | #sudo cp -f /home/we/fates/install/norns/files/norns-restart.sh /home/we/norns-restart.sh
55 | #sudo cp -f /home/we/fates/install/norns/files/norns-stopall.sh /home/we/norns-stopall.sh
56 | sudo cp -f /home/we/fates/install/norns/files/matron4.sh /home/we/norns/matron.sh
57 | sudo cp -f /home/we/fates/install/norns/files/config4.txt /boot/config.txt
58 |
59 | #update cmdline.txt for consoleblank=0
60 | sudo sed -i '1s/^/consoleblank=0 fbcon=map:1 /' /boot/cmdline.txt
61 |
62 | cd ~/dust/code
63 | git clone https://github.com/monome/we.git
64 | git clone https://github.com/tehn/awake.git
65 | cd ~/dust/audio
66 | mkdir tape
67 | sudo mv /home/we/fates/install/norns/files/common_audio.tar common_audio.tar
68 | tar -xvf common_audio.tar
69 | rm common_audio.tar
70 |
71 | cd ~
72 | wget https://github.com/monome/maiden/releases/download/v1.0.1/maiden-v1.0.1.tgz
73 | tar -xvf maiden-v1.0.1.tgz
74 | rm maiden-v1.0.1.tgz
75 |
76 | #sudo apt install network-manager
77 | #sudo cp ~/norns-linux-bits/interfaces /etc/network/interfaces
78 | #sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant_bak.conf
79 |
80 | sudo systemctl disable serialosc.service
81 |
82 | # webdav
83 | #cp -a webdav /home/we/
84 | #sudo cp webdav/webdav.service /etc/systemd/system/
85 | #sudo systemctl enable webdav.service
86 | if [ -d /home/we/webdav ]; then
87 | sudo rm -rf /home/we/webdav
88 | sudo systemctl disable webdav.service
89 | sudo rm /etc/systemd/system/webdav.service
90 | fi
91 |
92 | # samba - alternate install
93 | cd ~/fates
94 | git pull
95 | if [ "$SAMBA" == "" ]; then
96 | sudo apt-get update
97 | sudo apt-get install samba samba-common-bin
98 | (echo "sleep"; echo "sleep") | sudo smbpasswd -s -a we
99 | fi
100 | sudo cp ~/fates/install/norns/files/smb.conf /etc/samba/
101 | sudo cp ~/fates/install/norns/files/samba /etc/init.d/
102 | sudo /etc/init.d/samba restart
103 |
104 | sudo reboot
105 |
--------------------------------------------------------------------------------
/install/norns/Norns_disk_image_install.md:
--------------------------------------------------------------------------------
1 | # Important - Updates
2 | If you are running the norns software prior to 200218 ***DO NOT*** run the on device SYSTEM > UPDATE from the norns menu. Back up your work and flash with the new disk images below.
3 |
4 | Starting with Norns Update 220306 or 220321 - A new disk image is required.
5 |
6 | # Installing from disk image
7 | ***For Fates v1.8 pcb or later***
8 |
9 |
10 | ### Download Fates disk image (for pi3 or pi4)
11 |
12 | For Raspberry Pi 3b+
13 | [img file](https://archive.org/details/fates-pi3b-20220328.img) (2.9GB)
14 |
15 |
16 |
17 | For Raspberry Pi 4b
18 | [img file](https://archive.org/details/fates-pi4b-20220328.img) (2.6GB)
19 |
20 |
21 |
22 |
23 | ### Flash disk image to the sdcard
24 | Use balenaEtcher - https://www.balena.io/etcher/
25 |
26 | When etcher is finished it will unmount your SD card.
27 |
28 | Remove the SD card and insert into your pi/fates and power it up.
29 |
30 |
31 | ## Wifi
32 |
33 | Use the norns menu to navigate to `SYSTEM > WIFI` and add your WiFi network manually.
34 |
35 | Use the `ADD` option to choose your network and enter your password, etc.
36 |
37 | ## norns wifi hotspot
38 |
39 | Alternately you can setup the pi as a hotspot from the menu. Once you select that you need to connect to the hotspot network called `norns` with your computer. the password is `nnnnnnnn`
40 |
41 | ## SSH to the pi
42 |
43 | Open a terminal, SSH to the Pi
44 |
45 | The default norns user is `we`
46 |
47 | The default password is `sleep`
48 |
49 | Thus to connect you will use `ssh we@fates.local` (or the IP address of the device) and enter `sleep`
50 |
51 | ## Expand filesystem
52 |
53 | *** this is super important ***
54 |
55 | Open a terminal, SSH to the Pi and do
56 |
57 | sudo raspi-config
58 |
59 | Then go to `Advanced Options` and select the first option to `Expand Filesystem`.
60 |
61 | Then do `Finish` and reboot.
62 |
63 | If this errors and says the filesystem can't be resized, try the following from the command line:
64 |
65 |
66 | sudo raspi-config --expand-rootfs
67 | sudo resize2fs /dev/mmcblk0p2
68 |
69 | Then reboot.
70 |
71 | NOTE - Ignore the warning to reboot after the `--expand-rootfs` command. The resize2fs will take a minute or two to run. Wait for it.
72 |
73 | ## Set your timezone, wifi-country
74 |
75 | Open a terminal, SSH to the Pi and do
76 |
77 | sudo raspi-config
78 |
79 | first go to `Localization Options` menu item and select `Change Timezone`
80 | then repeat with `Change WiFi Country`
81 |
82 | `Finish` and reboot (if not prompted).
83 |
84 | After these changes, 2 things may happen:
85 |
86 | 1. You get a `SUPERCOLLIDER FAIL` error at the top of the screen. In this case use the norns menu to SLEEP (which shuts the pi down) and then when the led stops flashing, unplug and plug in power once more to restart. At which point you should see option 2 below.
87 |
88 | 2. You see `NONE` listed at the top of the screen. This is normal. Just go to SELECT > AWAKE to start the Awake script.
89 |
90 | ## Update
91 |
92 | Run SYSTEM > UPDATE on device to update to the current release
93 |
94 | ## Norns documentation
95 |
96 | https://monome.org/docs/norns/
97 |
98 | Be sure to check out the section on the [web-based editor maiden](https://monome.org/docs/norns/#maiden).
99 |
100 | Maiden is extremely useful to get debug information if something is going wrong with the norns software. Its interface is arranged into a left sidebar FILE navigator and a right split editor, where the top is the EDITOR and the bottom is the REPL (read-eval-print-loop).
101 |
102 |
103 | ## Norns scripts
104 |
105 | You can find scripts/patches for norns on the [lines forum](https://llllllll.co/c/library)
106 |
107 | Scripts are installed at `~/dust/code` The easiest way to install is by using `git clone` from the linux command line as most of the scripts are hosted on github.
108 |
109 | for example
110 |
111 | ```
112 | cd ~/dust/code
113 | git clone https://github.com/justmat/foulplay.git
114 | ```
115 | will install the Foulplay script by @justmat
116 |
117 |
118 | ## Norns extras
119 |
120 | There are 2 extra scripts installed at in the `~/` home directory - `norns-restart.sh` and `norns-stopall.sh`. These can be used to restart all of the norns software components or stop all those processes (matron, crone/supercollider, JACK, and maiden).
121 |
122 |
123 | *These install instructions are based on the work of Tehn, Nordseele, Thetechnobear among others. Thank you!*
124 |
--------------------------------------------------------------------------------
/overlays/fates1.2-buttons-encoders-overlay.dts:
--------------------------------------------------------------------------------
1 | /dts-v1/;
2 | /plugin/;
3 |
4 | / {
5 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
6 |
7 | fragment@0 {
8 | target-path = "/soc/gpio";
9 | __overlay__ {
10 | knob_pins1: knob_pins1 {
11 | brcm,pins = <5 6>;
12 | brcm,function = <0>;
13 | brcm,pull = <2>;
14 | };
15 | };
16 | };
17 |
18 | fragment@1 {
19 | target-path = "/soc";
20 | __overlay__ {
21 | knob1: knob1 {
22 | compatible = "rotary-encoder";
23 | #address-cells = <1>;
24 | #size-cells = <0>;
25 | pinctrl-names = "default";
26 | pinctrl-0 = <&knob_pins1>;
27 | gpios = <&gpio 5 1>, <&gpio 6 1>;
28 | linux,axis = <0>; /* REL_X */
29 | rotary-encoder,relative-axis;
30 | rotary-encoder,half-period;
31 | };
32 | };
33 | };
34 | //__overrides__ {
35 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
36 | //linux_axis = <&knob>,"linux,axis";
37 | //rollover = <&knob>,"rotary-encoder,rollover";
38 | //half-period = <&knob>,"rotary-encoder,half-period";
39 | //steps = <&knob>,"rotary-encoder,steps";
40 | //};
41 |
42 | fragment@2 {
43 | target-path = "/soc/gpio";
44 | __overlay__ {
45 | knob_pins2: knob_pins2 {
46 | brcm,pins = <13 12>;
47 | brcm,function = <0>;
48 | brcm,pull = <2>;
49 | };
50 | };
51 | };
52 |
53 | fragment@3 {
54 | target-path = "/soc";
55 | __overlay__ {
56 | knob2: knob2 {
57 | compatible = "rotary-encoder";
58 | #address-cells = <1>;
59 | #size-cells = <0>;
60 | pinctrl-names = "default";
61 | pinctrl-0 = <&knob_pins2>;
62 | gpios = <&gpio 13 1>, <&gpio 12 1>;
63 | linux,axis = <0>; /* REL_X */
64 | rotary-encoder,relative-axis;
65 | rotary-encoder,half-period;
66 | };
67 | };
68 | };
69 | //__overrides__ {
70 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
71 | //linux_axis = <&knob>,"linux,axis";
72 | //rollover = <&knob>,"rotary-encoder,rollover";
73 | //half-period = <&knob>,"rotary-encoder,half-period";
74 | //steps = <&knob>,"rotary-encoder,steps";
75 | //};
76 |
77 | fragment@4 {
78 | target-path = "/soc/gpio";
79 | __overlay__ {
80 | knob_pins3: knob_pins3 {
81 | brcm,pins = <26 16>;
82 | brcm,function = <0>;
83 | brcm,pull = <2>;
84 | };
85 | };
86 | };
87 |
88 | fragment@5 {
89 | target-path = "/soc";
90 | __overlay__ {
91 | knob0: knob3 {
92 | compatible = "rotary-encoder";
93 | #address-cells = <1>;
94 | #size-cells = <0>;
95 | pinctrl-names = "default";
96 | pinctrl-0 = <&knob_pins3>;
97 | gpios = <&gpio 26 1>, <&gpio 16 1>;
98 | linux,axis = <0>; /* REL_X */
99 | rotary-encoder,relative-axis;
100 | rotary-encoder,half-period;
101 | };
102 | };
103 | };
104 | //__overrides__ {
105 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
106 | //linux_axis = <&knob>,"linux,axis";
107 | //rollover = <&knob>,"rotary-encoder,rollover";
108 | //half-period = <&knob>,"rotary-encoder,half-period";
109 | //steps = <&knob>,"rotary-encoder,steps";
110 | //};
111 |
112 | fragment@6 {
113 | target-path = "/";
114 | __overlay__ {
115 | keypad: keys {
116 | compatible = "gpio-keys";
117 | #address-cells = <1>;
118 | #size-cells = <0>;
119 | button@24 {
120 | linux,code = <1>;
121 | gpios = <&gpio 24 1>;
122 | };
123 | button@25 {
124 | linux,code = <2>;
125 | gpios = <&gpio 25 1>;
126 | };
127 | button@23 {
128 | linux,code = <3>;
129 | gpios = <&gpio 23 1>;
130 | };
131 | };
132 | };
133 | };
134 | };
135 |
--------------------------------------------------------------------------------
/overlays/fates1.7-buttons-encoders-overlay.dts:
--------------------------------------------------------------------------------
1 | /*
2 | Device Tree overlay for Fates Buttons and Encoders
3 |
4 | Default pins (FATES v1.7):
5 | Button 1 = 24
6 | Button 2 = 25
7 | Button 3 = 23
8 |
9 | Knob 1 = 5, 6
10 | Knob 2 = 13, 12
11 | Knob 3 = 27, 22
12 | Knob 4 = 26, 16
13 | */
14 |
15 | /dts-v1/;
16 | /plugin/;
17 |
18 | / {
19 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
20 |
21 | fragment@0 {
22 | target-path = "/soc/gpio";
23 | __overlay__ {
24 | knob_pins1: knob_pins1 {
25 | brcm,pins = <5 6>;
26 | brcm,function = <0>;
27 | brcm,pull = <2>;
28 | };
29 | };
30 | };
31 |
32 | fragment@1 {
33 | target-path = "/soc";
34 | __overlay__ {
35 | knob1: knob1 {
36 | compatible = "rotary-encoder";
37 | #address-cells = <1>;
38 | #size-cells = <0>;
39 | pinctrl-names = "default";
40 | pinctrl-0 = <&knob_pins1>;
41 | gpios = <&gpio 5 1>, <&gpio 6 1>;
42 | linux,axis = <0>; /* REL_X */
43 | rotary-encoder,relative-axis;
44 | rotary-encoder,half-period;
45 | };
46 | };
47 | };
48 | //__overrides__ {
49 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
50 | //linux_axis = <&knob>,"linux,axis";
51 | //rollover = <&knob>,"rotary-encoder,rollover";
52 | //half-period = <&knob>,"rotary-encoder,half-period";
53 | //steps = <&knob>,"rotary-encoder,steps";
54 | //};
55 |
56 | fragment@2 {
57 | target-path = "/soc/gpio";
58 | __overlay__ {
59 | knob_pins2: knob_pins2 {
60 | brcm,pins = <13 12>;
61 | brcm,function = <0>;
62 | brcm,pull = <2>;
63 | };
64 | };
65 | };
66 |
67 | fragment@3 {
68 | target-path = "/soc";
69 | __overlay__ {
70 | knob2: knob2 {
71 | compatible = "rotary-encoder";
72 | #address-cells = <1>;
73 | #size-cells = <0>;
74 | pinctrl-names = "default";
75 | pinctrl-0 = <&knob_pins2>;
76 | gpios = <&gpio 13 1>, <&gpio 12 1>;
77 | linux,axis = <0>; /* REL_X */
78 | rotary-encoder,relative-axis;
79 | rotary-encoder,half-period;
80 | };
81 | };
82 | };
83 | //__overrides__ {
84 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
85 | //linux_axis = <&knob>,"linux,axis";
86 | //rollover = <&knob>,"rotary-encoder,rollover";
87 | //half-period = <&knob>,"rotary-encoder,half-period";
88 | //steps = <&knob>,"rotary-encoder,steps";
89 | //};
90 |
91 | fragment@4 {
92 | target-path = "/soc/gpio";
93 | __overlay__ {
94 | knob_pins3: knob_pins3 {
95 | brcm,pins = <27 22>;
96 | brcm,function = <0>;
97 | brcm,pull = <2>;
98 | };
99 | };
100 | };
101 |
102 | fragment@5 {
103 | target-path = "/soc";
104 | __overlay__ {
105 | knob0: knob3 {
106 | compatible = "rotary-encoder";
107 | #address-cells = <1>;
108 | #size-cells = <0>;
109 | pinctrl-names = "default";
110 | pinctrl-0 = <&knob_pins3>;
111 | gpios = <&gpio 27 1>, <&gpio 22 1>;
112 | linux,axis = <0>; /* REL_X */
113 | rotary-encoder,relative-axis;
114 | rotary-encoder,half-period;
115 | };
116 | };
117 | };
118 | //__overrides__ {
119 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
120 | //linux_axis = <&knob>,"linux,axis";
121 | //rollover = <&knob>,"rotary-encoder,rollover";
122 | //half-period = <&knob>,"rotary-encoder,half-period";
123 | //steps = <&knob>,"rotary-encoder,steps";
124 | //};
125 |
126 | fragment@6 {
127 | target-path = "/";
128 | __overlay__ {
129 | keypad: keys {
130 | compatible = "gpio-keys";
131 | #address-cells = <1>;
132 | #size-cells = <0>;
133 | button@24 {
134 | linux,code = <1>;
135 | gpios = <&gpio 24 1>;
136 | };
137 | button@25 {
138 | linux,code = <2>;
139 | gpios = <&gpio 25 1>;
140 | };
141 | button@23 {
142 | linux,code = <3>;
143 | gpios = <&gpio 23 1>;
144 | };
145 | };
146 | };
147 | };
148 | };
149 |
--------------------------------------------------------------------------------
/hardware/BOM-thruhole.md:
--------------------------------------------------------------------------------
1 | ## Fates 1.8+ BOM - Thru Hole Only (for those with a pre-smd-soldered pcb)
2 |
3 | Some parts are listed with a zero quantity. This are meant to be alternates (and should be marked with `ALT`). Choose what works best for you.
4 |
5 | Raspberry Pi 3B+ or 4B can be purchased from a number of sources such as [PiShop.us](https://www.pishop.us/product/raspberry-pi-4-model-b-1gb/), [Adafruit](https://www.adafruit.com/product/3775?src=raspberrypi), [CanaKit](https://www.canakit.com/raspberry-pi-3-model-b-plus.html?cid=usd&src=raspberrypi&src=raspberrypi), [Element14](http://www.newark.com/49AC7637?src=raspberrypi), etc.
6 | Mouser also now carries Pis (although a bit more expensive) if you want one-stop shopping (part numbers listed below).
7 |
8 | ENC4 is optional and is not functional for norns right now. If you want to use Orac later, get 4 encoders.
9 |
10 | | Mouser | QTY | Part | Value | Package |
11 | |-----|:--:|-----|-----|-----|
12 | |710-860020672005|4|C12 C13 C14 C15|1uF Electrolytic|11mm|
13 | |667-ECE-A1VKS100|3|C19 C20 C21|10uF Electrolytic|11mm|
14 | |667-ECA-0JM221B|2|C17 C18|220uF Electrolytic|11mm|
15 | |652-PEC11R-4015F-N24|3|ENC1 ENC2 ENC3 (ENC4)|15mm Flatted shaft||
16 | |652-PEC11R-4015K-N24|0|ALT ENC1 ENC2 ENC3 (ENC4)|15mm Knurled shaft||
17 | |652-PEC11R-4020F-N24|0|ALT ENC1 ENC2 ENC3 (ENC4)|20mm Flatted shaft||
18 | |NHD-2.7-12864WDW3|1|SSD1322|NHD-2.7-12864WDW3 OLED Display|
19 | |490-SJ1-3523N|1|CUI_SJ1-3523N|STEREOJACK Headphone||
20 | |517-929984-01-20-RK|1||1x20 low profile female header for disp||
21 | |200-SLW12001TS|0|ALT|1x20 low profile female header for disp||
22 | |855-M20-9992045|1||1x20 male pin header for disp (gold)||
23 | |855-M20-9992046|0|ALT|1x40 male pin header for disp (tin)||
24 | |485-2222|1||2x20 GPIO female header for RasPi|Adafruit Part # 2222|
25 | |855-M20-7832046|0|ALT|Alternate 2x20 GPIO female header||
26 | |649-10027011-106HLF|1||UART 6 pin header||
27 | |5GTH920|3|S1 S2 S3|5G MEC switch - Clicky||
28 | |5GTH920Q|0|S1 S2 S3 ALT|5G MEC switch - Quiet||
29 | |642-1US09|3| |5G MEC switch caps black||
30 | |642-1US03|0| ALT |5G MEC switch caps gray||
31 | |642-1DS09|0| ALT |5G MEC switch caps black - rounded||
32 | |[RPI3-MODBP-BULK](http://www.mouser.com/Search/ProductDetail.aspx?R=RPI3-MODBP-BULK)|1| |RPI3 b+||
33 | |[RPI4-MODBP-2GB-BULK](http://www.mouser.com/Search/ProductDetail.aspx?R=RPI4-MODBP-2GB-BULK)|0| |RPI4 b 2GB||
34 | |[RPI4-MODBP-4GB-BULK](http://www.mouser.com/Search/ProductDetail.aspx?R=RPI4-MODBP-4GB-BULK)|0| |RPI4 b 4GB||
35 | ||1| |RPI Power supply - 3A USB-C recommended||
36 |
37 | You might need to adjust order quantities, get knurled encoders, or get clicky buttons instead of quiet. So be sure to check part numbers and availability before ordering. NOTE - some parts may be out of stock. See the alternates listed above for other choices.
38 |
39 | **[A mouser cart](https://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=c39648324f )** is setup with these parts (not including Pi).
40 |
41 | **NOTE - Mouser cart likely has items out of stock right now.** Check above for alternate part numbers.
42 |
43 | Spacers/screws are also not included in this cart. There is a [separate cart for spacers](https://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=367d290c06) if you need them (**Cart does not include screws**).
44 |
45 | ## Spacers/screws
46 |
47 | **NOTE - If you're getting an acrylic case from the Denki-oto shop, the case kit includes spacers/screws.**
48 |
49 | Spacers/screws - I use 2.5mm size screws and spacers. 3mm should work as well.
50 |
51 | Here's my spacer list. This may also be to taste if you solder the display header closer to the main board. Sorry I don't have a good Mouser part number for 2.5M screws.
52 |
53 | | | qty | height | | location |
54 | |-----|--|-----|-----|-----|
55 | |[855-R25-3000302](http://www.mouser.com/Search/ProductDetail.aspx?R=855-R25-3000302)|2|3mm|M-F|Right side pi bottom|
56 | |[761-M2101-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M2101-2545-AL)|2|6mm|M-F|under oled display corners|
57 | |[761-M1258-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M1258-2545-AL)|2|11mm|F-F|Right side pi|
58 | |[761-M1262-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M1262-2545-AL)|4|15mm|F-F|left/back side|
59 | |[761-M2105-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M2105-2545-AL)|4|10mm|M-F|top corners|
60 | ||2||5mm long|2.5mm rack screws|
61 | ||10||6mm long|2.5mm rack screws|
62 | ||1||8-10mm long|2.5mm rack screws|
63 |
64 |
65 | ### encoder knobs:
66 |
67 | https://modularaddict.com/parts/knobs/reanp670d-knobs
68 | https://store.djtechtools.com/products/chroma-caps-knobs-and-faders
69 | https://synthcube.com/cart/synth-diy/parts/knobs/rogan-series-p-knobs
70 | https://modularaddict.com/parts/knobs/pt2d-knob
71 | https://modularaddict.com/parts/knobs/albs-midibox-knobs
72 |
--------------------------------------------------------------------------------
/overlays/fates1.5-buttons-encoders-overlay.dts:
--------------------------------------------------------------------------------
1 | /dts-v1/;
2 | /plugin/;
3 |
4 | / {
5 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
6 |
7 | fragment@0 {
8 | target-path = "/soc/gpio";
9 | __overlay__ {
10 | knob_pins4: knob_pins4 {
11 | brcm,pins = <26 16>;
12 | brcm,function = <0>;
13 | brcm,pull = <2>;
14 | };
15 | };
16 | };
17 |
18 | fragment@1 {
19 | target-path = "/soc";
20 | __overlay__ {
21 | knob4: knob4 {
22 | compatible = "rotary-encoder";
23 | #address-cells = <1>;
24 | #size-cells = <0>;
25 | pinctrl-names = "default";
26 | pinctrl-0 = <&knob_pins4>;
27 | gpios = <&gpio 26 1>, <&gpio 16 1>;
28 | linux,axis = <0>; /* REL_X */
29 | rotary-encoder,relative-axis;
30 | rotary-encoder,half-period;
31 | };
32 | };
33 | };
34 | //__overrides__ {
35 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
36 | //linux_axis = <&knob>,"linux,axis";
37 | //rollover = <&knob>,"rotary-encoder,rollover";
38 | //half-period = <&knob>,"rotary-encoder,half-period";
39 | //steps = <&knob>,"rotary-encoder,steps";
40 | //};
41 |
42 | fragment@2 {
43 | target-path = "/soc/gpio";
44 | __overlay__ {
45 | knob_pins1: knob_pins1 {
46 | brcm,pins = <5 6>;
47 | brcm,function = <0>;
48 | brcm,pull = <2>;
49 | };
50 | };
51 | };
52 |
53 | fragment@3 {
54 | target-path = "/soc";
55 | __overlay__ {
56 | knob1: knob1 {
57 | compatible = "rotary-encoder";
58 | #address-cells = <1>;
59 | #size-cells = <0>;
60 | pinctrl-names = "default";
61 | pinctrl-0 = <&knob_pins1>;
62 | gpios = <&gpio 5 1>, <&gpio 6 1>;
63 | linux,axis = <0>; /* REL_X */
64 | rotary-encoder,relative-axis;
65 | rotary-encoder,half-period;
66 | };
67 | };
68 | };
69 | //__overrides__ {
70 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
71 | //linux_axis = <&knob>,"linux,axis";
72 | //rollover = <&knob>,"rotary-encoder,rollover";
73 | //half-period = <&knob>,"rotary-encoder,half-period";
74 | //steps = <&knob>,"rotary-encoder,steps";
75 | //};
76 |
77 | fragment@4 {
78 | target-path = "/soc/gpio";
79 | __overlay__ {
80 | knob_pins2: knob_pins2 {
81 | brcm,pins = <13 12>;
82 | brcm,function = <0>;
83 | brcm,pull = <2>;
84 | };
85 | };
86 | };
87 |
88 | fragment@5 {
89 | target-path = "/soc";
90 | __overlay__ {
91 | knob2: knob2 {
92 | compatible = "rotary-encoder";
93 | #address-cells = <1>;
94 | #size-cells = <0>;
95 | pinctrl-names = "default";
96 | pinctrl-0 = <&knob_pins2>;
97 | gpios = <&gpio 13 1>, <&gpio 12 1>;
98 | linux,axis = <0>; /* REL_X */
99 | rotary-encoder,relative-axis;
100 | rotary-encoder,half-period;
101 | };
102 | };
103 | };
104 | //__overrides__ {
105 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
106 | //linux_axis = <&knob>,"linux,axis";
107 | //rollover = <&knob>,"rotary-encoder,rollover";
108 | //half-period = <&knob>,"rotary-encoder,half-period";
109 | //steps = <&knob>,"rotary-encoder,steps";
110 | //};
111 |
112 | fragment@6 {
113 | target-path = "/soc/gpio";
114 | __overlay__ {
115 | knob_pins3: knob_pins3 {
116 | brcm,pins = <27 22>;
117 | brcm,function = <0>;
118 | brcm,pull = <2>;
119 | };
120 | };
121 | };
122 |
123 | fragment@7 {
124 | target-path = "/soc";
125 | __overlay__ {
126 | knob0: knob3 {
127 | compatible = "rotary-encoder";
128 | #address-cells = <1>;
129 | #size-cells = <0>;
130 | pinctrl-names = "default";
131 | pinctrl-0 = <&knob_pins3>;
132 | gpios = <&gpio 27 1>, <&gpio 22 1>;
133 | linux,axis = <0>; /* REL_X */
134 | rotary-encoder,relative-axis;
135 | rotary-encoder,half-period;
136 | };
137 | };
138 | };
139 | //__overrides__ {
140 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
141 | //linux_axis = <&knob>,"linux,axis";
142 | //rollover = <&knob>,"rotary-encoder,rollover";
143 | //half-period = <&knob>,"rotary-encoder,half-period";
144 | //steps = <&knob>,"rotary-encoder,steps";
145 | //};
146 |
147 | fragment@8 {
148 | target-path = "/";
149 | __overlay__ {
150 | keypad: keys {
151 | compatible = "gpio-keys";
152 | #address-cells = <1>;
153 | #size-cells = <0>;
154 | button@24 {
155 | linux,code = <1>;
156 | gpios = <&gpio 24 1>;
157 | };
158 | button@25 {
159 | linux,code = <2>;
160 | gpios = <&gpio 25 1>;
161 | };
162 | button@23 {
163 | linux,code = <3>;
164 | gpios = <&gpio 23 1>;
165 | };
166 | };
167 | };
168 | };
169 | };
170 |
--------------------------------------------------------------------------------
/hardware/Build.md:
--------------------------------------------------------------------------------
1 | ## Fates 1.8+ Build
2 |
3 | This is an intermediate to advanced build. If you've not soldered a TSSOP chip before (the DAC), this build may be challenging. Seek assistance if possible.
4 |
5 | Everything is marked on the pcb, but if you need help, please see below for parts placement
6 |
7 |
8 | ### DAC
9 |
10 | Solder the DAC first. Use flux. Google some videos if you're not sure how best to solder it.
11 |
12 |
13 |
14 | ### Voltage regulator
15 | Do the little voltage regulator next and then check your work on all those tiny pins with a loupe/magnifier.
16 |
17 |
18 |
19 |
20 | ### 100n capacitors
21 |
22 |
23 | ### 220p capacitors
24 |
25 |
26 | ### 18p capacitors
27 |
28 |
29 | ### 100R resistors
30 |
31 |
32 | ### 220R resistors
33 |
34 |
35 | ### 2.2K resistors
36 |
37 |
38 | ### 5.1K resistors
39 |
40 |
41 | ### 5.6K resistors
42 |
43 |
44 | ### 10K resistors
45 |
46 |
47 | ### 47K resistors
48 |
49 |
50 |
51 | ### Crystal
52 | Save the crystal for last of the smd stuff since it's big and gets in the way of soldering the smaller parts.
53 |
54 | There's no direction or polarity here. It can go on either way.
55 |
56 |
57 |
58 | # Thru-hole
59 |
60 | I have been doing the thru-hole stuff in the following order: USB jack, audio jacks, headphone jack, pin headers (2x20 first, then flip over for the 1x20), switches, capacitors, and encoders last. Then do the headers on the display.
61 |
62 | ## USB-C Jack
63 |
64 | The pins here are quite small and close together.
65 |
66 | **Be extra careful inserting the jack onto the pcb.** I've bent the little pins more than once. **Before you solder** - check from the top with a loupe/magnifier to be sure each hole has a pin in it.
67 |
68 | Solder each pin and then hit the area with some flux and touch each point again.
69 |
70 | Be aware of the routing on the USB Jack pins. Some pins are tied together, so don't be alarmed if your soldering looks bridged on the diagonals.
71 |
72 |
73 |
74 |
75 | ## TIP - Test voltage
76 |
77 | Once the USB-C jack is attached, check that you don't have continuity between 5v and GND and then plug power into the jack and check the USB-C power input voltage level. I suggest doing this __before__ you attach the pi. There's a 5v/GND header pin holes right near the voltage regulator which is great for testing voltage (+5v).
78 |
79 |
80 |
81 | ***Be sure you are using a good power supply. The Pi 3b+ needs a 5V 2.5A power supply. The Pi 4 requires a 5V 3A power supply. Buy one of the official Raspberry Pi power supplies if you're not sure.***
82 |
83 | ## Audio jacks
84 |
85 | Audio jacks (and headphone jack) mount __from the bottom__
86 |
87 | NOTE - if you use the CUI MJ-3536 jacks from Mouser, you may need to trim or file the pins to fit in the pcb. The CUI jack pins are just a tiny bit wider than the PJ302M jacks.
88 |
89 |
90 | ## Thru-hole capacitors
91 |
92 | These all attach from the bottom. Values are marked on the board.
93 |
94 | NOTE - the caps have polarity. The long pin of the capacitor is the positive pin (+) (this is marked on the board as +). The negative pin (-) is marked on the capacitor as a stripe down the side.
95 |
96 | ## Headers
97 |
98 | The 2x20 (for the pi) goes in from the bottom.
99 |
100 | The 1x20 (for the display) goes in from the top.
101 |
102 | ## Switches (buttons)
103 |
104 | Pin 1 is marked on the bottom of the switches. Pin 1 on the pcb is the lower right corner - there's a very small dot there.
105 |
106 |
107 |
108 |
109 | ## Encoders
110 |
111 | Do these last. Don't worry about mounting nuts/washers
112 |
113 | ## Display header pins
114 |
115 | NOTE - Don't solder the display directly to the Fates pcb. Use the low profile header listed in the BOM. You won't want to desolder 20 pins to remove it if something goes wrong with the display.
116 |
117 | I use the following method for the display pins - insert the long end of the header pins from the top of the display and then solder them in place from the bottom. Then clip the short header pins from the top.
118 |
119 | This ends up with about 6mm between the main board and the display carrier board. You could trim the pins if you want the display to sit lower. My case designs include a 6mm standoff for this mounting technique.
120 |
121 | 
122 | 
123 |
124 | ## TIP - Test voltage again
125 |
126 | You can attach the Pi and power it without an SD card inside and then test voltages on the board
127 |
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/overlays/fates1.7-buttons-4encoders-overlay.dts:
--------------------------------------------------------------------------------
1 | /*
2 | Device Tree overlay for Fates Buttons and Encoders
3 |
4 | Default pins (FATES v1.7):
5 | Button 1 = 24
6 | Button 2 = 25
7 | Button 3 = 23
8 |
9 | Knob 1 = 5, 6
10 | Knob 2 = 13, 12
11 | Knob 3 = 27, 22
12 | Knob 4 = 26, 16
13 | */
14 |
15 | /dts-v1/;
16 | /plugin/;
17 |
18 | / {
19 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
20 |
21 | fragment@0 {
22 | target-path = "/soc/gpio";
23 | __overlay__ {
24 | knob_pins4: knob_pins4 {
25 | brcm,pins = <26 16>;
26 | brcm,function = <0>;
27 | brcm,pull = <2>;
28 | };
29 | };
30 | };
31 |
32 | fragment@1 {
33 | target-path = "/soc";
34 | __overlay__ {
35 | knob4: knob4 {
36 | compatible = "rotary-encoder";
37 | #address-cells = <1>;
38 | #size-cells = <0>;
39 | pinctrl-names = "default";
40 | pinctrl-0 = <&knob_pins4>;
41 | gpios = <&gpio 26 1>, <&gpio 16 1>;
42 | linux,axis = <0>; /* REL_X */
43 | rotary-encoder,relative-axis;
44 | rotary-encoder,half-period;
45 | };
46 | };
47 | };
48 | //__overrides__ {
49 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
50 | //linux_axis = <&knob>,"linux,axis";
51 | //rollover = <&knob>,"rotary-encoder,rollover";
52 | //half-period = <&knob>,"rotary-encoder,half-period";
53 | //steps = <&knob>,"rotary-encoder,steps";
54 | //};
55 |
56 | fragment@2 {
57 | target-path = "/soc/gpio";
58 | __overlay__ {
59 | knob_pins1: knob_pins1 {
60 | brcm,pins = <5 6>;
61 | brcm,function = <0>;
62 | brcm,pull = <2>;
63 | };
64 | };
65 | };
66 |
67 | fragment@3 {
68 | target-path = "/soc";
69 | __overlay__ {
70 | knob1: knob1 {
71 | compatible = "rotary-encoder";
72 | #address-cells = <1>;
73 | #size-cells = <0>;
74 | pinctrl-names = "default";
75 | pinctrl-0 = <&knob_pins1>;
76 | gpios = <&gpio 5 1>, <&gpio 6 1>;
77 | linux,axis = <0>; /* REL_X */
78 | rotary-encoder,relative-axis;
79 | rotary-encoder,half-period;
80 | };
81 | };
82 | };
83 | //__overrides__ {
84 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
85 | //linux_axis = <&knob>,"linux,axis";
86 | //rollover = <&knob>,"rotary-encoder,rollover";
87 | //half-period = <&knob>,"rotary-encoder,half-period";
88 | //steps = <&knob>,"rotary-encoder,steps";
89 | //};
90 |
91 | fragment@4 {
92 | target-path = "/soc/gpio";
93 | __overlay__ {
94 | knob_pins2: knob_pins2 {
95 | brcm,pins = <13 12>;
96 | brcm,function = <0>;
97 | brcm,pull = <2>;
98 | };
99 | };
100 | };
101 |
102 | fragment@5 {
103 | target-path = "/soc";
104 | __overlay__ {
105 | knob2: knob2 {
106 | compatible = "rotary-encoder";
107 | #address-cells = <1>;
108 | #size-cells = <0>;
109 | pinctrl-names = "default";
110 | pinctrl-0 = <&knob_pins2>;
111 | gpios = <&gpio 13 1>, <&gpio 12 1>;
112 | linux,axis = <0>; /* REL_X */
113 | rotary-encoder,relative-axis;
114 | rotary-encoder,half-period;
115 | };
116 | };
117 | };
118 | //__overrides__ {
119 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
120 | //linux_axis = <&knob>,"linux,axis";
121 | //rollover = <&knob>,"rotary-encoder,rollover";
122 | //half-period = <&knob>,"rotary-encoder,half-period";
123 | //steps = <&knob>,"rotary-encoder,steps";
124 | //};
125 |
126 | fragment@6 {
127 | target-path = "/soc/gpio";
128 | __overlay__ {
129 | knob_pins3: knob_pins3 {
130 | brcm,pins = <27 22>;
131 | brcm,function = <0>;
132 | brcm,pull = <2>;
133 | };
134 | };
135 | };
136 |
137 | fragment@7 {
138 | target-path = "/soc";
139 | __overlay__ {
140 | knob0: knob3 {
141 | compatible = "rotary-encoder";
142 | #address-cells = <1>;
143 | #size-cells = <0>;
144 | pinctrl-names = "default";
145 | pinctrl-0 = <&knob_pins3>;
146 | gpios = <&gpio 27 1>, <&gpio 22 1>;
147 | linux,axis = <0>; /* REL_X */
148 | rotary-encoder,relative-axis;
149 | rotary-encoder,half-period;
150 | };
151 | };
152 | };
153 | //__overrides__ {
154 | //relative_axis = <&knob>,"rotary-encoder,relative-axis";
155 | //linux_axis = <&knob>,"linux,axis";
156 | //rollover = <&knob>,"rotary-encoder,rollover";
157 | //half-period = <&knob>,"rotary-encoder,half-period";
158 | //steps = <&knob>,"rotary-encoder,steps";
159 | //};
160 |
161 | fragment@8 {
162 | target-path = "/";
163 | __overlay__ {
164 | keypad: keys {
165 | compatible = "gpio-keys";
166 | #address-cells = <1>;
167 | #size-cells = <0>;
168 | button@24 {
169 | linux,code = <1>;
170 | gpios = <&gpio 24 1>;
171 | };
172 | button@25 {
173 | linux,code = <2>;
174 | gpios = <&gpio 25 1>;
175 | };
176 | button@23 {
177 | linux,code = <3>;
178 | gpios = <&gpio 23 1>;
179 | };
180 | };
181 | };
182 | };
183 | };
184 |
--------------------------------------------------------------------------------
/hardware/BOM.md:
--------------------------------------------------------------------------------
1 | ## Fates 1.8+ BOM
2 |
3 | Some parts are listed with a zero quantity. This are meant to be alternates (and should be marked with `ALT`). Choose what works best for you.
4 |
5 | PJ302M jacks are available from [Thonk](https://www.thonk.co.uk/shop/3-5mm-jacks/ ), [Synthcube](https://synthcube.com/cart/3-5mm-mono-jack-pj302m-rt-angle-hex-nut) and [Modular Addict](https://modularaddict.com/pj302m-jacks) among other sources. Or you can get the alternate CUI MJ-3536 jack listed below from Mouser.
6 |
7 | Raspberry Pi 3B+ or 4B can be purchased from a number of sources such as [PiShop.us](https://www.pishop.us/product/raspberry-pi-4-model-b-1gb/), [Adafruit](https://www.adafruit.com/product/3775?src=raspberrypi), [CanaKit](https://www.canakit.com/raspberry-pi-3-model-b-plus.html?cid=usd&src=raspberrypi&src=raspberrypi), [Element14](http://www.newark.com/49AC7637?src=raspberrypi), etc.
8 | Mouser also now carries Pis (although a bit more expensive) if you want one-stop shopping (part numbers listed below).
9 |
10 | ENC4 is optional and is not functional for norns right now. If you want to use Orac later, get 4 encoders.
11 |
12 | Note - some Mouser part numbers may be out of stock (usually passives), so you may need to search for equivalent alternatives
13 |
14 | | Mouser | QTY | Part | Value | Package |
15 | |-----|:--:|-----|-----|-----|
16 | |603-AC0805FR-07100RL|2|R4 R5|100R|0805|
17 | |603-RC0805FR-07220RL|4|R16 R17 R18 R19|220R|0805|
18 | |660-RK73H2ATTD2201F|2|R14 R15|2.2K|0805|
19 | |603-RC0805FR-075K1L|2|R20 R21|5.1K|0805|
20 | |279-CRGCQ0805F5K6|4|R10 R11 R12 R13|5.6K|0805|
21 | |603-RC0805FR-0710KL|3|R1 R2 R3|10k|0805|
22 | |RC0805FR-0747KL|4|R6 R7 R8 R9|47K|0805|
23 | |603-CC805JRNPO9BN180|2|C10 C11|18p|0805|
24 | |710-885012207082|2|C8 C9|220p|0805|
25 | |80-C0805C104J5RACLR|7|C1 C2 C3 C4 C5 C6 C7|100n|0805|
26 | |710-860020672005|4|C12 C13 C14 C15|1uF Electrolytic|11mm|
27 | |667-ECE-A1VKS100|3|C18 C19 C20|10uF Electrolytic|11mm|
28 | |80-ESH227M016AE3AA|2|C16 C17|220uF Electrolytic|11mm|
29 | |ADP150AUJZ-3.3-R7|1|ADP150-3.3|ADP150AUJZ-3.3-R7||
30 | |238-WM8731SEDS/RV|1|U1|WM8731SEDS/V|SSOP28||
31 | |815-ABLS2-12.2-D4Y-T|1|Y1|12.288MHz|HC49UP||
32 | |652-PEC11R-4015F-N24|3|ENC1 ENC2 ENC3 (ENC4)|15mm Flatted shaft||
33 | |652-PEC11R-4015K-N24|0|ALT ENC1 ENC2 ENC3 (ENC4)|15mm Knurled shaft||
34 | |652-PEC11R-4020F-N24|0|ALT ENC1 ENC2 ENC3 (ENC4)|20mm Flatted shaft||
35 | |NHD-2.7-12864WDW3|1|SSD1322|NHD-2.7-12864WDW3 OLED Display|
36 | |490-SJ1-3523N|1|CUI_SJ1-3523N|STEREOJACK Headphone||
37 | ||4|Z5 Z6 Z7 Z8|PJ302M2 1/8in mono jack|PJ302M|
38 | |490-MJ-3536|0| ALT |alternate 1/8in jack - CUI MJ-3536||
39 | |517-929984-01-20-RK|1||1x20 low profile female header for disp||
40 | |200-SLW12001TS|0|ALT|1x20 low profile female header for disp||
41 | |855-M20-9992045|1||1x20 male pin header for disp (gold)||
42 | |855-M20-9992046|0|ALT|1x40 male pin header for disp (tin)||
43 | |485-2222|1||2x20 GPIO female header for RasPi|Adafruit Part # 2222|
44 | |855-M20-7832046|0|ALT|Alternate 2x20 GPIO female header||
45 | |649-10027011-106HLF|1||UART 6 pin header||
46 | |806-KUSBX-SLCS1N14-B|1||USB C jack|** See note|
47 | |5GTH920|3|S1 S2 S3|5G MEC switch - Clicky||
48 | |5GTH920Q|0|S1 S2 S3 ALT|5G MEC switch - Quiet||
49 | |642-1US09|3| |5G MEC switch caps black||
50 | |642-1US03|0| ALT |5G MEC switch caps gray||
51 | |642-1DS09|0| ALT |5G MEC switch caps black - rounded||
52 | |[RPI3-MODBP-BULK](http://www.mouser.com/Search/ProductDetail.aspx?R=RPI3-MODBP-BULK)|1| |RPI3 b+||
53 | |[RPI4-MODBP-2GB-BULK](http://www.mouser.com/Search/ProductDetail.aspx?R=RPI4-MODBP-2GB-BULK)|0| |RPI4 b 2GB||
54 | |[RPI4-MODBP-4GB-BULK](http://www.mouser.com/Search/ProductDetail.aspx?R=RPI4-MODBP-4GB-BULK)|0| |RPI4 b 4GB||
55 | ||1| |RPI Power supply - 3A USB-C recommended||
56 |
57 | If out of stock at Mouser/Digikey, the OLED display can also be purchased [directly from the manufacturer here](https://www.newhavendisplay.com/nhd2712864wdw3-p-9547.html).
58 |
59 | You might need to adjust order quantities, get knurled encoders, or get clicky buttons instead of quiet. So be sure to check part numbers and availability before ordering. NOTE - some parts may be out of stock. See the alternates listed above for other choices.
60 |
61 | \** The USB-C jack can be considered optional. You can power everything directly from the Raspberry Pi's own power input OR the Fates USB-C jack (DO NOT TRY TO POWER BOTH!)
62 |
63 | **[A mouser cart](https://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=bdba42bdf9 )** is setup with these parts (not including Pi). **Audio jacks are NOT INCLUDED in this cart** (see note above). If you want them from Mouser order 4 of 490-MJ-3536
64 |
65 | **NOTE - Mouser cart likely has items out of stock right now.** Check above for alternate part numbers.
66 |
67 | ## Spacers/screws
68 |
69 | **NOTE - If you're getting an acrylic case from the Denki-oto shop, the case kit includes spacers/screws.**
70 |
71 | Spacers/screws are also not included in the cart above. There is a [separate cart for spacers](https://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=367d290c06) if you need them (**Cart does not include screws**).
72 |
73 | Spacers/screws - I use 2.5mm size screws and spacers. 3mm should work as well.
74 |
75 | Here's my spacer list. This may also be to taste if you solder the display header closer to the main board. Sorry I don't have a good Mouser part number for 2.5M screws.
76 |
77 | | | qty | height | | location |
78 | |-----|--|-----|-----|-----|
79 | |[855-R25-3000302](http://www.mouser.com/Search/ProductDetail.aspx?R=855-R25-3000302)|2|3mm|M-F|Right side pi bottom|
80 | |[761-M2101-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M2101-2545-AL)|2|6mm|M-F|under oled display corners|
81 | |[761-M1258-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M1258-2545-AL)|2|11mm|F-F|Right side pi|
82 | |[761-M1262-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M1262-2545-AL)|4|15mm|F-F|left/back side|
83 | |[761-M2105-2545-AL](http://www.mouser.com/Search/ProductDetail.aspx?R=761-M2105-2545-AL)|4|10mm|M-F|top corners|
84 | ||2||5mm long|2.5mm rack screws|
85 | ||10||6mm long|2.5mm rack screws|
86 | ||1||8-10mm long|2.5mm rack screws|
87 |
88 |
89 |
90 | ### encoder knobs:
91 |
92 | https://modularaddict.com/parts/knobs/reanp670d-knobs
93 | https://store.djtechtools.com/products/chroma-caps-knobs-and-faders
94 | https://synthcube.com/cart/synth-diy/parts/knobs/rogan-series-p-knobs
95 | https://modularaddict.com/parts/knobs/pt2d-knob
96 | https://modularaddict.com/parts/knobs/albs-midibox-knobs
97 |
98 |
--------------------------------------------------------------------------------
/install/norns/Norns_install_instructions_1.8.md:
--------------------------------------------------------------------------------
1 | # Installing Linux and Norns on Fates (full install)
2 | ***For Fates v1.8 pcb or later***
3 |
4 | DO NOT USE THIS IF YOU HAVE DOWNLOADED ONE OF THE FATES DISK IMAGES
5 |
6 | This is a full "from scratch" install of everything.
7 |
8 | ## Preparing the Raspberry PI
9 |
10 | ### Download Raspbian Buster Lite (for pi3 or pi4)
11 |
12 | https://www.raspberrypi.org/downloads/raspbian/
13 |
14 | ### Flash raspbian lite to the sdcard
15 | Use balenaEtcher - https://www.balena.io/etcher/ for this.
16 |
17 | When etcher is finished it will unmount your SD card. Remove the SD card and re-insert/mount it in your computer for the next steps.
18 |
19 |
20 |
21 | ### SSH and WiFi configuration
22 |
23 | The following assumes a "headless" situation without a keyboard or monitor attached to the pi. If you have a keyboard and monitor setup, use `sudo raspi-config` and set up wifi and ssh there.
24 |
25 | Alternately you can connect to the pi over ethernet and then setup wifi with `raspi-config`. NOTE that you still need the `ssh` file to do this.
26 |
27 | Create an empty file named `ssh` (lowercase, and be sure there's no file extension)
28 |
29 | Next create a `wpa_supplicant.conf` file with your local wifi network settings. Change the country, router name, and key in the example below.
30 |
31 | country=US #(your country)
32 | update_config=1
33 | ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
34 | network={
35 | scan_ssid=1
36 | ssid="Name of your router"
37 | psk="Your key"
38 | key_mgmt=WPA-PSK
39 | }
40 |
41 | Then copy the **wpa_supplicant.conf** and **ssh** files you've created to the root of the ***boot*** volume on the SD card and then unmount the card.
42 |
43 |
44 | ### Put the SD card in the Raspberry Pi and boot
45 |
46 | Find the IP of your Raspberry Pi using a software like [Lanscan](https://itunes.apple.com/us/app/lanscan/id472226235) (on MacoS)
47 |
48 | Or if you have a keyboard and HDMI monitor plugged into the pi, login and use `ifconfig` to get your IP address `inet` (you want the one listed under `wlan0`).
49 |
50 | (Optional)
51 | Then you can generate an SSH key (replace XX below with the IP of the RPI).
52 | Open a terminal and enter the following command (XX is the last two digits of the PI's IP).
53 | `ssh-keygen -R 192.168.1.XX`
54 |
55 | Connect via SSH. `ssh pi@192.168.1.XX` The default password is ***raspberry***
56 |
57 | `ssh pi@raspberrypi.local` may also work if you have BonJour/ZeroConf available.
58 |
59 |
60 | ### RPI adjustments
61 | Enter the following commands in a terminal, edit if needed (country etc).
62 |
63 | Note - a fair bit of this setup is to get the pi to behave exactly like a hardward norns unit (default username/password, etc.)
64 |
65 | `sudo raspi-config nonint do_spi 0`
66 | `sudo raspi-config nonint do_i2c 0`
67 | `sudo raspi-config nonint do_expand_rootfs`
68 | `sudo raspi-config nonint do_hostname norns`
69 | `sudo raspi-config`
70 | (change locale, timezone, and wifi country in the "Localization" menu)
71 | (change password here as well to ***(sleep)*** )
72 |
73 | `sudo reboot`
74 |
75 | Note: if the following `@norns.local` addressing does not work for you, BonJour/ZeroConf may not be working on your system (it's not a default install on Windows). Use the IP address instead.
76 |
77 | `ssh pi@norns.local`
78 | `sudo passwd root` ***(sleep)***
79 | `sudo nano /etc/ssh/sshd_config`
80 | ***(uncomment the line for "PermitRootLogin" and change "prohibit-password" to "yes")***
81 | `sudo reboot`
82 |
83 | SSH back in as root to modify the default user.
84 |
85 | `ssh root@norns.local`
86 | `usermod -l we -d /home/we -m pi`
87 | `groupmod --new-name we pi`
88 | `exit`
89 |
90 | `ssh we@norns.local`
91 |
92 | `sudo passwd -l root` ***(sleep)***
93 | `sudo nano /etc/sudoers.d/010_pi-nopasswd` ***(change pi to we)***
94 | `sudo reboot`
95 |
96 | ## Linux & Kernel
97 |
98 | ### Run updates install git, build dependencies, and compile the linux kernel
99 |
100 | This installs some required packages and builds the Raspberry Pi kernel modules.
101 |
102 | Reminder: the password is now ***sleep***
103 |
104 | ssh we@norns.local
105 |
106 | sudo apt update -y
107 | sudo apt-get dist-upgrade -y
108 | sudo apt-get install git bc vim bison flex libssl-dev i2c-tools libncurses5-dev -y
109 | sudo apt-get install raspberrypi-kernel-headers
110 |
111 |
112 | Then reboot, reconnect and continue...
113 |
114 | cd ~
115 | git clone https://github.com/okyeron/fates.git
116 |
117 |
118 | on pi3/Buster
119 |
120 | cd /home/we/fates/install/norns/scripts && ./fates_prepare_rpi3buster.sh
121 |
122 | on pi4
123 |
124 | cd /home/we/fates/install/norns/scripts && ./fates_prepare_rpi4.sh
125 |
126 | Answer `m` when prompted for new modules - specifically the SSD1322 module.
127 |
128 | Or...
129 | if the install process shows the `menuconfig` interface:
130 | Navigate to enable the ssd1322 driver, check to be sure it's enabled with ``
131 | ```
132 | ## Device Drivers ---> Staging Drivers ---> Support for small TFT LCD display modules --->
133 | ## SSD1322 driver
134 | ```
135 |
136 | If you have a pi4 and are using an HDMI monitor, you will want to disconnect the HDMI monitor cable and do the following via SSH.
137 |
138 | ### Testing the ssd1322 OLED
139 | Now we're going to test the OLED display. If your soldering is fine and if the kernel has been built correctly, you should see the console displayed on the OLED screen but first we need to do this :
140 |
141 | ssh we@norns.local
142 | sudo modprobe fbtft_device custom name=fb_ssd1322 width=128 height=64 speed=16000000 gpios=reset:4,dc:17 rotate=180
143 |
144 | pi3
145 |
146 | con2fbmap 1 1
147 |
148 | pi4 - should show console as soon as you execute `modprobe`
149 |
150 |
151 | You can also use `lsmod` to check if the `fbtft_device` has loaded properly. Which should look something like:
152 |
153 | fb_ssd1322 16384 0
154 | fbtft_device 49152 0
155 | fbtft 45056 2 fbtft_device,fb_ssd1322
156 |
157 | `con2fbmap 1 0` will map the console back to HDMI (fb0) if you need that.
158 |
159 | Note - The OLED will continue to display whatever is on it until you reboot again.
160 |
161 | ## Norns
162 |
163 | For the Norns software install, first we need to install various packages that Norns uses.
164 |
165 | cd /home/we/fates/install/norns/scripts &&./fates_packages.sh
166 |
167 | Answer ***yes (y)*** to "enable realtime priority"
168 |
169 | Keep an eye out for any errors while installing packages here. If you get any errors, you could try this step again.
170 |
171 | When this finishes, you will be disconnected and the pi will reboot.
172 |
173 | When the pi has rebooted, reconnect via SSH and finish the Norns install.
174 |
175 | pi3/Buster
176 |
177 | cd /home/we/fates/install/norns/scripts &&./fates_install_pi3buster.sh
178 |
179 | pi4/Buster
180 |
181 | cd /home/we/fates/install/norns/scripts &&./fates_install_pi4.sh
182 |
183 | Answer yes (Y) to install prompts.
184 |
185 | The pi will reboot. When it restarts you should see "sparkles" and then the norns menu interface. The screen will probably say `error: SUPERCOLLIDER FAIL`. Ignore this for the moment as it should get fixed in the next step.
186 |
187 | ## Wifi network
188 |
189 | Reconnect via SSH
190 |
191 | ssh we@norns.local
192 | cd /home/we/fates/install/norns/scripts &&./fates_networkmanager.sh
193 |
194 | Answer yes (Y) to install prompts (if any).
195 |
196 | This installs network manager and changes your previous wpa_supplicant wifi setup. After the following steps, you'll likely get a new IP address.
197 |
198 | After reboot, you should see `NONE` at the top of the screen.
199 |
200 | Then use the norns menu to navigate to `SYSTEM > WIFI` and add your WiFi network manually. Then use the `ADD` option to choose your network and enter your password, etc.
201 |
202 | This is a bit of a hassle to do manually, but you only have to do it once and it should ensure your WIFI works properly from here on out.
203 |
204 | ## Audio configuration
205 |
206 | ssh we@norns.local
207 |
208 | amixer controls
209 | amixer cset numid=1 123 #Master Playback Volume
210 | amixer cset numid=3 29 #Capture Volume
211 | amixer cset numid=4 on #Line Capture Switch
212 | amixer cset numid=7 0 #Sidetone Playback Volume
213 | amixer cset numid=13 on #Output Mixer HiFi
214 | sudo alsactl store
215 |
216 | you can also view these settings with
217 |
218 | alsamixer
219 |
220 | ## Set your timezone
221 |
222 | sudo raspi-config
223 |
224 | (go to "Localization Options" menu item and select "Change Timezone")
225 | (then repeat with "Change WiFi Country")
226 |
227 |
228 | ## Norns documentation
229 |
230 | https://monome.org/docs/norns/
231 |
232 | Be sure to check out the section on the [web-based editor maiden](https://monome.org/docs/norns/#maiden).
233 |
234 | Maiden is extremely useful to get debug information if something is going wrong with the norns software. Its interface is arranged into a left sidebar FILE navigator and a right split editor, where the top is the EDITOR and the bottom is the REPL (read-eval-print-loop).
235 |
236 |
237 | ## Norns scripts
238 |
239 | You can find scripts/patches for norns on the [lines forum](https://llllllll.co/c/library)
240 |
241 | Scripts are installed at `~/dust/code` The easiest way to install is by using `git clone` from the linux command line as most of the scripts are hosted on github.
242 |
243 | for example
244 |
245 | ```
246 | cd ~/dust/code
247 | git clone https://github.com/justmat/foulplay.git
248 | ```
249 | will install the Foulplay script by @justmat
250 |
251 |
252 | ## Norns extras
253 |
254 | There are 2 extra scripts installed at in the `~/` home directory - `norns-restart.sh` and `norns-stopall.sh`. These can be used to restart all of the norns software components or stop all those processes (matron, crone/supercollider, JACK, and maiden).
255 |
256 |
257 | *These install instructions are based on the work of Tehn, Nordseele, Thetechnobear among others. Thank you!*
258 |
--------------------------------------------------------------------------------
/install/norns/files/device/device_monitor.c:
--------------------------------------------------------------------------------
1 | /*
2 | * device_monitor.c
3 | */
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | #include "device.h"
20 | #include "device_list.h"
21 | #include "device_hid.h"
22 | #include "device_monome.h"
23 | #include "device_crow.h"
24 | #include "events.h"
25 |
26 | #define SUB_NAME_SIZE 32
27 | #define NODE_NAME_SIZE 128
28 | #define WATCH_TIMEOUT_MS 100
29 |
30 | struct watch {
31 | // subsystem name to use as a filter on udev_monitor
32 | const char sub_name[NODE_NAME_SIZE];
33 | // glob pattern for checking the device node
34 | const char node_pattern[NODE_NAME_SIZE];
35 | // udev monitor
36 | struct udev_monitor *mon;
37 | };
38 |
39 | //-------------------------
40 | //----- static variables
41 |
42 | // watchers
43 | // FIXME: these names / paths are really arbitrary.
44 | static struct watch w[DEV_TYPE_COUNT] = {
45 | {
46 | .sub_name = "tty",
47 | .node_pattern = "/dev/ttyUSB*"
48 | },
49 | {
50 | .sub_name = "input",
51 | .node_pattern = "/dev/input/event*"
52 | },
53 | {
54 | .sub_name = "sound",
55 | .node_pattern = "/dev/snd/midiC*D*"
56 | },
57 | {
58 | .sub_name = "crow",
59 | .node_pattern = "/dev/ttyACM*"
60 | }
61 | };
62 |
63 | // file descriptors to watch/poll
64 | struct pollfd pfds[DEV_TYPE_COUNT];
65 | // thread for polling all the watched file descriptors
66 | pthread_t watch_tid;
67 |
68 | //--------------------------------
69 | //--- static function declarations
70 | static void* watch_loop(void *data);
71 | static void handle_device(struct udev_device *dev);
72 | static device_t check_dev_type(struct udev_device *dev);
73 | static const char* get_alsa_midi_node(struct udev_device *dev);
74 | static const char* get_device_name(struct udev_device *dev);
75 |
76 | //--------------------------------
77 | //---- extern function definitions
78 |
79 | void dev_monitor_init(void) {
80 | struct udev *udev = NULL;
81 | pthread_attr_t attr;
82 | int s;
83 |
84 | udev = udev_new();
85 | assert(udev);
86 |
87 | for(int i = 0; i < DEV_TYPE_COUNT; i++) {
88 | w[i].mon = udev_monitor_new_from_netlink(udev, "udev");
89 | if(w[i].mon == NULL) {
90 | fprintf(stderr,
91 | "failed to start udev_monitor for subsystem %s, pattern %s\n",
92 | w[i].sub_name,
93 | w[i].node_pattern);
94 | continue;
95 | }
96 | if (udev_monitor_filter_add_match_subsystem_devtype(w[i].mon,
97 | w[i].sub_name,
98 | NULL) < 0) {
99 | fprintf(stderr,
100 | "failed to add udev monitor filter for subsystem %s, pattern %s\n",
101 | w[i].sub_name,
102 | w[i].node_pattern);
103 | continue;
104 | }
105 | if (udev_monitor_enable_receiving(w[i].mon) < 0) {
106 | fprintf(stderr,
107 | "failed to enable monitor receiving for for subsystem %s, pattern %s\n",
108 | w[i].sub_name,
109 | w[i].node_pattern);
110 | continue;
111 | }
112 |
113 | pfds[i].fd = udev_monitor_get_fd(w[i].mon);
114 | pfds[i].events = POLLIN;
115 | } // end dev type loop
116 |
117 | s = pthread_attr_init(&attr);
118 | if (s) { fprintf(stderr, "error initializing thread attributes\n"); }
119 | s = pthread_create(&watch_tid, &attr, watch_loop, NULL);
120 | if (s) { fprintf(stderr, "error creating thread\n"); }
121 | pthread_attr_destroy(&attr);
122 | }
123 |
124 | void dev_monitor_deinit(void) {
125 | pthread_cancel(watch_tid);
126 | for (int i = 0; i < DEV_TYPE_COUNT; i++) {
127 | free(w[i].mon);
128 | }
129 | }
130 |
131 | int dev_monitor_scan(void) {
132 | struct udev *udev;
133 | struct udev_device *dev;
134 |
135 | udev = udev_new();
136 | if (udev == NULL) {
137 | fprintf(stderr, "device_monitor_scan(): failed to create udev\n");
138 | return 1;
139 | }
140 |
141 | for(int i = 0; i < DEV_TYPE_COUNT; i++) {
142 | struct udev_enumerate *ue;
143 | struct udev_list_entry *devices, *dev_list_entry;
144 |
145 | ue = udev_enumerate_new(udev);
146 | udev_enumerate_add_match_subsystem(ue, w[i].sub_name);
147 | udev_enumerate_scan_devices(ue);
148 |
149 | devices = udev_enumerate_get_list_entry(ue);
150 |
151 | udev_list_entry_foreach(dev_list_entry, devices) {
152 | const char *path;
153 |
154 | path = udev_list_entry_get_name(dev_list_entry);
155 | dev = udev_device_new_from_syspath(udev, path);
156 |
157 | if (dev != NULL) {
158 | if (udev_device_get_parent_with_subsystem_devtype(dev, "usb", NULL)) {
159 | handle_device(dev);
160 | }
161 | udev_device_unref(dev);
162 | }
163 | }
164 |
165 | udev_enumerate_unref(ue);
166 | }
167 | return 0;
168 | }
169 |
170 | //-------------------------------
171 | //--- static function definitions
172 |
173 | void* watch_loop(void *p) {
174 | (void) p;
175 | struct udev_device *dev;
176 |
177 | while (1) {
178 | if (poll(pfds, DEV_TYPE_COUNT, WATCH_TIMEOUT_MS) < 0) {
179 | switch (errno) {
180 | case EINVAL:
181 | perror("error in poll()");
182 | exit(1);
183 | case EINTR:
184 | case EAGAIN:
185 | continue;
186 | }
187 | }
188 |
189 | // see which monitor has data
190 | for (int i = 0; i < DEV_TYPE_COUNT; i++) {
191 | if (pfds[i].revents & POLLIN) {
192 | dev = udev_monitor_receive_device(w[i].mon);
193 | if (dev) {
194 | handle_device(dev);
195 | udev_device_unref(dev);
196 | } else {
197 | fprintf(stderr, "no device data from receive_device(). this is an error!\n");
198 | }
199 | }
200 | }
201 | }
202 | }
203 |
204 | void handle_device(struct udev_device *dev) {
205 | const char *action = udev_device_get_action(dev);
206 | const char *node = udev_device_get_devnode(dev);
207 | const char *subsys = udev_device_get_subsystem(dev);
208 |
209 | if (action == NULL) {
210 | // scan
211 | if (node != NULL) {
212 |
213 | device_t t = check_dev_type(dev);
214 |
215 | if (t >= 0 && t < DEV_TYPE_COUNT) {
216 | dev_list_add(t, node, get_device_name(dev));
217 | }
218 | }
219 | } else {
220 | // monitor
221 | if (strcmp(subsys, "sound") == 0) {
222 | // try to act according to
223 | // https://github.com/systemd/systemd/blob/master/rules/78-sound-card.rules
224 | if (strcmp(action, "change") == 0) {
225 | const char* alsa_node = get_alsa_midi_node(dev);
226 |
227 | if (alsa_node != NULL) {
228 | dev_list_add(DEV_TYPE_MIDI, alsa_node, get_device_name(dev));
229 | }
230 | } else if (strcmp(action, "remove") == 0) {
231 | if (node != NULL) {
232 | dev_list_remove(DEV_TYPE_MIDI, node);
233 | }
234 | }
235 | } else {
236 | device_t t = check_dev_type(dev);
237 |
238 | if (t >= 0 && t < DEV_TYPE_COUNT) {
239 | if (strcmp(action, "add") == 0) {
240 | dev_list_add(t, node, get_device_name(dev));
241 | } else if (strcmp(action, "remove") == 0) {
242 | dev_list_remove(t, node);
243 | }
244 | }
245 | }
246 | }
247 | }
248 |
249 | device_t check_dev_type(struct udev_device *dev) {
250 | device_t t = DEV_TYPE_INVALID;
251 | const char *node = udev_device_get_devnode(dev);
252 | const char *subsys = udev_device_get_subsystem(dev);
253 | //fprintf(stderr, "node: %s\n", node);
254 | //fprintf(stderr, "subsys: %s\n", subsys);
255 |
256 | const char *device_product = udev_device_get_property_value(dev, "ID_MODEL");
257 | fprintf(stderr, "product: %s\n", device_product);
258 |
259 | const char *device_vendor = udev_device_get_property_value(dev, "ID_VENDOR");
260 | fprintf(stderr, "vendor: %s\n", device_vendor);
261 |
262 | const char *device_serial = udev_device_get_property_value(dev, "ID_SERIAL_SHORT");
263 | fprintf(stderr, "serial: %s\n", device_serial);
264 |
265 |
266 | if (node) {
267 | // for now, just get USB devices.
268 | // eventually we might want to use this same system for GPIO, &c...
269 | if (udev_device_get_parent_with_subsystem_devtype(dev, "usb", NULL)) {
270 |
271 | // if TTY check product info
272 | if (strcmp(subsys, "tty") == 0) {
273 | if (strcmp(device_vendor, "monome") == 0) {
274 | t = DEV_TYPE_MONOME;
275 | } else if (strcmp(device_product, "crow:_telephone_line") == 0 && strcmp(device_vendor, "monome___whimsical_raps") == 0){
276 | t = DEV_TYPE_CROW;
277 | }
278 | } else if (strcmp(subsys, "input") == 0) { // if HID
279 | t = DEV_TYPE_HID;
280 | } else if (strcmp(subsys, "sound") == 0) { // if MIDI
281 | t = DEV_TYPE_MIDI;
282 | }
283 | /*
284 | for (int i = 0; i < DEV_TYPE_COUNT; i++) {
285 | //if (fnmatch(w[i].node_pattern, node, 0) == 0) {
286 | if (fnmatch(w[i].sub_name, subsys, 0) == 0) {
287 | t = i;
288 | break;
289 | }
290 | }
291 | */
292 | }
293 | }
294 | return t;
295 | }
296 |
297 | // try to get midi device node from udev_device
298 | const char* get_alsa_midi_node(struct udev_device *dev) {
299 | const char *subsys;
300 | const char *syspath;
301 | DIR *sysdir;
302 | struct dirent *sysdir_ent;
303 | int alsa_card, alsa_dev;
304 | char *result = NULL;
305 |
306 | subsys = udev_device_get_subsystem(dev);
307 |
308 | if (strcmp(subsys, "sound") == 0) {
309 | syspath = udev_device_get_syspath(dev);
310 | sysdir = opendir(syspath);
311 |
312 | while ((sysdir_ent = readdir(sysdir)) != NULL) {
313 | if (sscanf(sysdir_ent->d_name, "midiC%uD%u", &alsa_card, &alsa_dev) == 2) {
314 | if (asprintf(&result, "/dev/snd/%s", sysdir_ent->d_name) < 0) {
315 | fprintf(stderr, "failed to create alsa device path for %s\n", sysdir_ent->d_name);
316 | return NULL;
317 | }
318 | }
319 | }
320 | }
321 |
322 | return result;
323 | }
324 |
325 | // try to get product name from udev_device or its parents
326 | const char* get_device_name(struct udev_device *dev) {
327 | char *current_name = NULL;
328 | struct udev_device *current_dev = dev;
329 |
330 | while (current_name == NULL) {
331 | current_name = (char *) udev_device_get_sysattr_value(current_dev, "product");
332 | current_dev = udev_device_get_parent(current_dev);
333 |
334 | if (current_dev == NULL) {
335 | break;
336 | }
337 | }
338 |
339 | return strdup(current_name);
340 | }
341 |
--------------------------------------------------------------------------------
/install/norns/files/device/device_monitor-201029.c:
--------------------------------------------------------------------------------
1 | /*
2 | * device_monitor.c
3 | */
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | #include "device.h"
20 | #include "device_crow.h"
21 | #include "device_hid.h"
22 | #include "device_list.h"
23 | #include "device_monome.h"
24 | #include "events.h"
25 |
26 | #define SUB_NAME_SIZE 32
27 | #define NODE_NAME_SIZE 128
28 | #define WATCH_TIMEOUT_MS 100
29 |
30 | struct watch {
31 | // subsystem name to use as a filter on udev_monitor
32 | const char sub_name[NODE_NAME_SIZE];
33 | // glob pattern for checking the device node
34 | const char node_pattern[NODE_NAME_SIZE];
35 | // udev monitor
36 | struct udev_monitor *mon;
37 | };
38 |
39 | //-------------------------
40 | //----- static variables
41 |
42 | // watchers
43 | // FIXME: these names / paths are really arbitrary.
44 | static struct watch w[DEV_TYPE_COUNT_PHYSICAL] = {{.sub_name = "tty", .node_pattern = "/dev/ttyUSB*"},
45 | {.sub_name = "input", .node_pattern = "/dev/input/event*"},
46 | {.sub_name = "sound", .node_pattern = "/dev/snd/midiC*D*"},
47 | {.sub_name = "crow", .node_pattern = "/dev/ttyACM*"}};
48 |
49 | // file descriptors to watch/poll
50 | struct pollfd pfds[DEV_TYPE_COUNT_PHYSICAL];
51 | // thread for polling all the watched file descriptors
52 | pthread_t watch_tid;
53 |
54 | //--------------------------------
55 | //--- static function declarations
56 | static void *watch_loop(void *data);
57 | static void handle_device(struct udev_device *dev);
58 | static device_t check_dev_type(struct udev_device *dev);
59 | static const char *get_alsa_midi_node(struct udev_device *dev);
60 | static const char *get_device_name(struct udev_device *dev);
61 |
62 | //--------------------------------
63 | //---- extern function definitions
64 |
65 | void dev_monitor_init(void) {
66 | struct udev *udev = NULL;
67 | pthread_attr_t attr;
68 | int s;
69 |
70 | udev = udev_new();
71 | assert(udev);
72 |
73 | for (int i = 0; i < DEV_TYPE_COUNT_PHYSICAL; i++) {
74 | w[i].mon = udev_monitor_new_from_netlink(udev, "udev");
75 | if (w[i].mon == NULL) {
76 | fprintf(stderr, "failed to start udev_monitor for subsystem %s, pattern %s\n", w[i].sub_name,
77 | w[i].node_pattern);
78 | continue;
79 | }
80 | if (udev_monitor_filter_add_match_subsystem_devtype(w[i].mon, w[i].sub_name, NULL) < 0) {
81 | fprintf(stderr, "failed to add udev monitor filter for subsystem %s, pattern %s\n", w[i].sub_name,
82 | w[i].node_pattern);
83 | continue;
84 | }
85 | if (udev_monitor_enable_receiving(w[i].mon) < 0) {
86 | fprintf(stderr, "failed to enable monitor receiving for for subsystem %s, pattern %s\n", w[i].sub_name,
87 | w[i].node_pattern);
88 | continue;
89 | }
90 |
91 | pfds[i].fd = udev_monitor_get_fd(w[i].mon);
92 | pfds[i].events = POLLIN;
93 | } // end dev type loop
94 |
95 | s = pthread_attr_init(&attr);
96 | if (s) {
97 | fprintf(stderr, "error initializing thread attributes\n");
98 | }
99 | s = pthread_create(&watch_tid, &attr, watch_loop, NULL);
100 | if (s) {
101 | fprintf(stderr, "error creating thread\n");
102 | }
103 | pthread_attr_destroy(&attr);
104 | }
105 |
106 | void dev_monitor_deinit(void) {
107 | pthread_cancel(watch_tid);
108 | for (int i = 0; i < DEV_TYPE_COUNT_PHYSICAL; i++) {
109 | free(w[i].mon);
110 | }
111 | }
112 |
113 | int dev_monitor_scan(void) {
114 | struct udev *udev;
115 | struct udev_device *dev;
116 |
117 | udev = udev_new();
118 | if (udev == NULL) {
119 | fprintf(stderr, "device_monitor_scan(): failed to create udev\n");
120 | return 1;
121 | }
122 |
123 | for (int i = 0; i < DEV_TYPE_COUNT_PHYSICAL; i++) {
124 | struct udev_enumerate *ue;
125 | struct udev_list_entry *devices, *dev_list_entry;
126 |
127 | ue = udev_enumerate_new(udev);
128 | udev_enumerate_add_match_subsystem(ue, w[i].sub_name);
129 | udev_enumerate_scan_devices(ue);
130 |
131 | devices = udev_enumerate_get_list_entry(ue);
132 |
133 | udev_list_entry_foreach(dev_list_entry, devices) {
134 | const char *path;
135 |
136 | path = udev_list_entry_get_name(dev_list_entry);
137 | dev = udev_device_new_from_syspath(udev, path);
138 |
139 | if (dev != NULL) {
140 | if (udev_device_get_parent_with_subsystem_devtype(dev, "usb", NULL)) {
141 | handle_device(dev);
142 | }
143 | udev_device_unref(dev);
144 | }
145 | }
146 |
147 | udev_enumerate_unref(ue);
148 | }
149 | return 0;
150 | }
151 |
152 | //-------------------------------
153 | //--- static function definitions
154 |
155 | void *watch_loop(void *p) {
156 | (void)p;
157 | struct udev_device *dev;
158 |
159 | while (1) {
160 | if (poll(pfds, DEV_TYPE_COUNT_PHYSICAL, WATCH_TIMEOUT_MS) < 0) {
161 | switch (errno) {
162 | case EINVAL:
163 | perror("error in poll()");
164 | exit(1);
165 | case EINTR:
166 | case EAGAIN:
167 | continue;
168 | }
169 | }
170 |
171 | // see which monitor has data
172 | for (int i = 0; i < DEV_TYPE_COUNT_PHYSICAL; i++) {
173 | if (pfds[i].revents & POLLIN) {
174 | dev = udev_monitor_receive_device(w[i].mon);
175 | if (dev) {
176 | handle_device(dev);
177 | udev_device_unref(dev);
178 | } else {
179 | fprintf(stderr, "no device data from receive_device(). this is an error!\n");
180 | }
181 | }
182 | }
183 | }
184 | }
185 |
186 | void handle_device(struct udev_device *dev) {
187 | const char *action = udev_device_get_action(dev);
188 | const char *node = udev_device_get_devnode(dev);
189 | const char *subsys = udev_device_get_subsystem(dev);
190 |
191 | if (action == NULL) {
192 | // scan
193 | if (node != NULL) {
194 | device_t t = check_dev_type(dev);
195 |
196 | if (t >= 0 && t < DEV_TYPE_COUNT_PHYSICAL) {
197 | dev_list_add(t, node, get_device_name(dev));
198 | }
199 | }
200 | } else {
201 | // monitor
202 | if (strcmp(subsys, "sound") == 0) {
203 | // try to act according to
204 | // https://github.com/systemd/systemd/blob/master/rules/78-sound-card.rules
205 | if (strcmp(action, "change") == 0) {
206 | const char *alsa_node = get_alsa_midi_node(dev);
207 |
208 | if (alsa_node != NULL) {
209 | dev_list_add(DEV_TYPE_MIDI, alsa_node, get_device_name(dev));
210 | }
211 | } else if (strcmp(action, "remove") == 0) {
212 | if (node != NULL) {
213 | dev_list_remove(DEV_TYPE_MIDI, node);
214 | }
215 | }
216 | } else {
217 | device_t t = check_dev_type(dev);
218 |
219 | if (t >= 0 && t < DEV_TYPE_COUNT_PHYSICAL) {
220 | if (strcmp(action, "add") == 0) {
221 | dev_list_add(t, node, get_device_name(dev));
222 | } else if (strcmp(action, "remove") == 0) {
223 | dev_list_remove(t, node);
224 | }
225 | }
226 | }
227 | }
228 | }
229 |
230 | device_t check_dev_type(struct udev_device *dev) {
231 | device_t t = DEV_TYPE_INVALID;
232 | const char *node = udev_device_get_devnode(dev);
233 | const char *subsys = udev_device_get_subsystem(dev);
234 |
235 | const char *device_product = udev_device_get_property_value(dev, "ID_MODEL");
236 | fprintf(stderr, "product: %s\n", device_product);
237 |
238 | const char *device_vendor = udev_device_get_property_value(dev, "ID_VENDOR");
239 | fprintf(stderr, "vendor: %s\n", device_vendor);
240 |
241 | const char *device_serial = udev_device_get_property_value(dev, "ID_SERIAL_SHORT");
242 | fprintf(stderr, "serial: %s\n", device_serial);
243 |
244 | if (node) {
245 | // for now, just get USB devices.
246 | // eventually we might want to use this same system for GPIO, &c...
247 | if (udev_device_get_parent_with_subsystem_devtype(dev, "usb", NULL)) {
248 |
249 | // if TTY check product info
250 | if (strcmp(subsys, "tty") == 0) {
251 | if (strcmp(device_vendor, "monome") == 0) {
252 | t = DEV_TYPE_MONOME;
253 | } else if (strcmp(device_product, "crow:_telephone_line") == 0 && strcmp(device_vendor, "monome___whimsical_raps") == 0){
254 | t = DEV_TYPE_CROW;
255 | }
256 | } else if (strcmp(subsys, "input") == 0) { // if HID
257 | t = DEV_TYPE_HID;
258 | } else if (strcmp(subsys, "sound") == 0) { // if MIDI
259 | t = DEV_TYPE_MIDI;
260 | }
261 | /*
262 | // old version
263 | for (int i = 0; i < DEV_TYPE_COUNT_PHYSICAL; i++) {
264 | //if (fnmatch(w[i].node_pattern, node, 0) == 0) {
265 | if (fnmatch(w[i].sub_name, subsys, 0) == 0) {
266 | t = i;
267 | break;
268 | }
269 | }
270 | // new version
271 | for (int i = 0; i < DEV_TYPE_COUNT_PHYSICAL; i++) {
272 | const char *node_pattern = w[i].node_pattern;
273 | if (node_pattern[0] && fnmatch(node_pattern, node, 0) == 0) {
274 | t = i;
275 | break;
276 | }
277 | }
278 | */
279 | }
280 | }
281 | return t;
282 | }
283 |
284 | // try to get midi device node from udev_device
285 | const char *get_alsa_midi_node(struct udev_device *dev) {
286 | const char *subsys;
287 | const char *syspath;
288 | DIR *sysdir;
289 | struct dirent *sysdir_ent;
290 | int alsa_card, alsa_dev;
291 | char *result = NULL;
292 |
293 | subsys = udev_device_get_subsystem(dev);
294 |
295 | if (strcmp(subsys, "sound") == 0) {
296 | syspath = udev_device_get_syspath(dev);
297 | sysdir = opendir(syspath);
298 |
299 | while ((sysdir_ent = readdir(sysdir)) != NULL) {
300 | if (sscanf(sysdir_ent->d_name, "midiC%uD%u", &alsa_card, &alsa_dev) == 2) {
301 | if (asprintf(&result, "/dev/snd/%s", sysdir_ent->d_name) < 0) {
302 | fprintf(stderr, "failed to create alsa device path for %s\n", sysdir_ent->d_name);
303 | return NULL;
304 | }
305 | }
306 | }
307 | }
308 |
309 | return result;
310 | }
311 |
312 | // try to get product name from udev_device or its parents
313 | const char *get_device_name(struct udev_device *dev) {
314 | char *current_name = NULL;
315 | struct udev_device *current_dev = dev;
316 |
317 | while (current_name == NULL) {
318 | current_name = (char *)udev_device_get_sysattr_value(current_dev, "product");
319 | current_dev = udev_device_get_parent(current_dev);
320 |
321 | if (current_dev == NULL) {
322 | break;
323 | }
324 | }
325 |
326 | return strdup(current_name);
327 | }
328 |
--------------------------------------------------------------------------------
/install/norns/files/alsa.conf:
--------------------------------------------------------------------------------
1 | #
2 | # ALSA library configuration file
3 | #
4 |
5 | # pre-load the configuration files
6 |
7 | @hooks [
8 | {
9 | func load
10 | files [
11 | {
12 | @func concat
13 | strings [
14 | { @func datadir }
15 | "/alsa.conf.d/"
16 | ]
17 | }
18 | "/etc/asound.conf"
19 | "~/.asoundrc"
20 | ]
21 | errors false
22 | }
23 | ]
24 |
25 | # load card-specific configuration files (on request)
26 |
27 | cards.@hooks [
28 | {
29 | func load
30 | files [
31 | {
32 | @func concat
33 | strings [
34 | { @func datadir }
35 | "/cards/aliases.conf"
36 | ]
37 | }
38 | ]
39 | }
40 | {
41 | func load_for_all_cards
42 | files [
43 | {
44 | @func concat
45 | strings [
46 | { @func datadir }
47 | "/cards/"
48 | { @func private_string }
49 | ".conf"
50 | ]
51 | }
52 | ]
53 | errors false
54 | }
55 | ]
56 |
57 | #
58 | # defaults
59 | #
60 |
61 | # show all name hints also for definitions without hint {} section
62 | defaults.namehint.showall on
63 | # show just basic name hints
64 | defaults.namehint.basic on
65 | # show extended name hints
66 | defaults.namehint.extended on
67 | #
68 | defaults.ctl.card 0
69 | defaults.pcm.card 0
70 | defaults.pcm.device 0
71 | defaults.pcm.subdevice -1
72 | defaults.pcm.nonblock 1
73 | defaults.pcm.compat 0
74 | defaults.pcm.minperiodtime 5000 # in us
75 | defaults.pcm.ipc_key 5678293
76 | defaults.pcm.ipc_gid audio
77 | defaults.pcm.ipc_perm 0660
78 | defaults.pcm.dmix.max_periods 0
79 | defaults.pcm.dmix.rate 48000
80 | defaults.pcm.dmix.format "unchanged"
81 | defaults.pcm.dmix.card defaults.pcm.card
82 | defaults.pcm.dmix.device defaults.pcm.device
83 | defaults.pcm.dsnoop.card defaults.pcm.card
84 | defaults.pcm.dsnoop.device defaults.pcm.device
85 | defaults.pcm.front.card defaults.pcm.card
86 | defaults.pcm.front.device defaults.pcm.device
87 | defaults.pcm.rear.card defaults.pcm.card
88 | defaults.pcm.rear.device defaults.pcm.device
89 | defaults.pcm.center_lfe.card defaults.pcm.card
90 | defaults.pcm.center_lfe.device defaults.pcm.device
91 | defaults.pcm.side.card defaults.pcm.card
92 | defaults.pcm.side.device defaults.pcm.device
93 | defaults.pcm.surround21.card defaults.pcm.card
94 | defaults.pcm.surround21.device defaults.pcm.device
95 | defaults.pcm.surround40.card defaults.pcm.card
96 | defaults.pcm.surround40.device defaults.pcm.device
97 | defaults.pcm.surround41.card defaults.pcm.card
98 | defaults.pcm.surround41.device defaults.pcm.device
99 | defaults.pcm.surround50.card defaults.pcm.card
100 | defaults.pcm.surround50.device defaults.pcm.device
101 | defaults.pcm.surround51.card defaults.pcm.card
102 | defaults.pcm.surround51.device defaults.pcm.device
103 | defaults.pcm.surround71.card defaults.pcm.card
104 | defaults.pcm.surround71.device defaults.pcm.device
105 | defaults.pcm.iec958.card defaults.pcm.card
106 | defaults.pcm.iec958.device defaults.pcm.device
107 | defaults.pcm.modem.card defaults.pcm.card
108 | defaults.pcm.modem.device defaults.pcm.device
109 | # truncate files via file or tee PCM
110 | defaults.pcm.file_format "raw"
111 | defaults.pcm.file_truncate true
112 | defaults.rawmidi.card 0
113 | defaults.rawmidi.device 0
114 | defaults.rawmidi.subdevice -1
115 | defaults.hwdep.card 0
116 | defaults.hwdep.device 0
117 | defaults.timer.class 2
118 | defaults.timer.sclass 0
119 | defaults.timer.card 0
120 | defaults.timer.device 0
121 | defaults.timer.subdevice 0
122 |
123 | #
124 | # PCM interface
125 | #
126 |
127 | # redirect to load-on-demand extended pcm definitions
128 | pcm.cards cards.pcm
129 |
130 | pcm.default cards.pcm.default
131 | pcm.sysdefault cards.pcm.default
132 | #pcm.front cards.pcm.front
133 | #pcm.rear cards.pcm.rear
134 | #pcm.center_lfe cards.pcm.center_lfe
135 | #pcm.side cards.pcm.side
136 | #pcm.surround21 cards.pcm.surround21
137 | #pcm.surround40 cards.pcm.surround40
138 | #pcm.surround41 cards.pcm.surround41
139 | #pcm.surround50 cards.pcm.surround50
140 | #pcm.surround51 cards.pcm.surround51
141 | #pcm.surround71 cards.pcm.surround71
142 | #pcm.iec958 cards.pcm.iec958
143 | #pcm.spdif iec958
144 | #pcm.hdmi cards.pcm.hdmi
145 | pcm.dmix cards.pcm.dmix
146 | #pcm.dsnoop cards.pcm.dsnoop
147 | #pcm.modem cards.pcm.modem
148 | #pcm.phoneline cards.pcm.phoneline
149 |
150 | pcm.hw {
151 | @args [ CARD DEV SUBDEV ]
152 | @args.CARD {
153 | type string
154 | default {
155 | @func getenv
156 | vars [
157 | ALSA_PCM_CARD
158 | ALSA_CARD
159 | ]
160 | default {
161 | @func refer
162 | name defaults.pcm.card
163 | }
164 | }
165 | }
166 | @args.DEV {
167 | type integer
168 | default {
169 | @func igetenv
170 | vars [
171 | ALSA_PCM_DEVICE
172 | ]
173 | default {
174 | @func refer
175 | name defaults.pcm.device
176 | }
177 | }
178 | }
179 | @args.SUBDEV {
180 | type integer
181 | default {
182 | @func refer
183 | name defaults.pcm.subdevice
184 | }
185 | }
186 | type hw
187 | card $CARD
188 | device $DEV
189 | subdevice $SUBDEV
190 | hint {
191 | show {
192 | @func refer
193 | name defaults.namehint.extended
194 | }
195 | description "Direct hardware device without any conversions"
196 | }
197 | }
198 |
199 | pcm.plughw {
200 | @args [ CARD DEV SUBDEV ]
201 | @args.CARD {
202 | type string
203 | default {
204 | @func getenv
205 | vars [
206 | ALSA_PCM_CARD
207 | ALSA_CARD
208 | ]
209 | default {
210 | @func refer
211 | name defaults.pcm.card
212 | }
213 | }
214 | }
215 | @args.DEV {
216 | type integer
217 | default {
218 | @func igetenv
219 | vars [
220 | ALSA_PCM_DEVICE
221 | ]
222 | default {
223 | @func refer
224 | name defaults.pcm.device
225 | }
226 | }
227 | }
228 | @args.SUBDEV {
229 | type integer
230 | default {
231 | @func refer
232 | name defaults.pcm.subdevice
233 | }
234 | }
235 | type plug
236 | slave.pcm {
237 | type hw
238 | card $CARD
239 | device $DEV
240 | subdevice $SUBDEV
241 | }
242 | hint {
243 | show {
244 | @func refer
245 | name defaults.namehint.extended
246 | }
247 | description "Hardware device with all software conversions"
248 | }
249 | }
250 |
251 | pcm.plug {
252 | @args [ SLAVE ]
253 | @args.SLAVE {
254 | type string
255 | }
256 | type plug
257 | slave.pcm $SLAVE
258 | }
259 |
260 | pcm.shm {
261 | @args [ SOCKET PCM ]
262 | @args.SOCKET {
263 | type string
264 | }
265 | @args.PCM {
266 | type string
267 | }
268 | type shm
269 | server $SOCKET
270 | pcm $PCM
271 | }
272 |
273 | pcm.tee {
274 | @args [ SLAVE FILE FORMAT ]
275 | @args.SLAVE {
276 | type string
277 | }
278 | @args.FILE {
279 | type string
280 | }
281 | @args.FORMAT {
282 | type string
283 | default {
284 | @func refer
285 | name defaults.pcm.file_format
286 | }
287 | }
288 | type file
289 | slave.pcm $SLAVE
290 | file $FILE
291 | format $FORMAT
292 | truncate {
293 | @func refer
294 | name defaults.pcm.file_truncate
295 | }
296 | }
297 |
298 | pcm.file {
299 | @args [ FILE FORMAT ]
300 | @args.FILE {
301 | type string
302 | }
303 | @args.FORMAT {
304 | type string
305 | default {
306 | @func refer
307 | name defaults.pcm.file_format
308 | }
309 | }
310 | type file
311 | slave.pcm null
312 | file $FILE
313 | format $FORMAT
314 | truncate {
315 | @func refer
316 | name defaults.pcm.file_truncate
317 | }
318 | }
319 |
320 | pcm.null {
321 | type null
322 | hint {
323 | show {
324 | @func refer
325 | name defaults.namehint.basic
326 | }
327 | description "Discard all samples (playback) or generate zero samples (capture)"
328 | }
329 | }
330 |
331 | #
332 | # Control interface
333 | #
334 |
335 | ctl.sysdefault {
336 | type hw
337 | card {
338 | @func getenv
339 | vars [
340 | ALSA_CTL_CARD
341 | ALSA_CARD
342 | ]
343 | default {
344 | @func refer
345 | name defaults.ctl.card
346 | }
347 | }
348 | hint.description "Default control device"
349 | }
350 | ctl.default ctl.sysdefault
351 |
352 | ctl.hw {
353 | @args [ CARD ]
354 | @args.CARD {
355 | type string
356 | default {
357 | @func getenv
358 | vars [
359 | ALSA_CTL_CARD
360 | ALSA_CARD
361 | ]
362 | default {
363 | @func refer
364 | name defaults.ctl.card
365 | }
366 | }
367 | }
368 | type hw
369 | card $CARD
370 | hint.description "Direct control device"
371 | }
372 |
373 | ctl.shm {
374 | @args [ SOCKET CTL ]
375 | @args.SOCKET {
376 | type string
377 | }
378 | @args.CTL {
379 | type string
380 | }
381 | type shm
382 | server $SOCKET
383 | ctl $CTL
384 | }
385 |
386 | #
387 | # RawMidi interface
388 | #
389 |
390 | rawmidi.default {
391 | type hw
392 | card {
393 | @func getenv
394 | vars [
395 | ALSA_RAWMIDI_CARD
396 | ALSA_CARD
397 | ]
398 | default {
399 | @func refer
400 | name defaults.rawmidi.card
401 | }
402 | }
403 | device {
404 | @func igetenv
405 | vars [
406 | ALSA_RAWMIDI_DEVICE
407 | ]
408 | default {
409 | @func refer
410 | name defaults.rawmidi.device
411 | }
412 | }
413 | hint.description "Default raw MIDI device"
414 | }
415 |
416 | rawmidi.hw {
417 | @args [ CARD DEV SUBDEV ]
418 | @args.CARD {
419 | type string
420 | default {
421 | @func getenv
422 | vars [
423 | ALSA_RAWMIDI_CARD
424 | ALSA_CARD
425 | ]
426 | default {
427 | @func refer
428 | name defaults.rawmidi.card
429 | }
430 | }
431 | }
432 | @args.DEV {
433 | type integer
434 | default {
435 | @func igetenv
436 | vars [
437 | ALSA_RAWMIDI_DEVICE
438 | ]
439 | default {
440 | @func refer
441 | name defaults.rawmidi.device
442 | }
443 | }
444 | }
445 | @args.SUBDEV {
446 | type integer
447 | default -1
448 | }
449 | type hw
450 | card $CARD
451 | device $DEV
452 | subdevice $SUBDEV
453 | hint {
454 | description "Direct rawmidi driver device"
455 | device $DEV
456 | }
457 | }
458 |
459 | rawmidi.virtual {
460 | @args [ MERGE ]
461 | @args.MERGE {
462 | type string
463 | default 1
464 | }
465 | type virtual
466 | merge $MERGE
467 | }
468 |
469 | #
470 | # Sequencer interface
471 | #
472 |
473 | seq.default {
474 | type hw
475 | hint.description "Default sequencer device"
476 | }
477 |
478 | seq.hw {
479 | type hw
480 | }
481 |
482 | #
483 | # HwDep interface
484 | #
485 |
486 | hwdep.default {
487 | type hw
488 | card {
489 | @func getenv
490 | vars [
491 | ALSA_HWDEP_CARD
492 | ALSA_CARD
493 | ]
494 | default {
495 | @func refer
496 | name defaults.hwdep.card
497 | }
498 | }
499 | device {
500 | @func igetenv
501 | vars [
502 | ALSA_HWDEP_DEVICE
503 | ]
504 | default {
505 | @func refer
506 | name defaults.hwdep.device
507 | }
508 | }
509 | hint.description "Default hardware dependent device"
510 | }
511 |
512 | hwdep.hw {
513 | @args [ CARD DEV ]
514 | @args.CARD {
515 | type string
516 | default {
517 | @func getenv
518 | vars [
519 | ALSA_HWDEP_CARD
520 | ALSA_CARD
521 | ]
522 | default {
523 | @func refer
524 | name defaults.hwdep.card
525 | }
526 | }
527 | }
528 | @args.DEV {
529 | type integer
530 | default {
531 | @func igetenv
532 | vars [
533 | ALSA_HWDEP_DEVICE
534 | ]
535 | default {
536 | @func refer
537 | name defaults.hwdep.device
538 | }
539 | }
540 | }
541 | type hw
542 | card $CARD
543 | device $DEV
544 | hint {
545 | description "Direct hardware dependent device"
546 | device $DEV
547 | }
548 | }
549 |
550 | #
551 | # Timer interface
552 | #
553 |
554 | timer_query.default {
555 | type hw
556 | }
557 |
558 | timer_query.hw {
559 | type hw
560 | }
561 |
562 | timer.default {
563 | type hw
564 | class {
565 | @func refer
566 | name defaults.timer.class
567 | }
568 | sclass {
569 | @func refer
570 | name defaults.timer.sclass
571 | }
572 | card {
573 | @func refer
574 | name defaults.timer.card
575 | }
576 | device {
577 | @func refer
578 | name defaults.timer.device
579 | }
580 | subdevice {
581 | @func refer
582 | name defaults.timer.subdevice
583 | }
584 | hint.description "Default timer device"
585 | }
586 |
587 | timer.hw {
588 | @args [ CLASS SCLASS CARD DEV SUBDEV ]
589 | @args.CLASS {
590 | type integer
591 | default {
592 | @func refer
593 | name defaults.timer.class
594 | }
595 | }
596 | @args.SCLASS {
597 | type integer
598 | default {
599 | @func refer
600 | name defaults.timer.sclass
601 | }
602 | }
603 | @args.CARD {
604 | type string
605 | default {
606 | @func refer
607 | name defaults.timer.card
608 | }
609 | }
610 | @args.DEV {
611 | type integer
612 | default {
613 | @func refer
614 | name defaults.timer.device
615 | }
616 | }
617 | @args.SUBDEV {
618 | type integer
619 | default {
620 | @func refer
621 | name defaults.timer.subdevice
622 | }
623 | }
624 | type hw
625 | class $CLASS
626 | sclass $SCLASS
627 | card $CARD
628 | device $DEV
629 | subdevice $SUBDEV
630 | hint {
631 | description "Direct timer device"
632 | device $DEV
633 | }
634 | }
635 |
--------------------------------------------------------------------------------