Recording audio on Ubuntu while watching TV with my android phone

First a bit of background: I hooked up my TV to a linux-box running Ubuntu. As a mediaplayer i use XBMC which also has a nice Android app for remote control. Something i miss though, is an easy way to record audio while watching. I use a lot of movie-samples (voices, fx, drones) in my music and i’m always looking at easier ways to get a bunch of samples. But here comes Remote Launcher to the rescue!

This app lets you run custom commands and shellscripts with the click of a button on your phone.

Here’s how i did it:

  • Download Remote Launcher server here and install it. Make sure to have java6 installed (apt-get install sun-java6-bin sun-java6-jre)
  • Now we do a testrun: remote-launcher-server -d

    Fill in a password twice. You only have to do this once. If you see a message that it’s running on port 4444. You’re set, and you can just CTRL-C again. The important thing is that you now will have a ~/.remotelauncherserver configuration file.

  • To make sure this server gets started whenever we reboot, we put the startup in /etc/init.d/remotelauncher
    #! /bin/sh
    # Provides:          remotelauncher
    # Required-Start:    $local_fs $all
    # Required-Stop:
    # Default-Start:     2
    # Default-Stop:
    # Short-Description: Start the Android Remote Launcher daemon
    # Description:       See
    [ -x "$DAEMON" ] || exit 0
    case "$1" in
            echo "Starting remote-launcher-server"
            start-stop-daemon --start --background --user YOUR_LINUX_USER_NAME --make-pidfile --pidfile /var/run/ --exec $DAEMON --chuid YOUR_LINUX_USER_NAME -- -d
            echo "Stopping remote-launcher-server"
            start-stop-daemon --stop --pidfile /var/run/
            echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
            exit 3
  • Make sure it gets linked to the correct rc.d: chmod 755 remotelauncher; update-rc.d remotelauncher defaults 96 02
  • Now we need some scripts to start and stop recording.


    date=`date +"%Y-%m-%d-%k-%M-%S"`
    /usr/bin/rec "$filename"


    /usr/bin/killall -9 rec
  • Make them executable: chmod 755 ~/scripts/ ~/scripts/
  • Now we’re ready to configure remotelauncher to use them. Edit ~/.remotelauncherserver and put the following code in there. Make sure to change the paths of the scripts to the correct paths!
    ######## Remote Launcher Server config file ########
    # Add entries in the following format:
    #   Name
    #   Description
    #   Path
    # Example:
    #   Notepad
    #   Launch the Notepad editor
    #   c:\windows\system32\notepad.exe
    # Visit
    # for more details and examples.
    # Blank lines or lines beginning with # are ignored.
    Start XBMC media center
    Kill XBMC
    Kill XBMC media center
    /usr/bin/killall xbmc
    Start recording
    Stop Record
    Stop recording
  • Now we can start and stop XBMC through the Remote Launcher as well as Start and Stop recording. Just run /etc/init.d/remotelauncher start and we’re ready to control our computer from our android device
  • Install the free Android App
  • Once installed you’ll have to add your server and you’re set!
  • The coolest thing about this app is, that you can make a homescreen widget to run 1 of the commands you configured. This makes it super-fast to launch remote scripts from your homescreen!

2 thoughts on “Recording audio on Ubuntu while watching TV with my android phone

  1. Thanks so much for the detailed install guide.. Saved me alot of time.

    One thing.

    I dont have /bin/usr/rec, is there a way to install this app??

Leave a Reply

Your email address will not be published.