Category Archives: linux

Electronic ears: Using Performous to learn how to sing

SCHEDULED: 2010-07-28 Wed 08:00

I’ve been singing in the wrong key(s) all my life. Thanks to Brendon Robinson’s recommendation of Performous (a free, open source music application), I can finally work on fixing that.

Part of learning how to sing is getting used to what the notes feel like. I find it difficult to listen to piano notes and figure out if I’m singing at the right pitch. Sometimes I’m sharp, sometimes I’m flat, sometimes I’m way off. Recording is a hassle, and it takes too long between trying something and getting feedback. (I’m amazed by how my dad taught himself all sorts of photography techniques with a film camera…)

Performous provides instant feedback on the musical note and frequency it hears. I can watch the note and slide up and down the scale until I find the right pitch, and I can make up my own exercises for getting the notes right.

http://sachachua.com/blog/wp-content/uploads/2010/07/Performous_20100727T1826564.png

When I can sing scales and vocalizations without a hitch, then I can find a singing teacher to help me with volume and technique. First things first: gotta do it right before I do it loud. =)

I only wish I thought of looking for something like this a long time ago!

*Performous (http://performous.org)*: Free and open source – Microsoft Windows, Mac OS X, Linux

Using supervisord for Nginx+FastCGI+PHP

I was having problems with spawn-fcgi-standalone occasionally resulting in dead PHP processes, which caused 502 Bad Gateway errors on my site. Crontabbing an /etc/init.d/init-fastcgi start didn’t help much, so I looked for other ways to do it. Supervisord looked promising.

Here’s how to get Supervisord:

apt-get install python-setuptools
easy_install supervisor

 

Here’s what to add to /etc/supervisord.conf:

[fcgi-program:php5-cgi]
socket=tcp://127.0.0.1:9000
command=/usr/bin/php5-cgi
numprocs=5
priority=999
process_name=%(program_name)s_%(process_num)02d
user=www-data
autorestart=true
autostart=true
startsecs=1
startretries=3
stopsignal=QUIT
stopwaitsecs=10
redirect_stderr=true
stdout_logfile=/var/log/php5-cgi.log
stdout_logfile_maxbytes=10MB

So far, so good. When I kill the php process, supervisord starts it back up. Progress!

supervisord doesn’t come with an init.d script, but you can get one for Ubuntu.

Fixing SIOCSIFFLAGS: Unknown error 132 for Karmic wireless on Asus Eee 1008HA

I was having problems with wireless on the netbook-oriented version of Ubuntu Karmic Koala. ifconfig wlan0 up returned SIOCSIFFLAGS: Unknown error 132. Thanks to Ubuntu’s bug database, I found the following solution:

rmmod ath9k
rfkill block all
rfkill unblock all
modprobe ath9k
rfkill unblock all

Asus EEE 1008HA and Ubuntu: Keep a USB drive handy

I’d been thinking about getting a netbook for a while, but I’d felt guilty over the two ultraportables languishing in our electronics drawer. I occasionally dusted them off and W- even got Ubuntu running on them again, but I just didn’t use them as much as I did before I got my work laptop. Keeping multiple configurations synchronized is a pain. Lugging two laptops around is a real pain.

I held out for the longest time. I’d been into ultraportables when having an 8.9″ screen made geeks’ heads turn (which is how I got away with selling advertising on the back of my laptop one weekend, as an experiment ;) ), and now that ultraportable computers had gone mainstream, well… <laugh>

Then W- reminded me that the real reason why I haven’t been using the Fujitsu Lifebook P1110 or the Sony Vaio U1 was that I’d used them until they fell apart. Really. Masking tape was the only thing keeping the P1110 together.

And then I ran into all sorts of computing difficulties on my work laptop, and I decided that having a backup system that I could keep in a consistent configuration was worth some of my dream/experience fund. A light machine that I could use for presentations and for blog posts would be nice, and if it could let me connect to Windows-only teleconferences while continuing to do work using the Linux partition on my main laptop, that would be fantastic.

After consulting Ted Tritchew (resident guru) and a number of Net resources, I ended up with two choices: the Asus Eee 1000HE, and the Asus Eee 1008HA. The 1000HE was relatively solid, worked well with Linux, and boasted a 9.5-hour battery life. The 1008HA was slimmer, lighter, and could get by on 6 hours. I went with light, because the pounds really do add up.

It was easy to get Windows XP and Linux to co-exist, thanks to the USB installer that Ted lent me. The 1008HA was pre-partitioned, so I just installed Linux onto the second partition. (Nice not to have to fuss with resizing things!)

The first major hiccup I ran into was getting networking to work. With the default install of Ubuntu, not even wired Ethernet worked! I came across this really useful Amazon.com review which said:

Once you install, you need to grab the AR813X-linux-v1.0.0.8.tar.gz package from http://partner.atheros.com/Drivers.aspx . Untar this (ignore the gzip errors), cd src, make, sudo make install, then insmod the resulting file. That should give you wired ethernet.

