< August 2007 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 
Tue, 14 Aug 2007:

Ever notice how hard it is to get something when you exactly know what you want ? Especially when you had it once and lost it ? Ever notice how hard it is to settle for whatever's available and you keep looking & looking, getting more depressed about the lack of choices ?

I'm not talking about true love, as much as these things might be be applicabl,e but just about an mp3 player. My needs were simple. It had to have at least 4 gigs of space, an enqueue feature, decent battery life, a standard USB cable and for less than 150 USD. My last mp3 player had all that and looked cool while doing it - a black Creative Zen Neeon2. It survived several long walks on rainy days, had no front controllers which meant I could operate while it was still in my pocket. But one weekend I left it at my office desk and come monday it was missing.

So, four months later, I started looking for a replacement - but they don't sell Zen Neeon2 in the US anymore. And every other player I found had a proprietary adapter - the iPod, the new Sansa e2xx, even the new Creative vision stuff. Nearly after a week of crawling through specs & window shopping, I finally discovered that the Creative Zen V plus had nearly everything I wanted (looks cheaper and *is* cheaper than an equivalent iRiver).

Bought one, plugged into my laptop and zilch happened. As it turns out, it uses a crappy MSFT protocol called MTP - so much for open interfaces. But that's where Amarok came to the rescue ! Amarok incorporates libmtp5, which lets me just drag & drop between Amarok collections and the mp3 player. Except, I had to apply the following patch to make it plug'n'play (launchpad bug #132392).

But the effort is worth it. Even Album art transfer from Amarok is completely taken care of. Mtp sort of sucks because it does the file transfer in user mode (freezing amarok) rather than kernel buffering that usb-storage gives. But on the flip side is that that unlike the usb-storage players, the usb charging will work even if the player is playing (as long as it is not mounted on Amarok). I'm sort of building a hack to submit my play counts to my last.fm account from the statistics returned by the mtp-tracks commandline client, but it doesn't give last played time to sort of fake an offline update for the correct time - the spam filter in last.fm blocks a bulk update of tracks at the same time.

Now that it's working, time to play with my next new peice of hardware ...

--
The real trouble with reality is that there's no background music.

posted at: 14:34 | path: /hardware | permalink | Tags: , ,

Fri, 02 Feb 2007:

Unlike my trip to LCA last year, which was blessed with some awesome photos, this year I've not put up too many photos yet. But this is not due to the lack of photos taken. I place the entire blame on one little library called libgphoto2 which is refusing to read my photos off my camera.

[gopalv@sirius photodump]$ gphoto2 -L

There are no files in folder '/'.                                              
There are no files in folder '/store_00010001'.
There are no files in folder '/store_00010001/DCIM'.
There are 99 files in folder '/store_00010001/DCIM/189CANON':

#1     IMG_9445.JPG  1982 KB 2592x1944 image/jpeg
....
#98    IMG_9981.JPG  1704 KB 2592x1944 image/jpeg
#99    IMG_9982.JPG  1705 KB 2592x1944 image/jpeg
*** Error (-3: 'Out of memory') ***       

For debugging messages, please use the --debug option.

From a quick glance, I think my photo collection has hit a unique boundary condition. The photo counter on my camera (which has been heavily used) has touched 10,000 and rolled back to img_0000.jpg into another folder, which is confusing gphoto2 totally.

Philosophy vs Pragmatism: I remember one of those common room conversations about laptops. There was a distinct proliferation of Macs in the room and this particular dilemma tradeoff was thrown into discussion. I think it was Arjen who commented that running Linux shouldn't be an apology for poor performance of hardware - while we were on the topic of OpenWRT and how the conference APs weren't auto-switching off congested RF channels.

I'm at the doorsteps of such a dilemma. One of my friends commented that, if something doesn't work, just drop it and use whatever works. But as a conscentious developer, I'm conflicted between fixing gphoto2 and plugging my camera into someone's Mac (windows ? what do you mean windows ?). I'm pretty sure that one of these weekends I'll pull gphoto2 off SVN and build myself a debug version. But I'm not likely to do that if I actually plug my camera into somebody's Mac and pull my photos out.

But I did manage to upload a few photos, grabbed off the other SD card. Here're the only ones I've managed to upload, so far.

Hmm... this may take a while.

--
The makers may make
and the users may use,
but the fixers must fix
with but minimal clues.

posted at: 09:29 | path: /hardware | permalink | Tags: , ,

Tue, 09 Jan 2007:

As I walked into my room on Friday, I was planning to sit down and rewrite a fair bit of code in apc codebase. But my hard-disks had other plans for me. Both my 80 gig boot drive and my 200 gig sata drive had conked out, overheated in the middle of winter. The smaller drive had my /home and uncomitted work of about four months. The codebase had its cvs repository on the sata disk, which was thankfully working, though freezing up randomly. After a few hours of trying to copy out the cvsroot with a live CD, I tried to debug with smartctl on the dying drive.

bash# smartctl -d ata -l selftest /dev/sda

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description  Status            hours   LBA
# 1  Short offline     read failure 90%   2160   288074266
# 2  Extended offline  read failure 90%   2155   290472493
# 3  Short offline     read failure 90%   2155   290472493

bash# smartctl -d ata -A /dev/sda

5 Reallocated_Sector_Ct  Pre-fail  Always  41253

