Sunday, December 22, 2013

Syslog

Since I am now starting the synth at boot time, all my logs are going to stdout and it is hard to figure out what is happening when things go wrong. Also printf seem to affect synth performance. For both those reasons, I decided to use syslog for my run time logs. This is what I did:

1. Initialized logs doing:

setlogmask (LOG_UPTO (LOG_DEBUG));
openlog ("mysynth", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER);

2. Replaced printfs with one of the following macro calls:

#define ERROR_LOG(...) \
    syslog(LOG_ERR, __VA_ARGS__)

#define INFO_LOG(...) \
    syslog(LOG_INFO, __VA_ARGS__)

#define WARNING_LOG(...) \
    syslog(LOG_WARNING, __VA_ARGS__)

Sunday, December 8, 2013

Start Synth at boot time

In order to have my synth application start when booting the raspberry pi, I followed the instructions here and created an script in /etc/init.d and calling "sudo update-rc.d NameOfYourScript defaults" to register the script.

Friday, December 6, 2013

Jansson

I decided to use json to format the presets data to store. I have some experience using jansson c library for managing json files, so I decided to use the same here. Since jansson does not seem to be available in raspbian packages, I followed these steps to install it:

git clone git://github.com/akheron/jansson.git
cd jansson
sudo apt-get install autoconf
sudo apt-get install libtool
autoreconf -i
./configure
make
sudo make install
sudo ldconfig

Instructions coming from here.

Thursday, December 5, 2013

Tools


Here are some tools I acquired for this particular project, which I hope to use often for now on and which I regret not having bought earlier:

  1. Hot Glue Gun: I glued the screen to the case using this. Seems like the kind of thing that everyone should have at home.
  2. Step Drill Bits: These are greats for making big diameter holes, for potentiometers or switches for example. If you do guitar stomp boxes or analog synths you need these, I regret not having bought them before, making big holes with small drilling bits is a pain. I got these from Dealextreme, here.
  3. USBtinyISP: Already mentioned about this one here. This was a replacement for my JTAG+ISP  AVR programmer.