To get wifi, go to Administration > Software Sources > Updates and check off “Unsupported Updates (jaunty-backports)”, then do sudo apt-get install linux-backports-modules-jaunty . Once you reboot, you should have wireless.

So the important parts of my system work now, and I’ll worry about the other bits later on.

Cintiq 12WX on Ubuntu Jaunty with ATIconfig

After far too much pain and suffering, I got my tablet to work again. Culprit: the switch to an ATI graphics card threw my config out of whack.

Section "ServerLayout"
        Identifier     "Default Layout"
        Screen      0  "aticonfig-Screen[0]-0" 0 0
        Screen         "aticonfig-Screen[0]-1" RightOf "aticonfig-Screen[0]-0"
        InputDevice    "stylus" "SendCoreEvents"
        InputDevice    "eraser" "SendCoreEvents"
        InputDevice    "pad"
EndSection

Section "Files"
EndSection

Section "Module"
        Load  "glx"
EndSection

Section "ServerFlags"
        Option      "DontZap" "True"
        Option      "AutoAddDevices" "False"
        Option      "Xinerama" "on"
EndSection

Section "InputDevice"
 Identifier  "cursor"
        Driver      "wacom"
        Option      "Mode" "Absolute"
        Option      "Device" "/dev/input/wacom"
        Option      "Type" "cursor"
        Option      "USB" "on"                  # USB ONLY
EndSection

Section "InputDevice"
        Identifier  "stylus"
        Driver      "wacom"
        Option      "Mode" "Absolute"
        Option      "Device" "/dev/input/wacom"
        Option      "Type" "stylus"
        Option      "USB" "on"                  # USB ONLY
EndSection

Section "InputDevice"
        Identifier  "eraser"
        Driver      "wacom"
        Option      "Device" "/dev/input/wacom"
        Option      "Type" "eraser"
        Option      "USB" "on"                  # USB ONLY
EndSection

Section "InputDevice"
        Identifier  "pad"
        Driver      "wacom"
        Option      "Device" "/dev/input/wacom"
        Option      "Type" "pad"
        Option      "USB" "on"                  # USB ONLY
EndSection

Section "Monitor"
        Identifier   "aticonfig-Monitor[0]-0"
        Option      "VendorName" "ATI Proprietary Driver"
  Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
EndSection

Section "Monitor"
        Identifier   "aticonfig-Monitor[0]-1"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
EndSection

Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        Option      "OpenGLOverlay" "off"
        Option      "OverlayOnCRTC2" "1"
        Option      "DesktopSetup" "clone"
        Option      "VideoOverlay" "on"
        Option      "EnableMonitor" "crt1,tmds1"
        BusID       "PCI:1:0:0"
EndSection

Section "Device"
        Identifier  "aticonfig-Device[0]-1"
        Driver      "fglrx"
        BusID       "PCI:1:0:0"
        Screen      1
EndSection

Section "Screen"
        Identifier "aticonfig-Screen[0]-0"
        Device     "aticonfig-Device[0]-0"
        Monitor    "aticonfig-Monitor[0]-0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "1600x1200"
        EndSubSection
EndSection

Section "Screen"
        Identifier "aticonfig-Screen[0]-1"
        Device     "aticonfig-Device[0]-1"
        Monitor    "aticonfig-Monitor[0]-1"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "1280x800"
        EndSubSection
EndSection

I also had to manually calibrate my Wacom tablet.

xsetwacom set pad StripLDn "CORE KEY  Minus"
xsetwacom set pad StripLUp "CORE KEY  Plus"
xsetwacom set pad Button4 "core key  Del "
xsetwacom set pad Button3 "core key space "
xsetwacom set pad Button2 "CORE KEY n"
xsetwacom set pad Button1 "CORE KEY p"
xsetwacom set stylus Screen_No "1"
xsetwacom set stylus topy "361"
xsetwacom set stylus TopX 29500
xsetwacom set stylus BottomY 22000
xsetwacom set stylus TopY 0

Last bit of weirdness: the pad buttons only work if I’m also touching the scroll strip. It took me ages to figure that out.

How to extract just the audio from Sametime Unyte recordings, on Linux

I use Sametime Unyte for web conferences at work. Unyte allows you to record your teleconferences (slides and audio), and you can download a ZIP containing Flash video after your session.

I usually extract the audio track and publish that as a separate MP3 so that people can listen to it. I can also have the audio file transcribed. The audio track from Sametime Unyte is of lower quality than my voice recorder, but it’s a good backup and it captures both sides of the phone conversation.

Here is one way to extract the audio using Linux:

for FILE in *.swf; do ffmpeg -i $FILE -ab 64k $FILE.wav; done

Then you can concatenate all the WAV files:

sox *.wav all.wav

Then you can use Audacity to edit the resulting file.