Basically a large number of sectors were bad and even an e2fsck couldn't complete on the disk without hitting the damaged sectors. After a lot of patient fiddling with debugfs, I managed to recover about 2/3rds of my cvsroot - but a fat lot of good that does. But in the process, I learned about a large number of tools available for data recovery, like badblock_guess, which reminds me of my b0rk-copy hacks. But as I said, I got a fair amount of data out of the second disk - but the first one was a total goner, not even spinning up on power-on.

Eventually, I went out, bought a couple of disks to replace these - 160 and 320 gigs, which are both SMART compatible. But to prevent the overheating from recurring, I tried to write my own alerts using inotify to warn me whenever the temperature exceeds limits. But as it turns out somebody has already done it and done it well - sensors-applet + hddtemp.

And this time, I'll be burning backups - I swear !

--
The primary cause of failure in electrical appliances is an expired warranty.
                     -- Dave Barry

posted at: 02:45 | path: /hardware | permalink | Tags: , ,

Thu, 30 Nov 2006:

Eventually having connected my amd64 desktop upto a decent internet connection, I decided to wipe the FC3 install on the box and replace it with ubuntu. I left my i686 gentoo install alive and started out on an Ubuntu 6.06 LTS (aka Dapper Drake) install, sometime around 11 PM.

My hardware setup is not what I would call conventional. Inside my monster tower I have four SATA ports - two of them on the motherboard and a couple more on my RAID controller. The first port is occupied by my 10k RPM 80gig drive which is basically my boot drive. The other onboard port has a 120 gig drive, which is my secure (AES256) storage and is hardly ever mounted. There are two 200 gig SATA drives connected to the RAID controller (Promise), which after a couple of abortive attempts with dmaraid, have ended up as discrete SATA disks instead of in RAID-0.

Now, as soon as the Dapper liveCD boots, the disks on the RAID subsystem show up as sda and sdb. The onboard SATA controller gets relegated to sdc and sdd. I thought it was strange, but I picked the renamed partitions and went through a complete install with this setup. The first reboot just froze the machine with a pretty GRUB on the left corner. Modifications of device.map, replacing the hd1 entries in the boot menu did nothing either. Whatever I tried, the machine just threw up a blank GRUB stage1.

As it turns out the BIOS and grub still recognize the onboard SATA channels as the first pair of hard disks, but half-way through stage2 of the boot the kernel takes a flip and then it all goes south for the summer. Faced with the renaming, I tried to connect the boot drive to the RAID controller, just to bring it back to sda. But as it turns out my BIOS can only boot off onboard primaries. Which all left me up shit creek without a paddle.

Now, dapper is not without its advantages. The live CD installer meant that I could do more than just watch the lines scroll while the installer did its magic (anyone remember the caldera tetris games ?). So I still had a functional internet browser even though my machine wasn't booting (grub ensured that I couldn't boot gentoo).

Thanks to the internet, I came to know that I wasn't alone (*play x-files music*). Turns out somebody had run into this Grub of Death before. Also there lay open a launchpad bug in the helpful status called CONFIRMED, which basically meant I had run into something real (like an iceberg). As luck would have it, someone had already sent a patch to work-around the problem in kernel land - and it had been rejected. All this was no help at all, till I discovered magic beyond mere device names.

UUID mounts: /etc/fstab could use other identifiers than raw device names to uniquely identify drives. And the first patch I discovered dates from 2001 - this must've been the *best kept secret* in linux kernel land. As it turns out, both grub and /etc/fstab will accept volume UUIDs, completely transparently. But still the installer couldn't figure out where to put grub or what to put in it. At around 3 AM, I managed to pry open my machine, pull out the off-board SATA and attempt a reinstall.

The system reinstall went almost perfectly. All that was left to do was to replace the device names in the relevant sections with the correct UUID volume names. The unique identifiers can be read easily using the blkid command. A couple of reboots later, I plugged the RAID controller back in and added those partitions similarly.

It all worked out, eventually. But the amount of effort it took to get it working reminded me of those nights in 1999, spent struggling with an X configuration, with some magazine's help section open.

--
"First things first -- but not necessarily in that order."
                -- Doctor Who

posted at: 21:45 | path: /hardware | permalink | Tags: , ,

Thu, 12 Oct 2006:

I finally got my camera repaired. It cost a whopping 6,800 INR to replace the cracked LCD and backlight-panel - I could've bought a brand new camera for a little more, but I liked to get back my original camera. Some of the pictures I've taken with it while it was broken were good, but I saw the difference when I had the full LCD screen and all the visual controls set. Here's a sampler from my train ride on monday.

Amazing photographs and some of my best pictures of Kerala so far. The weather is more to credit than my camera though - a calm, quiet morning after a stormy night, blue skies and all.

--
There is one advantage to having nothing, it never needs repair.
                                -- Frank A. Clark

posted at: 00:34 | path: /hardware | permalink | Tags: ,

Sat, 24 Dec 2005:

RAID-0 has been causing problems for me over the last few days. Finally I opened up the bloody box and re-connected the two 200 GiB hdds to the main SATA controller. Took some time to actually push all the data onto a borrowed 250 Gib usb hdd - before I broke up the RAID-0 setup. After all that, now the system is back to normal.

/dev/sdb1              47G   42G  4.9G  90% 
/dev/sdb2              47G   15G   33G  31% 
/dev/sdb3              92G   48G   40G  55% 
/dev/sdc1              48G   34G   15G  71% 
/dev/sdc2              48G   48G  159M 100% 
/dev/sdc3              90G   42G   44G  49%

Looks like I can finally throw out Fedora Core 3 out of the box.

posted at: 16:31 | path: /hardware | permalink | Tags: , ,