raspberry pi setup, ssh, pure data, alsa cards, controllers, auto login, load patch from startup

COPY IMAGE ONTO SD CARD ON A MAC*

1. insert your SD card (mac) and rename it rpi
2. download and unzip:  downloads.raspberrypi.org/images/debian/7/2012-08-08-wheezy-armel/2012-08-08-wheezy-armel.zip.torrent

3. From the terminal run df -h

4. find the disk “/dev/disk3s1″ that’s mounted on rpi
5.    Unmount the partition so that you will be allowed to overwrite the disk:
sudo diskutil unmount /dev/disk3s1

6. Using the device name of the partition work out the raw device name for the entire disk, by omitting the final “s1″ and replacing “disk” with “rdisk” (this is very important: you will lose all data on the hard drive on your computer if you get the wrong device name). Make sure the device name is the name of the whole SD card as described above, not just a partition of it (for example, rdisk3, not rdisk3s1. Similarly you might have another SD drive name/number like rdisk2 or rdisk4, etc. — recheck by using the df -h command both before & after you insert your SD card reader into your Mac if you have any doubts!):
◦    e.g. /dev/disk3s1 => /dev/rdisk3
7. In the terminal write the image to the card with this command, using the raw disk device name from above (read carefully the above step, to be sure you use the correct rdisk# here!):
◦    sudo dd bs=1m if=~/Downloads/raspbian.img of=/dev/rdisk3
◦    if the above command report an error(dd: bs: illegal numeric value), please change bs=1M to bs=1m
◦    (note that dd will not feedback any information until there is an error or it is finished, information will show and disk will re-mount when complete. However if you are curious as to the progresss – ctrl-T (SIGINFO, the status argument of your tty) will display some en-route statistics).
After the dd command finishes, eject the card:
◦    sudo diskutil eject /dev/rdisk3
◦    (or: open Disk Utility and eject the sdcard)
Insert it in the raspberry pi, and have fun

*these are modified instructions from http://elinux.org/RPi_Easy_SD_Card_Setup

**to shutdown: # sudo halt

KEYBOARD SETUP

**if your keyboard is sticking and repeating, you are drawing >100ma from the USB port and need to use a powered hub

$ sudo raspi-config
configure_keyboard

find your keyboard
apple
other
English (US)
English (US) (Macintosh)
default
no compose key
use control+Alt+backspace to terminate the X server?   choose <yes>

PASSWORD

your default login is: pi
password: raspberry

to shorten it:

$ sudo raspi-config

change_pass
<OK>
press spacebar, then press return
press spacebar, then press return
***now your login is: pi
password: <spacebar>

***there is also a config program for expanding your disk partition… else, you wont have any space to do anything

SSH

# sudo bash

# ssh-keygen -t rsa

press return

press return

press return

# sudo /etc/init.d/ssh start
# ip addr show

from terminal: ssh pi@000.000.0.0
launch FileZilla ip:000.000.0.0 username:pi password:<spacebar> port:22

GIT/UPDATE

# sudo bash
# apt-get install git-core
# wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && chmod +x /usr/bin/rpi-update

# sudo reboot
# sudo rpi-update

PURE DATA

# sudo apt-get update

# sudo apt-get install puredata

http://log.liminastudio.com/wp-content/uploads/2012/06/testPatch.pd_.zip

# pd -nogui -noadc -alsa testPatch.pd

ENOUGH

#sudo killall pd
to delete:
#sudo apt-get –purge remove pd

USB AUDIO (ORDERING MULTIPLE USB DEVICES):

first you have to figure out the index number of your usb devices:
#lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 001 Device 005: ID 0d8c:0139 C-Media Electronics, Inc.
Bus 001 Device 006: ID 1d03:001a iCON

in my case, the iCON card loads fastest, but this is a controller (not an audio devices) and will crash Pure Data’s ability to keep the cards in order. So if I want my USB audio card (index 005… C-Media Electronics, Inc), to load before my controller (index 006… iCON), then change the order they are assigned aliases with alsa-base.conf. I change install sound-slot-5 to load at 0 by swapping it with sound-slot-0, and install sound-slot-6 to load at 1 by swapping it with sound-slot-1:

# sudo nano /etc/modprobe.d/alsa-base.conf

# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-5
install sound-slot-1 /sbin/modprobe snd-card-6
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-0
install sound-slot-6 /sbin/modprobe snd-card-1
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe –ignore-install snd && { /sbin/modprobe –quiet snd-ioctl32 ; /sbin/modprobe –quiet snd-seq ; }
install snd-rawmidi /sbin/modprobe –ignore-install snd-rawmidi && { /sbin/modprobe –quiet snd-seq-midi ; : ; }
install snd-emu10k1 /sbin/modprobe –ignore-install snd-emu10k1 && { /sbin/modprobe –quiet snd-emu10k1-synth ; : ; }

# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
# Keep snd-pcsp from beeing loaded as first soundcard
#options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=0

COPY IMAGE ONTO COMPUTER

# sudo halt
mount SD on your mac, in terminal:
# diskutil list

# sudo diskutil unmountDisk /dev/diskN
# dd if=/dev/diskN of=~/Desktop/image.img bs=1m
(control-t prints progress)

COPY FROM COMPUTER ONTO CARD

mount new SD on your mac, in terminal:
# diskutil list

# sudo diskutil unmountDisk /dev/diskN
your admin password
# dd bs=16m if=~/Desktop/image.img of=/dev/diskN

PURE DATA WITH MIDI CONTROLLER

find your USB and controller device numbers:
#pd -noadc -nogui -listdev
audio input devices:
1. USB PnP Sound Device (hardware)
2. USB PnP Sound Device (plug-in)
3. iCON iControl V1.01 (hardware)
4. iCON iControl V1.01 (plug-in)
5. bcm2835 ALSA (hardware)
6. bcm2835 ALSA (plug-in)
audio output devices:
1. USB PnP Sound Device (hardware)
2. USB PnP Sound Device (plug-in)
3. iCON iControl V1.01 (hardware)
4. iCON iControl V1.01 (plug-in)
5. bcm2835 ALSA (hardware)
6. bcm2835 ALSA (plug-in)
API number 1

no midi input devices found
no midi output devices found

notice, my iCON iControl is a MIDI controller, but doesn’t show up as MIDI- but I just need its device number
#pd -nogui -noadc -mididev 3 -audiooutdev 1 -alsamidi -path ~/Documents/pd_rpi controller_test.pd

AUTO-LOGIN

#sudo nano /etc/inittab

comment out (#):
1:2345:respawn:/sbin/getty –coclear 38400 tty1
add:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

LOAD PURE DATA PATCH FROM STARTUP

this script waits 5 sec, loads a patch, waits 5 sec, kills pd
#nano /home/pi/bin/script_pd
sleep 5
nohup pd -nogui -noadc -audiooutdev 3 -path ~/Documents/pd_rpi testTiny.pd &
sleep 5
sudo killall pd

#sudo chmod 700 script_pd
to test:
# /home/pi/bin/script_pd

#cd ~
#nano .bash_profile
nohup /home/pi/bin/script_pd &

#sudo reboot

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s