Thursday, December 4, 2008

Boxee redux

Trying to rebuild the latest Boxee and run into these problems:



1] AppManager.h:52 - change "static bool CAppManager::RunInBG(InstallOrUpgradeAppBG* pJob);" to "static bool RunInBG(InstallOrUpgradeAppBG* pJob);". g++ doesn't like the redundant qualification. Wonder what version of g++ the XBMC crew uses, as that's a common error I see alot from code coming over from Windows.



2] LinuxFileSystem.cpp:188 Change

shares.strName += " (" + g_localizeStrings.Get(51350) + ")";

to
share.strName += " (" + g_localizeStrings.Get(51350) + ")";


A very strange and impossible bug - it was using the Vector, not the CMediaShare. Maybe we shouldn't be doing HAL?



3] I got an error about missing libtxml.a. Needs tinyxml:

$ cd xbmc/lib/libBoxee
$ tar xzvf tinyxml_2_5_3.tar.gz


Not sure why it wasn't in there. Then I had to add a target to the Makefile found in xbmc/lib/libBoxee:




all: libBoxee.a libtxpath.a libtxml.a

libtxml.a:
make -C tinyxml
$(AR) $(ARFLAGS) libtxml.a tinyxml/*.o
ranlib libtxml.a


And that finally compiled. A lot cleaner and faster compiler than the previous version. This creates a ./Boxee. Now another problem cropped up - I can't seem to find any sort of script to create a new installation, like I create before. And there is no plugins folder, like there used to be. But I just faked it, using my make-boxee.sh script and copying in plugins folder from my previous install.



So I copy the create opt/boxee folder into /opt/boxee. And try to run it. It sort of worked, although I had to try a few times to log in, as it kept complaining of an invalid password. I assume that is just because the server is getting pounded due to all the people trying out the new version.



But even once I got logged in, it still wasn't very stable. Whenever the left menu would try to come up, Boxee locked up hard, requiring me to Ctrl-Alt-F2 to a text console and killing the process. Trying to play anything just crashes it. And I can't seem to find any log file :( Oh well.





Sunday, November 23, 2008

Media PC Mania

Boxee has me so excited about a home theater computer that I have begun to spec out building a new one to add to my home theater set up. Coincidentally enough, ASUS has recently come out with a new motherboard complete with HDMI out and 7.1 hi def audio, so here's what my list looks like:




  • P5N7A-VM - looks like they did this one up right. Plenty of connectors, including HDMI, DVI, Display Port and VGA (you can use two at a time), plus Optical SPDIF, 6 jack audio, etc. Includes the latest nVidia 9300 mobile GPU (I guess it is the equivalent of the 8200 card; I have an 8600 in the openSUSE box). A microATX form factor means I can use a "home theater" designed case.

  • Speaking of cases, it looks like I could go a few different ways. High end would be the Antec Fusion series, a real sweet "home theater" (replete with dials and guages) box. But at around $200, it seems like overkill. Slightly cheaper is the nMediaPC HTPC 1000, at around $100, although some reviews have been unkind. Cheaper still is the Apex DM series, which isn't really all the "home theater" looking, but is still pretty small and about $50, albeit with a pretty wimpy powersupply.

  • Intel Core 2 Duo E6550 chip - ExtremeTech suggests this chip and given that we aren't going to do much besides render video streams, this mid-level chip should be enough. It should go for about US$160. Although given that the Core 2 Quad Q6600 I have in my main box goes for only about $20 more, maybe I should step up here.

  • An optional enhancement would be a BluRay DVD player, which runs about US$100. In the beginning, a regular DVD player, which I have all over the place here, would suffice, as I already have a BluRay player with my PS3.

  • And then add in a Samsung 1TB hard drive for about US$100 and a couple gigs of DDR2-800 RAM for US$20.



So all told, it would start at about US$500 for the box, plus the US$100 for the BluRay player. Very tempting. I would also probably run a UPnP server like MediaTomb to serve up my media. The costs look like this:





































Component
Name
Price
MotherboardASUS P5N7A-VM$140
CaseApex DM$75
CPUE6600$160
MemoryDDR2-800 2gb$30
SATA Harddrive1TB Samsung HD103UJ$100
BluRay PlayerLite-On$100



I don't really need a media PC, as my regular PC works just fine. Of course, it is a real PC in a real case, and I have to unplug it and carry it over to my home theater setup, but how bad is that? Still, I can scheme for one, can't I?



Tuesday, November 18, 2008

IRC Linux

Well, actually the next step in the boxee media machine process (see here and here for previous steps), is to see if I could get a remote control and an HDMI output to work. First up was the remote.



In Linux, the way to go is LIRC (Linux Ifrared Remote Control). But please, don't go to the web site or you'll be like me - completely intimidated! There's lots and lots of info but for most modern distros, you only need to do two things:




  1. Install the lirc package from a "usual" source for your distro. I imagine most if not all of them should have it in a regular place at this point.

  2. Copy the right config to /etc/lirc.conf. This can be a little daunting, as there are lots and lots of possibilities. In openSUSE, they are all put in the /usr/share/lirc/remotes folder. Find the maker and the version, copy it to /etc/lirc.conf and you should be all set.



Of course, it is a good idea to have a supported remote first. I was stymied in this pursuit for a while, as I really didn't want to build an IRC receiver and, at least according to the lirc web page, USB IrDA remotes, which is all I could find locally, don't work with lirc. But I read somewhere that the Microsoft Media Center remote is an excellent choice, and I found it for a real nice price at Microbarn. In fact, I highly recommend them as they were very fast and flexible fixing my order, as I first forgot to add a DVI->HDMI cable, then I double ordered the cable. So after three tries I finally got my act together and ordered what I wanted. They not only kept up with me, the order went out that afternoon and I got it 2 days later. I will definitely be ordering there again!



So after installing lirc, I copied the "mceusb" config and started the lirc daemon:



$ sudo cp /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb /etc/lirc.conf
$ sudo service lirc start


Plug in the usb IR receiver, give it a chance to get set up, and run the 'irw' (infrared read/write?) program to see if it can see the remote. Press some buttons and hopefully you should see something like:



$ irw
000000037ff07bde 00 Right mceusb
000000037ff07bde 01 Right mceusb
000000037ff07bde 02 Right mceusb
000000037ff07bdf 00 Left mceusb
000000037ff07bdf 01 Left mceusb
000000037ff07bdf 02 Left mceusb
000000037ff07bdd 00 OK mceusb
000000037ff07bdd 01 OK mceusb
000000037ff07bdd 02 OK mceusb
000000037ff07be0 00 Down mceusb
000000037ff07be0 01 Down mceusb
000000037ff07be0 02 Down mceusb
000000037ff07bed 00 ChanUp mceusb
000000037ff07bed 01 ChanUp mceusb
000000037ff07bec 00 ChanDown mceusb
000000037ff07bec 01 ChanDown mceusb
000000037ff07bec 02 ChanDown mceusb
000000037ff07bef 00 VolUp mceusb
000000037ff07bef 01 VolUp mceusb
000000037ff07bee 00 VolDown mceusb
000000037ff07bee 01 VolDown mceusb
000000037ff07bee 02 VolDown mceusb
000000037ff07be9 00 Play mceusb
000000037ff07be9 01 Play mceusb
000000037ff07be9 00 Play mceusb
000000037ff07be9 01 Play mceusb
000000037ff07be5 00 Skip mceusb
000000037ff07be5 01 Skip mceusb
000000037ff07beb 00 Forward mceusb
000000037ff07beb 01 Forward mceusb
000000037ff07bef 00 VolUp mceusb
000000037ff07bef 01 VolUp mceusb


Don't worry about the double entries for each key. I think it is just button down and button up. The last word is the name of the device while the one before it is the name of the command. This is what you'll be using to configure various apps, which is generally done one app at a time. I was glad to uncover KDE's IRC Cconfig, its LIRC server interface (Configure Desktop -> Hardware -> Remote Controls). Makes setting it up for Amarok pretty easy (although still a little painful).



For my current pet project, boxee, you can find the lirc commands in

~/.boxee/UserData/Lircmap.xml
, and it comes all set up for the Microsoft remote. Of course, I put a wrench in the matters by using the wrong config file (ie, the one mentioned above), which has all the commands in UPPERCASE, while the boxee (and XBMC) setup look for it in lowercase. So be sure to check the output of the 'irw' command closely. I finally wised up and copied in the one from the source tarball (a copy is here) found in
tools/HardwareConfigure/mceusb2.lircd.conf
. You can find the file that maps lirc commands to boxee command in
~/.boxee/UserData/Lircmap.xml
. All of a sudden, remote control was working!




Sunday, November 16, 2008

More Boxee Goodness

After working with boxee on my openSUSE box, I decided in order to get a better feel for how boxee is supposed to work, I installed Ubuntu 8.04 "Hardy", which is the officially supported version of Linux. I still find it an annoying distro. It never gets the boot partition right, even if you type the correct magic incantation in the mysterious box you are offered. I had to edit /boot/grub/menu.1st file to set the root partition manually to (hd1,3). I also dislike its authoritarian insistence on no root users, forcing you to use sudo to get anything done. Sometimes you just want to be the root user for a bit.


And never mind the fact I am not a big GNOME fan. Give me a solid KDE installation any time. I know I could have used the Kubuntu distro, but I wanted to stay mainstream with this installation. And I think YaST is a superior administration and package installation tool. Maybe slower (although much improved in openSUSE 11), but more flexible and cleaner. Just my opinion of course!


Anyway, I added the package source as mentioned in the download page for Ubuntu 8.04 Hardy Heron and it just downloaded and worked. All the pieces worked, even Hulu and Comedy Central, which I couldn't get to work on my openSUSE box, where I would just get thing spinning rose and the back to the main menu.


After rebooting into openSUSE and mounting my Ubuntu partition, I tried out the Ubuntu boxee installation directly. I had to symbolically link a few .so files to match the openSUSE names with the Ubuntu names:


# cd /usr/lib
# ln -s libcurl.so.3 libcurl.so.3.0.0
# ln -s liblzo2.so liblzo.so.1
# ln -s libpcre.so.0.0.1 libpcre.so.3
# ln -s libbz2.so libbz2.so.1.0


I think those are ones I needed to do. You can find out for sure by using the ldd command:



$ ldd Boxee
linux-gate.so.1 => (0xffffe000)
libhal-storage.so.1 => /usr/lib/libhal-storage.so.1 (0xb8029000)
<- many more dependencies removed ->
libXau.so.6 => /usr/lib/libXau.so.6 (0xb620a000)


And knock me over with a feather if it didn't work correctly! After much narrowing down, I finally figured out the files in the boxee/system/players/flashplayer/ were different in the Ubuntu install versus the source tarball. These are, unfortunately, closed-source, so you have to deal with the binaries. Once I copied these over the ones in the source tarball, magically everything worked on my openSUSE box! For your source tarball pleasure, you can download the flashplayer files here. Just unzip this file in the flashplayer folder of your boxee install and you should be good to go!



Well, one more suggestion - Boxee, by default, looks in ~/Music, ~/Movies and ~/Pictures for media. If you don't already use those folders, create symbolic links for them to your storage area. You can also add Sources by hand via the boxee menu or just edit the ~/.boxee/UserData/profiles/{profilename}/sources.xml file. The ~/.boxee folder will be created after the first time you run boxee. Another thing to keep in mind is that the indexing of your media, like movies & music, is done in the background, is done at a very low priority, and there is no indication it is even being done. Just check the Recently Added section of the main menu to see how it is going, only don't' be surprised if it takes awhile for each one to show up. I've just been leaving it running overnight.



Next step for me is to figure out how to build an RPM package for it, so it will install in the right place and add a menu item. Then maybe even how to host a repository for updates.




Thursday, November 6, 2008

Wordle Daemon

This blog as a Wordle picture:
title="Wordle: Daemon Dancing in the Dark">src="http://www.wordle.net/thumb/wrdl/295674/Daemon_Dancing_in_the_Dark"
style="padding:4px;border:1px solid #ddd">





Getting SUSEy with Boxee

It's alive! As yet another side project, I have been trying to get Boxee to work on my openSUSE box. Boxee is a cool new media player / social app that lets you play all kinds of multimedia, including streaming video from sites like Hulu, CNN, last.fm etc. It first came out on the Mac and a Linux version was recently released. Unfortunately, only Ubuntu is supported, so I decided to see what I could do about getting it run on my openSUSE box.



So I downloaded the source tarball and unpacked it with 'tar xzvf'. This created a working set of folders, but unfortunately, no Boxee instructions. At the time I didn't realize this was mostly a XBMC (Xbox Media Center) source tree, with a layer of Boxee graphics and helper apps. There are some READMEs, but turns out they don't really have much to do with installing Boxee. So rather than let you in on all my blundering about, here's how you should build Boxee on your openSUSE (or any other) Linux box:




  • The first thing you need to do is to get the myriad number of development packages required by XBMC. The README.linux file lists the packages needed when building under Ubuntu, but the names don't always match up for openSUSE. I'm going to assume you have the g++ packages installed, so here's the list of openSUSE packages:
    SDL-devel SDL_image-devel SDL_gfx-devel SDL_mixer-devel SDL_sound-devel
    freetype2 freetype2-devel lzo lzo-devel fribidi fribidi-devel sqlite3
    sqlite3-devel libogg-devel alsa-devel python-sqlite2 glew glew-devel
    libcurl-devel xorg-x11-devel xorg-x11-libXrender-devel pmount libmad0
    libmad-devel libtre-devel libvorbis-devel libmysqlclient-devel hal hal-devel
    pcre-devel subversion libjasper-devel libjasper fontconfig-devel libbz2-devel
    boost-devel libtool nasm libfaac-devel libenca-devel automake cmake
    xorg-x11-libXt-devel xorg-x11-libxmu-devel gperf unzip libpng-devel
    libjpeg-devel

    I think this is all of them, but I can't be sure as I already had some installed. The README.linux file lists the Ubuntu 'apt-get' command you can use to get all of these. I imagine there is an equivalent yast2 and/or rpm command to do the same but I just went through the Software Management module of Yast2 and selected them by hand.


  • $ autoconf
    : there isn't a 'configure' script and autoconf is the only way I know how to create it, even though it isn't mentioned in the README.linux file. I'm not sure if there is a better way, but this seems to work

  • $ ./configure -C --disable-debug
    : the -C creates a configure cache (presumably for running faster in later invocations) and U figure we might as well build an optimized, non-debug version of xmbc

  • $ make
    : now we'll make the Boxee executable (which is really just a renamed xbmc.bin, which is what the xbmc build creates. Now go make a fresh cup of coffee, as you will have plenty of time to brew another pot! I get a strange error from LaTex, as I think it is building some help files:
    ! Package inputenc Error: Unicode char \u8:éph not set up for use with LaTeX.

    See the inputenc package documentation for explanation.
    Type H for immediate help.
    ...

    l.49 \item[Author:]Stéph
    ane Borel $<${\tt stef@via.ecp.fr}$>$
    ?

    This is some odd error for Unicode. Using some Google-fu, you can fix this by typing in

    e
    (to edit the file), then
    :wq!
    to write out the file and quit (those are vi commands). Then run the make again. And go pour yourself another cuppa.


  • After the make has finished, you have a basic XBMC installation ready to go. So now you need to make a Boxee home. The script debian/make_debian.sh seems to be a script for the developers to set up a launching area to create the .deb file for the Ubuntu install. I modified it to create a nice Boxee subfolder. I called it make-boxee.sh and it is here:
    #!/bin/bash

    curr_dir=`pwd`

    SRC=../
    TMP=./tmp
    DEST=${TMP}/opt/boxee

    /bin/rm -rf ${TMP}
    mkdir -p ${DEST}/
    mkdir -p ${TMP}/usr/share/applications
    mkdir -p ${TMP}/usr/share/pixmaps

    # language
    mkdir -p ${DEST}/language/
    cp -r ${SRC}/language/* ${DEST}/language/

    # media
    mkdir ${DEST}/media
    cp ${SRC}/media/defaultrss.png ${SRC}/media/downloadrss.png ${SRC}/media/test_sound.mp3 ${SRC}/media/weather.rar ${DEST}/media
    chmod 644 ${DEST}/media/*
    mkdir ${DEST}/media/Fonts
    cp ${SRC}/media/Fonts/boxee* ${DEST}/media/Fonts
    chmod 644 ${DEST}/media/Fonts/*

    # screensavers
    mkdir ${DEST}/screensavers
    cp ${SRC}/screensavers/Plasma.xbs ${SRC}/screensavers/Solarwinds.xbs ${SRC}/screensavers/Euphoria.xbs ${DEST}/screensavers

    # scripts
    mkdir ${DEST}/scripts
    # Lyrics
    cp -r ${SRC}/scripts/Lyrics ${DEST}/scripts
    cp -r ${SRC}/scripts/RTorrent ${DEST}/scripts
    cp -r ${SRC}/scripts/Apple\ Movie\ Trailers ${DEST}/scripts
    cp -r ${SRC}/scripts/OpenSubtitles ${DEST}/scripts

    # plugins
    mkdir ${DEST}/plugins
    mkdir ${DEST}/plugins/music
    mkdir ${DEST}/plugins/pictures
    cp -r ${SRC}/plugins/pictures/flickr ${DEST}/plugins/pictures
    cp -r ${SRC}/plugins/pictures/PicasaWeb ${DEST}/plugins/pictures
    mkdir ${DEST}/plugins/video
    cp -r ${SRC}/plugins/video/Youtube ${DEST}/plugins/video
    cp -r "${SRC}/plugins/video/CNN Video" ${DEST}/plugins/video
    cp -r "${SRC}/plugins/video/Movie Trailers" ${DEST}/plugins/video

    # skin
    mkdir -p ${DEST}/skin/Boxee\ Skin\ NG
    cp -r ${SRC}skin/Boxee\ Skin\ NG/* ${DEST}/skin/Boxee\ Skin\ NG

    # system
    mkdir ${DEST}/system
    cp ${SRC}/system/*-i486-linux.so ${SRC}/system/asound.conf ${DEST}/system
    mkdir ${DEST}/system/players
    mkdir ${DEST}/system/players/dvdplayer
    cp ${SRC}/system/players/dvdplayer/*-i486-linux.so ${DEST}/system/players/dvdplayer
    mkdir ${DEST}/system/players/paplayer
    cp ${SRC}/system/players/paplayer/*-i486-linux.so ${DEST}/system/players/paplayer
    mkdir ${DEST}/system/players/flashplayer
    cp ${SRC}/system/players/flashplayer/*linux* ${SRC}/system/players/flashplayer/bxoverride.so ${DEST}/system/players/flashplayer
    chmod 755 ${DEST}/system/players/flashplayer/*
    mkdir ${DEST}/system/python
    cp ${SRC}/system/python/*-i486-linux.so ${DEST}/system/python
    mkdir ${DEST}/system/python/lib
    cp ${SRC}/xbmc/lib/libPython/Python/build/lib.linux-i686-2.4/*.so ${DEST}/system/python/lib
    cd ${SRC}/xbmc/lib/libPython/Python/Lib
    python -O >/dev/null << EOF
    import compileall
    compileall.compile_dir(".", force=1)
    EOF
    /bin/rm -rf test
    tar cf - `find . -name \*.pyo` | (cd $curr_dir; cd ${DEST}/system/python/lib; tar xf -)
    cd $curr_dir
    mkdir ${DEST}/system/scrapers
    cp -r ${SRC}/system/scrapers/* ${DEST}/system/scrapers
    mkdir ${DEST}/system/cdrip
    cp ${SRC}/system/cdrip/*-i486-linux.so ${DEST}/system/cdrip

    # userdata
    mkdir -p ${DEST}/UserData
    cp ${SRC}system/Keymap.xml ${SRC}system/Lircmap.xml ${DEST}/system
    chmod 644 ${DEST}/system/*.xml
    cp ${SRC}UserData/sources.xml.in.linux ${DEST}/UserData
    cp ${SRC}UserData/sources.xml.in.diff.linux ${DEST}/UserData
    chmod 644 ${DEST}/UserData/*
    ln -s UserData ${DEST}/userdata

    # visualizations
    mkdir ${DEST}/visualisations
    cp ${SRC}visualisations/opengl_spectrum.vis ${SRC}visualisations/ProjectM.vis ${SRC}visualisations/Waveform.vis ${DEST}/visualisations
    cp -r ${SRC}visualisations/projectM ${SRC}visualisations/projectM.presets ${DEST}/visualisations

    # rtorrent
    mkdir -p ${DEST}/bin
    cp ${SRC}/bin-linux/boxee-rtorrent ${DEST}/bin
    cp ${SRC}/system/rtorrent.rc.linux ${DEST}/system

    # binary
    cp ${SRC}/Boxee ${DEST}/
    strip ${DEST}/Boxee
    cp ${SRC}/run-boxee-desktop.in ${DEST}/run-boxee-desktop

    # give_me_my_mouse_back
    cp ${SRC}/give_me_my_mouse_back ${DEST}/
    strip ${DEST}/give_me_my_mouse_back

    # desktop stuff
    cp boxee.desktop ${TMP}/usr/share/applications
    cp boxee.png ${TMP}/usr/share/pixmaps

    # update debian control file with version number
    mkdir tmp/DEBIAN
    cp -f postinst ${TMP}/DEBIAN/
    chmod 755 ${TMP}/DEBIAN/postinst

    I removed some subversion stuff and other dev kind of things. I also changed the python invocation to not use the one that came with the source tarball. You can see the make_debian.sh script use ../python, but that gave me errors, so I just use the one I have already and it went well. This puts a full Boxee installation into the tmp folder.

  • to run Boxee, run opt/boxee/run-boxee-desktop script. You'll need to disable Compiz if you are runnig it. If you have dual monitors, you'll want to add the line:
    export SDL_VIDEO_FULLSCREEN_HEAD=1

    up near the top. This way, it will show up only on one display, rather than covering both displays, with most of it ending up in the middle, straddling your displays. See the README.linux file for more info.




With a small amount of luck, you should be running Boxee. Be sure to add me as a friend - jdarnold. Report back any success or failures in the Boxee Linux forum.




Tuesday, November 4, 2008

Going Wireless

So I have been on a bit of a "media server" kick lately. I don't know why, but I guess because I have a Playstation 3 just waiting to find a server, I figure I should try it out.


My first problem is that my openSUSE box is on the wired subnet while my PS3 is on the wireless one, which is a real problem for UPnP servers. A cardinal rule, I guess, is that both the client and the server must be on the same subnet. I would be willing to bet there is some kind of hackery I can do with routes or something that would make one see the other, but that is far beyond my meager network-fu. So if the mountain can't go to Mohamed, then Mohamed must go to the mountain.


I had been resisting getting wireless to work on Linux just because of all the headaches it seems to cause. I also go wired for the speed boost, as I do lots of high bandwidth video transmitting in my job as a video conferencing software geek. But I also did not want to run a wire across my office floor to the PS3, so the lesser and more temporary evil was to go "dual NIC" on the Linux box and use a basic no-name wireless USB device I picked up for $5 at Microcenter. So here's what I tried:



  • Plug in wireless USB device

  • Like I said, it is a nameless device. More than just that, it is a labelless one too, so I didn't even know what kind. So I do:

    $ lsusb
    Bus 007 Device 005: ID 0bda:8189 Realtek Semiconductor Corp. RTL8187B Wireless 802.11g 54Mbps Network Adapter
    Bus 007 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
    Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 068: ID 046d:c51a Logitech, Inc. MX Revolution/G7 Cordless Mouse
    Bus 001 Device 067: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
    Bus 001 Device 005: ID 06f2:0011 Emine Technology Co. KVM Switch Keyboard
    Bus 001 Device 003: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
    Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

    to find out that it is a Realtek 8787. So off to the Realtek site to download the latest Windows drivers.

  • download 8187B driver from Realtek site and unzip them.

  • install ndiswrapper and, because I'm lazy and like a nice GUI, I grabbed a KDE frontend for it - kndiswrapper. I run kndiswrapper, clicked "Install Driver", navigated to the WinXP folder for the Realtek driver and selected the .inf file.

  • Things got a little confusing here, so it became a bit of a click fest as I tried to figure out what to do next. You'll need to at least "Configure Device" and put in the information for it. Be sure to do the "save as" sic or you'll just keep typing in the same information. The "Mode of Operation" field was a mysterious drop down, as I don't know the difference between "Managed" and "Ad-hoc", but "Managed" was the way to go for me. The "ESSID" is the name of the wireless network and you can type it in or click the "ESSID-Scan" button to search for it. And you add your password, if any, at the bottom.

  • After setting it up, I unplugged the USB device and plugged it back in, and followed that by clicking "Reload List" in kndiswrapper, and I finally got an interface up and running:
    $ ifconfig
    eth0 Link encap:Ethernet HWaddr 00:1A:4D:84:47:8E
    inet addr:192.168.204.104 Bcast:192.168.204.255 Mask:255.255.255.0
    inet6 addr: fe80::21a:4dff:fe84:478e/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:78780 errors:0 dropped:0 overruns:0 frame:0
    TX packets:70212 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:76434598 (72.8 Mb) TX bytes:9857603 (9.4 Mb)
    Interrupt:16

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:66 errors:0 dropped:0 overruns:0 frame:0
    TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4028 (3.9 Kb) TX bytes:4028 (3.9 Kb)

    wlan0 Link encap:Ethernet HWaddr 00:14:D1:38:36:72
    inet addr:192.168.205.102 Bcast:192.168.205.255 Mask:255.255.255.0
    inet6 addr: fe80::214:d1ff:fe38:3672/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2354 errors:0 dropped:0 overruns:0 frame:0
    TX packets:318 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:771674 (753.5 Kb) TX bytes:39411 (38.4 Kb)

    Woo hoo!



Of course, at this point all that meant was that I had a mulithomed (dual NIC) computer. Now it is time to serve up some music, so next we'll talk about Mediatomb.





Thursday, September 25, 2008

Daemon to Penguin

I've been using and blogging about FreeBSD for about five years now, and I have been dabbling in Linux even long longer. My main server, which hosts about 5 web sites, currently runs FreeBSD 6 and I'm still very happy with it.


However, my main operating system has been Microsoft Windows pretty much ever since Windows for Workgroups hit the scene. Although I got my start in programming on a Unix box, most of my professional life has been spent on either DOS (mostly game programming - what fun EMS, Extended Memory and near/far/huge pointers were!), then on to Windows programming. I had been a pretty satisfied user of Windows, especially Windows 2000, although I was always drawn back, like a moth to the flames, to the Unix and Linux world. I have burned many a CD with virtually all the major Linux distributions and BSD flavors.


I settled on FreeBSD for my server because I love the control it gives you. Compiling packages via source code allowed for easy customization by this inveterate hacker, so I could tweak all I wanted. Keeping it up to date is still a bit of a chore, but the trade off in simplicity and openness (the BSD license is a beacon of clarity compared to the Windows license or even the GPL) made the annual pain worth it.


But late last year I became disenchanted with Windows as my personal operating system. I became more involved in Redhat Linux programming for my job and just wanted to be free of the black box that is Windows. I decided to once and for all throw off the Windows shackles and move to a free operating system (not that I have ever paid for Windows - as a developer, I got them all free of charge from Microsoft).


My first choice was FreeBSD. It's a little barebones and I really didn't want to spend my days tweaking it, so I moved to the wondefully complete PC-BSD version of it. A simple, turnkey FreeBSD "distro" with a vibrant user community, I settled into it quickly and became a frequent contributer to the forums. There were a few bumps on the way to fulltime BSD (well, save for dual-booting into Windows XP to play games), but I soon was enjoying the ride.


But then it started to be a drag. Each and every day seemed to bring new challenges that just took too much time to solve. I really wasn't in it for hackers paradise - I wanted an OS that just worked. The last straw was trying to get my dual monitor setup working. Literally days of xorg.conf tweaking later only gave me partial satisfaction, so I began looking around at Linux distros.


After a week or so of trying all the popular distros, I settled on openSUSE. I didn't know about the "sleeping with the enemy" reputation of Novell, for better or for worse, so it didn't enter into my consideration. This was way back in May of this year and I couldn't be happier.


Here is my list of why Linux is better than FreeBSD for me. Of course, everyone will hav their own ideas, but this is my article, so this is my list!



  • Better support. And by support, I mean it in so many ways, from an enthusiastic user community, to hardware driver support to resources you can turn to in a pinch.

  • Better tools. While I don't mind getting my hands dirty with a text config file, my days of having the time to figure out the nuances of every little text string are long gone, so I truly appreciate having GUI admin tools.

  • Bigger installed base. No longer do I feel like the forgotten stepchild when it comes to getting media files to run, viewing Flash sites, playing music CDs, etc. While Windows remains the 1000 pound gorilla in the closet, Linux must run a close second to the Mac as far as third party support goes. I can't even begin to tell you the hoops you needed to jump through to get Flash to work on PC-BSD. And my Palm Pilot? Forget it!

  • More resources. I mentioned this in the first point, but it deserves its own entry. I'm a real information hog and love the plethora of print and electronic information sources for Linux. I grabbed a bunch of books, bought all the magazines, started reading all the web sites, rolling around in the information like Scrooge McDuck rolling around in his coins.

  • Fun. I love how vibrant and even fractious the Linux community is. FreeBSD feels a little inbred at this point, with a serious (and understandable) "us against the world" mentality, while the Linux crowd is looking to conqueror the world. And I am psyched to be a part of it!




Friday, September 19, 2008

Dancing Around

A couple of changes here at Daemon World Headquarters. First up is the URL change. To reflect my general concentration on Linux rather than FreeBSD, I've gone to a URL of http://linux.amazingdev.com rather than freebsd.amazingdev.com. I've added a redirect to Apache (I think) which should make the change relatively unobtrusive, but who knows?

Secondly, I have added a Tumblr page dedicated to short Linux blurbs, or tumblrs. You can find it here: JD's Linux Love. This is where I'll put links, pictures and the like. Daemon Dancing will be more focuses on longer how tos and notes.

Sunday, September 14, 2008

Fresh Linux Baking

A couple of new Linux apps coming over from the dark side that have me squealing like a little girl!



  • Dropbox - a very simple service that offers 2gb of synchronized storage. You can even make share selected files publicly. There's already an openSUSE package for it as found here. Unfortunately for me, a KDE user, it comes prepackaged with a GNOME Nautilus interface. It runs a small daemon (dropboxd) and then shows the Nautilus interface. The Nautilus stuff is opensource, but the daemon isn't :( But perhaps they will document the interface, as Filip L. has reversed engineered it and wrote a Python script here. And they are asking for folks to write KDE and other front ends.


    Joel of Joel on Software has a nice little post about how to synchronize passwords between your Windows & Linux boxes using PasswordSafe on Windows and Password Gorilla on Linux, here, and storing the file on Dropbox.




  • Launchy - a favorite of the Lifehacker crew, the Linux version was finally released. Launchy is a program in the same line as Gnome DO and Katapult. I had been using Katapult, but I found that showing only one option when there were many possibilities too limiting. Launchy fixes this with a very nice drop down showing all possible completions. It also has a nice plugin architecture, which I haven't explored much yet. I still sorely miss PowerPro on Windows, but what can you do?




Monday, August 18, 2008

Yet Another Backup Solution

In these days of US$150 1 terabyte hard drives, there is simply no reason not to have multiple hard drives and implementing a regular backup plan. Of course, I don't have one and feel like I'm walking the high wire without a net. I've installed a couple of GUI rsync frontends, but haven't done anything with them. I even did some work to try and update dar to work, given its orphaned status (although they finally updated it in the openSUSE repositories), but still haven't done anything. Here's another tool that looks easy to use, although I really think I should set up a real bacula setup for all the home computers.

BackupGem Manual
Backup is the easiest and most flexible backup, archive and rotate tool. It’s a beginning-to-end solution for scheduled backups in a clean ruby package that is simple use and powerful when customized.


Monday, August 4, 2008

Back in the Saddle

As you may have noticed (for both of my readers), I am back to updating Daemon Dancing instead of helping out at Linux Brain Dump, as LBD seems to have slipped into a funk lately. So I figured I would just go back to working on Daemon and trying to update the look and feel of it. But I had forgotten just what an incredible time sink it can be once you begin playing with your blog look! Just a few minor tweaks (like trying to get the search box to work) took a couple of hours, as I played with all kinds of settings. And, as you can probably see, this is a pretty plain vanilla Movable Type blog!


Anyway, look for more Linux, FreeBSD and other FOSS software ramblings to show up here again.


Just a quick note on FreeBSD - while I don't run it on my home desktop, my server (the one that hosts this blog, for instance), runs FreeBSD 6.1 (a little out of date). I finally bit the bullet and did a full package upgrade and lo and behold, it went like a champ, despite the long delay between updates. At least I had the portsnap cron job running, so that part was kept up to date. The first portsnap update command took a very long time, but after a few carefully chosen upgrades, I just jumped in with both feet and the portmanager -u command did it all. Of course, I haven't tried rebooting yet, which is the real test. But still, very nice.



Friday, August 1, 2008

AIRing it out

Very nice intro to AIR on Linux found at Linux Journal. AIR (Adobe Integrated Runtime) is Adobes push for a crossplatform rich Internet app "operating system". I've been using it for Twhirl, a very nice Twitter client. For some reason, there are many Twitter clients using AIR. Adobe claims AIR to be only in an "alpha" state for Linux, but it has been working for me pretty well.



The only obvious shortcoming is that, according to the Twhirl author, the Linux version doesn't support the password encryption that is found on the Windows client, so it doesn't store passwords. And there are some rough edges for the UI, like the super-annoying Mac-like restriction of only resizing the window via dragging the lower right corner. And the auto-update feature doesn't work. You have to download the update file for the app and install it yourself. But it has been very stable for me and I'd like to look more into programming with it.



An Introduction to AIR




Vee Dee Eyes page

Cool page providing a bunch of VDIs, which are images you can use in VirtualBox, my current favorite OS emulator. These VDIs are pre-installed OS images that run in VirtualBox and let you quickly try out any OS (mostly Linux, of course).

Sun xVM VirtualBox VDI Index | veeDee-Eyes
The VirtualBox "Virtual Disk Image" Index
VDI images of pre-installed "Open Source" Operating System distros.
It's a computer inside your computer.


Wednesday, July 30, 2008

Teaching OSS to Share

Say you're doing some programming, or trying out an older audio program, and you get some form of the following cryptic error:



unable to open `/dev/dsp', Device or resource busy


What does it mean and what can you do about it?



As to what it means - basically, an application somewhere isn't being very nice and sharing, like we have all be taught to do. Or it wants to hog the sound device all to itself and another app won't let it go. /dev/dsp is the device pointer for the default "dsp" or digital sound processor and, as audio remains a bit of an Achilles heel for Linux, there can be problems in the sandbox.



So what you need to do is to figure out which app currently has locked, so maybe you can quit that application to allow our other one to access it. You might think of using lsof or fuser to figure it out. So you check:



$ lsof /dev/dsp
$ fuser /dev/dsp


But unfortunately, it won't show you anything. I think this is because /dev/dsp is just an affectation, which allows Linux to point wherever it really wants to.



In this case, it is the /dev/snd/* files. It is here you want to see who is grabbing things:



$ ls /dev/snd
controlC0 hwC0D2 pcmC0D0p pcmC0D1p pcmC1D0c seq
controlC1 pcmC0D0c pcmC0D1c pcmC0D2c pcmC1D0p timer
$ lsof /dev/snd/*
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
VirtualBo 4083 jdarnold mem CHR 116,10 4395 /dev/snd/pcmC0D0c
VirtualBo 4083 jdarnold mem CHR 116,9 4390 /dev/snd/pcmC0D0p
VirtualBo 4083 jdarnold 40r CHR 116,2 0t0 4102 /dev/snd/timer
VirtualBo 4083 jdarnold 42u CHR 116,10 0t0 4395 /dev/snd/pcmC0D0c
VirtualBo 4083 jdarnold 43u CHR 116,12 0t0 4411 /dev/snd/controlC0
VirtualBo 4083 jdarnold 44r CHR 116,2 0t0 4102 /dev/snd/timer
VirtualBo 4083 jdarnold 45u CHR 116,9 0t0 4390 /dev/snd/pcmC0D0p
VirtualBo 4083 jdarnold 46u CHR 116,12 0t0 4411 /dev/snd/controlC0
kmix 4155 jdarnold 12u CHR 116,12 0t0 4411 /dev/snd/controlC0
kmix 4155 jdarnold 13u CHR 116,5 0t0 4560 /dev/snd/controlC1
$ fuser /dev/snd/*
/dev/snd/controlC0: 4155 4800
/dev/snd/controlC1: 4155
/dev/snd/pcmC0D0c: 4800m
/dev/snd/pcmC0D0p: 4800m
/dev/snd/timer: 4800
$ ps -c 4800
PID CLS PRI TTY STAT TIME COMMAND
4800 TS 19 ? SLl 0:12 /usr/lib/virtualbox/VirtualBox -comment Debia


Pretty conclusive proof that it is VirtualBox using the device. So let's see what it looks like after I quit out of VirtualBox:



$ lsof /dev/snd/*
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
kmix 4155 jdarnold 12u CHR 116,12 0t0 4411 /dev/snd/controlC0
kmix 4155 jdarnold 13u CHR 116,5 0t0 4560 /dev/snd/controlC1
$ fuser /dev/snd/*
/dev/snd/controlC0: 4155
/dev/snd/controlC1: 4155
$ ps -c 4155
PID CLS PRI TTY STAT TIME COMMAND
4155 TS 19 ? S 0:00 kmix [kdeinit] -autostart


kmix, the KDE sound mixer program, is pretty good about things, and thus we no longer have a conflict:



$ ./dspinfo
Information on /dev/dsp:

Defaults:
sampling rate: 8000 Hz
channels: 1
sample size: 8 bits
block size: 1023 bytes

Supported Formats:
mu-law
unsigned 8-bit (default)
signed 16-bit little-endian
signed 16-bit big-endian
signed 8-bit
unsigned 16-bit little-endian
unsigned 16-bit big-endian

Capabilities:
revision: 1
full duplex: yes
real-time: yes
batch: no
coprocessor: no
trigger: yes
mmap: yes

Modes and Limits:
Device Sample Minimum Maximum
Channels Size Rate Rate
-------- -------- -------- --------
1 8 1000 100000
1 16 1000 100000
2 8 1000 100000
2 16 1000 100000


dspinfo is a small program I adapted from the exerpt for the old O'Reilly book Linux Multimedia Guide, which is Chapter 14. Programming Sound Devices. As I said, OSS (Open Sound System) is an old Linux standard, pretty much passed by in these days of 2.6 kernels.




Thursday, January 17, 2008