Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
- rearranged init scripts, adding some more.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed May 23, 2013
1 parent ea481cf commit 4f08e6e
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 18 deletions.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file added ajampbrownie
Empty file.
Empty file modified ampbrownie.gx
100644 → 100755
Empty file.
Empty file modified gx_head_rc
100644 → 100755
Empty file.
27 changes: 27 additions & 0 deletions init_scripts/ampbrownie
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/sh
# /etc/init.d/ampbrownie
#


# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script blah "
echo "Could do more here"
;;
stop)
echo "Stopping script blah"
echo "Could do more here"
;;
*)
echo "Usage: /etc/init.d/blah {start|stop}"
exit 1
;;
esac

start(){
/home/pi/ampbrownie/jackstart
guitarix -N
}

exit
19 changes: 19 additions & 0 deletions init_scripts/jackstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
sudo service ntp stop
sudo service triggerhappy stop
sudo service dbus stop
sudo killall console-kit-daemon
sudo killall polkitd
## Only needed when Jack2 is compiled with D-Bus support
#export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
sudo mount -o remount,size=128M /dev/shm
killall gvfsd
killall dbus-daemon
killall dbus-launch
## Uncomment if you'd like to disable the network adapter completely
#echo -n "1-1.1:1.0" | sudo tee /sys/bus/usb/drivers/smsc95xx/unbind
echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
jackd -P70 -p16 -t2000 -d alsa -dhw:CODEC -X seq -p 128 -n 3 -r 44100 -s &
#load ajsnapshot setup
#ajsnapshot -r ajampbrownie
exit
36 changes: 18 additions & 18 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ then
iface lo inet loopback
#disable dhcp
#iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Expand Down Expand Up @@ -73,38 +70,41 @@ then
#sudo DEBCONF_FRONTEND=noninteractive apt-get --no-install-recommends install jackd1
read -p "When asked to optimize for realtime, answer yes. Press enter to continue."
sudo apt-get --no-install-recommends -y install jackd1
sudo modprobe -r snd-bcm2835
sudo apt-get --no-install-recommends -y install libcanberra-gtk-module
sudo apt-get --no-install-recommends -y install jalv
sudo apt-get --no-install-recommends -y install guitarix
sudo apt-get --no-install-recommends -y install qjackctl
sudo apt-get --no-install-recommends -y install aj-snapshot
# a good jack startup script
wget -4 https://raw.github.com/AutoStatic/scripts/rpi/rpi/jackstart


### Prep for realtime audio ###
echo "increasing shared memory..."
sudo mount -o remount,size=128M /dev/shm
#todo, put in jackd startup script

echo "turning off CPU scaling"
echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# is this redundant?
sudo modprobe -r snd-bcm2835

echo "disabling onboard sound card..."
echo "disabling onboard sound card..."
# -ie is for in stream editing
sudo sed -ie 's/snd\-bcm2835/#snd\-bcm2835/g' /etc/modules

echo "setting default sound card to usb..."

sudo sed -ie 's/snd\-usb\-audio\ index\=\-2/snd\-usb\-audio\ index\=0/g' /etc/modprobe.d/alsa-base.conf
sudo alsa force-reload

echo "forcing usb 1.1 and turning off turbo mode on eth..."
# has to prepend to front of file
sudo sed -i '1s/^/dwc_otg\.speed\=1\ smsc95xx\.turbo_mode\=N\ /' /boot/cmdline.txt

echo "this script has finished. Reboot, then you can run jackstart, and then jalv... "
# copy the guitarrix configs and settings to the right place
mkdir .config
mkdir .config/guitarix
cp ampbrownie/gx_head_rc .config/guitarix/gx_head_rc
cp ampbrownie/ampbrownie.gx .config/guitarix/plugins/

# install init scripts so AmpBrownie starts up on boot
cp ~/ampbrownie/init_scripts/ampbrownie.sh /etc/init.d/ampbrownie.sh
sudo chmod /etc/init.d/ampbrownie.sh
sudo update-rc.d ampbrownie.sh defaults

echo "Setup has finished. You will want to:
- reboot and remove your keyboard an mouse
- have your guitar/soundcard/midi controller hooked up
- play some sweet tunes"

else
echo "Input not recognized, try again."
Expand Down

0 comments on commit 4f08e6e

Please sign in to comment.