Archive for October, 2011

Firefly Media Server and Banshee

If you have more than 10k audio tracks on your NAS box, reading all the metadata is rather slow via Samba or NFS. There are various ways to access multimedia over LAN, DLNA/UPnP is good enough for videos, Digital Audio Access Protocol is better for audio. DAAP originates from Apple’s iTunes, it is based on HTTP and most of the Free Software implementations are actually reverse engineered, because Apple hasn’t exactly provided proper documentation if I am not mistaken.

There are various DAAP servers besides iTunes itself, the most used one seems to be mt-daapd. The author of mt-daapd has abandoned the project and there’s a bunch of forks on the web: Firefly Media Server, the more up-to-date forked-daapd and probably others.

DD-WRT’s Optware repository contains mt-daapd and mt-daapd-svn packages, first one seems to be pretty much obsolete version, the second one seems to carry Firefly Media Server branding. That’s also the package I got working on my router. The configuration for those of you who are interested sits in at /opt/etc/mt-daapd/mt-daapd.conf:


[general]
web_root = /opt/share/mt-daapd/admin-root
port = 3689
admin_pw = mt-daapd
db_type = sqlite3
db_parms = /mnt/disc0-part1/.mt-daapd
mp3_dir = /mnt/disc0-part1/Muusika
servername = Firefly on rt-n16
runas = nobody
extensions = .mp3,.m4a,.m4p,.flac,.ogg
logfile = /mnt/disc0-part1/.mt-daapd/mt-daapd.log
rescan_interval = 0
always_scan = 0
scan_type = 0
compress = 0

[plugins]
# Banshee fails to play transcoded FLAC stream so I disabled
# ssc-ffmpeg.so and ssc-script.so plugins by deleting them
plugin_dir = /opt/lib/mt-daapd/plugins

[scanning]
process_playlists = 0
process_itunes = 0
process_m3u = 0

Once started Firefly Media Server scans the music directory for audio files, stores meta-information and afterwards starts listening on port 3689, that’s also the standard port for DAAP. You can fire up a browser and see how it’s doing, the login in this case is admin and mt-daapd. The web interface seems to be the “right” place to shut down the media server because the process is not properly handling SIGTERM or SIGKILL, you can also reinitiate the scan from the web interface.

Now once Firefly is up and running, you can connect to it using iTunes, but being an open-source zealot, I don’t have much Apple gear lying around! On Ubuntu you can try out Rhythmbox, and it’s buggy bro Banshee. Banshee is written in C# and those guys have written some funky code that exposes it’s local cache and what not on http://localhost:8089. Note that Firefly by default transcodes FLAC and OGG to uncompressed WAV, but Banshee doesn’t play with that well.

For all the hackers out there: having a HTML5 based player interface in Firefly would be a bliss!

No comment »

Configuring fingerprint reader for Ubuntu 11.10

Here’s another hopefully useful how-to for getting Thinkpad T420 fingerprint reader running under Ubuntu 11.10:

Install required packages:

sudo apt-get install fprint-demo libpam-fprint

Add udev rule for setting the group ownership of fingerprint reader device:

echo "ATTRS{idVendor}==\"147e\", ATTRS{idProduct}==\"2016\", MODE=\"0664\", GROUP=\"fingerprint\"" \
    | sudo tee /etc/udev/rules.d/99-fingerprint.rules

Create group and add user to that group:

sudo groupadd fingerprint
sudo gpasswd -a lauri fingerprint

Reconfigure PAM and enable “Fingerprint reader”:

pam-auth-update

Reboot the machine so the udev would create the fingerprint reader device node with proper permissions. At the moment I am not familiar how to force udev to recreate the node and unplugging the fingerprint reader is not “feasible”.

Finally scan your fingerprints:

fprint_demo

Both, authentication in the login manager and sudo, should work with fingerprints now!

No comment »

Configuring Evolution for Gmail

There’s many different guides for setting up Evolution for Gmail, but I haven’t found a perfect one. So here goes yet another one:

Receiving mail

Server type: IMAP+
Server: imap.gmail.com
Port: 993
Username: first.last@gmail.com
Use secure connection: SSL encryption
Authentication type: Password

Sending mail

Server type: SMTP
Server: smtp.gmail.com
Port: 587
Server requires authentication: yes
Use secure connection: SSL encryption
Authentication type: Login
User Name: first.last@gmail.com

No comment »

Bricking Samsung Galaxy S2

Hey everyone, it has been a long time since my last post. There’s much fuss around installing custom firmware on Samsung Galaxy S2, so I wanted to figure out how it exactly works.

First of all most Android customized ROM’s, eg. CyanogenMod, VillainROM, DarkyROM aren’t exactly ROM images, they’re zipped filesystem overlays of the original stock firmware root filesystem. This means that in order for the customization to work, you first need to have properly booting stock firmware.

To install these customizations you need to have a rooted phone. Rooted phone basically meanss that you can run the classic UNIX command “su” to become the root user. There are hacked kernel images available on the XDA developers for various versions of Galaxy S2.

Utilities called Odin and Heimdall are available for directly manipulating the built-in flash storage of Samsung Galaxy phones. Odin seems to be available only for Windows so it’s out of the scope of this blogpost. Heimdall is a cross-platform command-line utility with similar purpose.

Rooting Samsung Galaxy S2 is easy as booting it into the download mode, this means turning the phone off and holding Volume down and Home buttons while powering up the phone and uploading the hacked kernel using Heimdall:

# This kernel should work with stock Android 2.3.4 firmware of Galaxy S2 sold in Europe
http://attachments.xda-developers.com/attachment.php?attachmentid=651559&d=1310388033 \
    -O CF-Root-SGS2_XX_OXA_KG1-v4.1-CWM4.zip
unzip CF-Root-SGS2_XX_OXA_KG1-v4.1-CWM4.zip
tar xvf CF-Root-SGS2_XX_OXA_KG1-v4.1-CWM4.tar
echo "3a70ced0c96d947b4cb1983dcebd1584 zImage" | md5sum -c -
sudo heimdall flash --kernel zImage

The yellow warning sign is shown while booting with the hacked kernel – it’s okay. The hacked kernel image also installs two apps: ROM Manager and Superuser. First one allows the user to (re)boot into ClockworkMod Recovery. It is also possible to directly boot into ClockworkMod Recovery, just hold Volume up and Home while powering up the phone. It is always good idea to back up the current system. Move around in the ClockworkMod Recovery menus with volume up/down buttons.

The phone’s internal flash storage is called “SD Card” in the ClockworkMod Recovery although it’s not an actual SD card plugged into the SD card socket, so this means that you don’t need an SD card to install custom ROM. While running ClockworkMod, it is possible to mount the internal flash storage to your PC, this way you can upload the ROM zip to your phone. Once having the right zip file in your phone just select “Install zip from sdcard” while running ClockworkMod Recovery.

There are many custom ROM’s for Galaxy S2, the most popular CyanogenMod seems to be built from scratch and does not have the optimizations enabled for S2, it’s also rumored that is does not have support for hardware accelerated video decoding. I haven’t tried out VillainROM yet, but DarkyROM that is based on the original Samsung firmware seems to be running just fine.

OH AND OF COURSE YOU VOID ANY WARRANTY IF YOU FLASH ANY FUNKY STUFF ON YOUR PHONE

VillainROM
Darky’s ROM
Hacked kernels with CWM and SU on XDA developers
Heimdall
Root Galaxy S2 with Heimdall on Linux
Tips at CyanogenMod
Default PIT (Partition Information Table)

No comment »