Saturday, November 18, 2006

Bluetooth Ahoy

We recently invested in a mid range Samsung mobile, Samsung X630. The most attractive feature of our latest acquisition was that it supports Bluetooth. Needless to say that from day one, I always meant to check the Bluetooth capabilities of this phone. Spread over a week, piece by piece, we got the opportunity to discover the hither-to unknown world of Bluetooth. Let me take you through our fascinating journey of exhilarating successes and nerve racking failures...

Our first step was to acquire a Bluetooth dongle. Fortunately bacchi was able to arrange one for us from one of her colleagues. We started with discovering the capabilities of the Bluetooth protocol stack built into Windows XP Service Pack 2. In fact, that is also when we first learnt that when Microsoft introduced Windows XP, they, in spite of being a Bluetooth SIG signatory, considered Bluetooth adoption so meagre, that they purposefully left out support for it in their Operating System. Microsoft's Windows XP SP2 bluetooth protocol stack, though, a boon for cheap bluetooth dongle users (like us), who do not have Widcomm drivers bundled with their dongles, has loads of limitations. More apparent of these, as we discovered, were -

(a) Inability on the part of our mobile to detect our desktop PC. Because of this, we were forced to stick to simplex file transfer (desktop to mobile only). From what I read on Net, I found that several other users had reported a similar problem with their mobiles. While there IS a Microsoft article which seems to talk about this and gives suggestions to fix it ("Turn Discovery On" in Bluetooth properties), it did not seem to somehow work in our case. However, as a first step to resolving this kind of a problem, you can read this article at -

http://support.microsoft.com/kb/870882

(b) Microsoft's Bluetooth protocol stack does not carry support for Bluetooth profiles like using a Bluetooth headphone, Voice Gateway etc. I HAVE used the Microsoft Bluetooth drivers to print to an HP OfficeJet 7410 All In One, so I know that works (more on that later). But, I don't know how effective is stuff like Dial Up Networking using the built in drivers. You can read all about the basics of Bluetooth capabilities of Windows XP SP2 at the following link -

http://support.microsoft.com/kb/883259#5

Also, some troubleshooting tips for Microsoft Windows XP SP2 Bluetooth stack can be found at -

http://support.microsoft.com/kb/883258

http://support.microsoft.com/kb/840635

Once, we had discovered that Microsoft's Bluetooth Protocol Stack was so painfully inadequate for our purposes, I decided to do some more googling in this regard. That is when, I came across this forum discussion -

http://www.howardforums.com/archive/topic/563654-1.html

It seems strange how sometimes a simple discussion between a group of individuals can turn your life around and open your eyes to an entirely new world. The most important part of this post was that it gave us a link to the Widcomm Bluetooth drivers version 5.0.1.801. These drivers are hosted at driverguide.com (which requires you to register free of cost to download them). I downloaded these drivers (it is a hefty 42 MB download) and began installing them, without much hope that they will work. Why? It seems that though most Bluetooth devices use the Widcomm protocol stack based drivers, each device has its own version of the drivers. There is no universal Widcomm driver as such which can be used with ALL these devices. Interestingly, installing these Widcomm drivers is also not as easy as downloading and simply executing the setup. Because these drivers are NOT WHQL certified, it seems the Microsoft Windows XP drivers take precedence over them. Hence, the moment you plug in the Bluetooth dongle, the Windows drivers take over. So, when the Widcomm drivers installation routine asks you to plug in the dongle, you need to click on 'Cancel' and continue the installation without plugging in the Bluetooth device. Only once the installation is complete can you plug in the dongle and then follow a set of routines to "update" the Bluetooth device's drivers to Widcomm's. Read about this at -

http://support.microsoft.com/kb/840635

It is also demonstrated beautifully, with pictorial representations, in the pdf document available at -

http://www.e-beam.com/support/Switching_from_MS_Driver_to_WIDCOMM.pdf

Interestingly, the drivers I downloaded, did not require me to manually update the Bluetooth drivers as mentioned in these articles. All I had to do, was to

- Download the drivers and execute them.
- Click on Cancel when asked to plug in the Bluetooth dongle.
- Once the installation was done, plug in the dongle and let the Widcomm drivers configuration routine automatically take over.

So, what did the Widcomm Drivers give us access to?

The Widcomm drivers created a new icon on our desktop and in the Start menu - "My Bluetooth Places". The features accessible via this link included -

(a) Being able to browse the files and folders made "Bluetooth Visible" on our mobile phone. We could also simply drag and drop files from the mobile phone to our desktop's hard drive. Also, since our mobile phone could now detect our desktop successfully, we were finally able to transfer files from our mobile phone to our desktop.

(b) A feature known as "Voice Gateway". Once, 'connected' to it, you can receive and answer your cell phone calls using the headphone and Mic connected to your computer. So, you no longer, have to tear away your headphone + mic combo to answer that all important phone call on your mobile. When you receive a call, you will automatically get a prompt on your computer, asking you if you want to accept the call. Once accepted, simply jab away on your combo.

(c) Though, this is a feature, we haven't explored as yet, you CAN use the Widcomm drivers to use a Bluetooth headset (headphone + mic combo) with your computer. Read all about configuring this at -

http://www.windowsdevcenter.com/pub/a/windows/2005/07/05/bluetooth.html?page=4

(d) You can also use Bluetooth to connect to Internet using a GPRS enabled mobile phone (another feature we haven't explored as yet). Read about the rudiments of this at -

http://www.geekzone.co.nz/content.asp?contentid=1524

(NOTE - You CAN achieve the same, albeit in a not so intuitive manner, with Microsoft's Bluetooth protocol stack as well. Check out the links given earlier for info on doing this).

So, are we happy? You bet we are. The next step is to buy our own Bluetooth dongle and explore the unexplored. And as they say in that McDonald ad, I am loving it :)

Some articles on Bluetooth theoretical basics -

http://www.mobileinfo.com/Bluetooth/FAQ.htm

http://www.bluetooth.com/Bluetooth/Learn/Basics


Sunday, November 05, 2006

About ID3 Tags and CDDB / FreeDB Databases

I have always been the kind of guy who likes to explore things on a need-to-know basis. When you are curious to know about something, you understand it better. In fact, that is how I recommend our new age education system should be like... Arouse a child's curiosity and you can make him learn anything.

The other day bacchi was ripping songs from a couple of hindi oldies discs that we have. We intended to later transfer them to our iPOD. The frustrating part was that
the mp3s created all had names that did not even remotely tell us which song it was (track 1, track 2 etc.). Now, I knew vaguely that there was a way I could associate these tracks with specific names, artists, albums, genre etc. So, I fired up google and started reading...

"ID3" in ID3 tags actually is an acronym which stands for "IDentify an MP3". As is clear from the name itself, ID3 tags are specifically associated with the MP3 format files to add "textual / graphical" information to them. So, what is analogous to ID3 tags for the other new age formats? you may ask. Well, read about it yourself at -

http://www.id3.org/intro.html


ID3 is actually a container which helps add meta data like artist name, genre, album, lyrics, album art etc. to a MP3 file. Its first version was ID3v1. It suffered with limitati
ons like it being a fixed-size 128-byte tag that resided at the end of the audio file. It could include title, artist, album, year, genre and a comment field. Also, the fact that it resided at the end of the file, made it a very unattractive proposition to be used with streaming media. After all, what was the use of being able to see the artist's name once the song was over? These limitations prompted the need to create a II version of ID3 tag, its more popular variant, ID3v2. To quote from ID3.org -

"ID3v2 is a new tagging system that lets you put enriching and relevant infor
mation about your audio files within them. In more down to earth terms, ID3v2 is a chunk of data prepended to the binary audio data. Each ID3v2 tag holds one or more smaller chunks of information, called frames. These frames can contain any kind of information and data you could think of such as title, album, performer, website, lyrics, equalizer presets, pictures etc."

(http://www.id3.org/easy.html)

The next question is how to edit ID3 tags and put all sorts of useful information in them. There are a lot of tools out there which can help you edit ID3 tags. In fact, Wind
ows XP also allows you to edit some amount of ID3 information natively (it is an ID3 aware OS, you may say).

ID3 tags can be edited in Windows XP by bringing up
a file's properties and navigating to the summary of the file. From here, under the advanced view, tags such as Artist, Album, Year, Track Number, Genre, and Title can be edited. However, XP doesn't allow the user to edit advanced parameters, such as album cover and lyrics.

(http://en.wikipedia.org/wiki/ID3)


However, my experience told me that Windows XP was woefully inadequate t
o edit ID3 tag information. For most of the files, it won't even show up all the information as editable. Hence, the need to try a tool like ID3 TagIT (http://www.id3-tagit.de). The high point of this tool was its ability to batch edit the ID3 tags. This is especially handy if you have a huge MP3 collection waiting to be 'tagged'. My only grouse with this tool was that while most of the information I filled in using this tool, got updated fine in my iTunes Music Library, iTunes just refused to detect the album art I updated in the ID3 tags using this tool. Now, whether it was iTunes playing the spoilsport or whether it was the Tag editor at fault, I could never diagnose for sure. But, being stuck up with iTunes to transfer my MP3 to our iPOD, I ended up using the Tag editor built into iTunes to edit the tags. iTunes has a very easy way to edit the ID3 tag information. You can read more about this at the following CNet site -

http://www.cnet.com/4520-7899_1-6306475-1.html?tag=more


Also, read about how to get the ID3 album art to display on your iPOD screen at -

http://docs.info.apple.com/article.html?artnum=300262

The most critical thing about the latter is that you must update the album art info in the mp3s BEFORE you transfer them to your iPOD.

To enjoy this feature, just make s
ure the "Display album artwork on your iPod" preference is selected in iTunes before you update your iPod.

In case you had enough of these ID3 tags, lemme tell you, very briefly, about a quick way of getting these tags updated automatically when you are ripping tracks from a CD and converting them into the MP3 format - "online CD databases like Gracenote's CDDB database and the open source project, FreeDB." Most of the CD ripper applications (incl. Apple's own iTunes) are linked to either one of these databases to automatically get the tag information about the tracks in the CD.

To look up CD information over the Internet, a client program calculates a nearly unique disc ID and then queries the database. If the disc is in the database, the client is able to retrieve and display the artist, album title, tracklist and some additional information.

(http://en.wikipedia.org/wiki/FreeDB)



Gracenote's CDDB database is a database which started off as users submitting tag information to a shared online database, now dubbed as CDDB1 (by Gracenote). While submission to this database is still (obviously) free (though the final inclusion is now monitored by Gracenote), application developers have to pay some fee to link to this database. Being in existence for a much longer time, it has far more inform
ation than its cousins like the open source project FreeDB (www.freedb.org) OR Musicbrainz (www.musicbrainz.org). Apple's iTunes links to the the Gracenote CDDB (or more accurately, CDDB2) database to get access to the track related information about the CDs you 'import' (Apple does not call it ripping) using it. Read all about importing files from CDs using iTunes at -

http://www.askdavetaylor.com/how_do_i_have_itunes_rip_cds_into_mp3_format.html

and

http://www.apple.com/itunes/hottips/

I am still too lazy to go about reorganizing my entire music collection (it fills up GBs of space on my hard drive) with the right ID3 tags. But, I now know how to get my little software toolkit to do that automatically for me the next time I choose to rip
a song to my hard drive.

Saturday, September 30, 2006

Finally bit The Apple

Well, we have finally bit 'The Apple'. Yes, it is THE Apple, because it does not stand for the source of Adam and Eve's (and consequently all human beings') miseries. Rather, here it refers to our family's finally hopping onto the Steve Job Apple Corp bandwagon. Bacchi, it seems had decided to gift me a portable MP3 player on my b'day and on our recent visit to the mall, we all of a sudden decided to go for an iPOD. After considering all the factors - form factor, cost, storage capacity etc., we settled down for an iPOD Nano Gen 2 player with a storage capacity of 2 GB (differs from the I generation Nanos as per the features listed at - http://www.apple.com/pr/library/2006/sep/12nano.html).
I must admit, though, that the iPOD Nano met with some tough competition from its hard drive based 30 GB cousin - iPOD Video. However, cost considerations, battery life and the very improbability of ever actually using the iPOD to watch videos, won the day for Nano.

Now, let me talk about what went wrong in our first attempt to get our new toy to work...

1. Since, we had used the player with a Macintosh at the shop we had purchased it from, the player got formatted with the Macintosh's HFS Plus file system. So, no matter how hard we tried, the player would not get detected by our home PC. Fortunately, there is an article at apple.com which actually talks about how to get the player to again work with Window.

http://docs.info.apple.com/article.html?artnum=61672

An excerpt from the article -

You cannot use an iPod whose disk is configured for Macintosh on a Windows-compatible computer. However, you can restore the iPod disk to use it with a Windows-compatible computer. To do this, see "Restoring iPod to factory settings." While a Windows formatted iPod may work on a Mac, Apple supports this configuration only with iPod shuffle.

2. In our eager attempts to get the iPOD functional as soon as possible, we bypassed downloading the latest version of iTUNE software, iTUNE version 7.0. A BIG mistake! as it later turned out to be... The old iTUNE software that I had loaded from a CHIP DVD, failed to recognize the player. Also, running quite true to the adage - "A little knowledge can be dangerous", I ended up corrupting the entire software present on the player. Finally, this apple article helped me restore the player to its factory condition -

http://docs.info.apple.com/article.html?artnum=60983

It is important to understand the difference between "update" and "restore". Update simply installs the software that controls iPod and does not affect the songs and files stored on iPod's disk. Restore erases the iPod's disk and restores iPod to its original factory condition.

3. New iPOD users may also note that Apple claims that a 5 Rs troubleshooting methodology will fix most of the issues with the iPOD players. You can read about these 5 Rs

Reset, Retry, Restart, Reinstall, Restore.

at - http://www.apple.com/support/ipod/five_rs/

4. Well once we had the iPOD detected by our PC, it was time to actually start transferring music to it. The tutorials available at this link were a great assistance in helping us harness the full potential of our iPOD -

http://www.apple.com/support/ipod/tutorial/index.html

5. Also, if you like me, are interested in using your iPOD as a USB storage device as well, do make sure that you go through the article at this link -

http://docs.info.apple.com/article.html?artnum=61131

Select "Enable disk use" or "Manually manage songs and playlists". Either one will allow you to use iPod as a drive. If you select "Manually manage songs and playlists", iTunes won't automatically update iPod with the iTunes library. If you want iTunes to automatically update your iPod, select "Enable disk use" instead.

6. And finally something I stumbled across in course of my research. According to the apple article at this link -

http://docs.info.apple.com/article.html?artnum=61131

you cannot access the songs transferred to the iPOD using the iTUNES software (a means to control illegal music sharing, I suppose).

When you use your iPod as a hard disk, you can't see the media iTunes copies to your iPod in the Finder or My Computer. This is normal. Using the Finder or My Computer, you can't copy these media files from your iPod back to iTunes or to any other computer. The synchronization between your iPod and your computer is one way: from iTunes to iPod.

However, the steps given in the article at this link, easily enabled us to accomplish this seemingly 'impossible' task -

http://www.cnet.com/4520-7899_1-6477981-1.html

I must admit that once we had the initial migration blues sorted out, we really started to enjoy our latest acquisition. I think, one thing that makes the iPOD such a cool gadget is the very design of the device - the soft aluminium body, subtle shades, sharp fonts and a high resolution (although small) screen. No wonder, we are hooked for good.

Saturday, September 23, 2006

Safely Remove Hardware

I have lately been reading about "Safely Remove Hardware" option in Windows. Here are some details I have found about this feature -

(1) Was first introduced in Windows ME. Has since been a part of Windows 2000 and Windows XP. Windows 98, unfortunately, lacked this feature.

(2) As Garycase has clarified on Experts Exchange -


There are two issues associated with removing a USB device: (1) possible data corruption; and (2) possible electrical damage. For (1) the problem is that Windows does deferred writes to removeable devices, and if you remove one before it has completed the write process (which can be several seconds after it's "apparently" done) you will have a corrupted drive. As noted above, if you change the settings for the device to optimize it for quick removal, you can disable the write caching feature and then you don't have to worry about this ==> but it will make writes MUCH slower, particularly when copying many small files, as it will close the directory after each file. For (2) there's no workaround -- you're simply taking a risk every time you pull the device out; and any electrical "glitch" can damage either the device itself or your PC's USB port. There are MANY examples in questions here on EE where folks have destroyed USB flash drives; their USB ports; an MP3 player; etc. by not following the "Safely Remove" protocol.

Bottom line: Think of "Safely Remove" as a seat belt. You'll "get by" without using it MOST of the time; but at some point you'll have an accident (i.e. you'll damage your device) and then you'll wish you had used it. If you aren't patient enough to do so, just keep "yanking away" ==> but don't be surprised when your device fails.

Additional note: If a device is self-powered (i.e. uses no power from the USB bus), and is ONLY used for reading data from the device (no writes), then it is much safer to simply "pull" the device. Common devices in this category are digital cameras, or compact flash cards used in powered external readers (e.g. a card reader slot on an all-in-one printer). In those cases, it's "okay" to just pull the device ==> since there's no power issue with the bus and no deferred writes (since nothing's been written to the device).

(3) The "data corruption" issues asssociated with not using "Safely Remove Hardware" option are also discussed in detail over here -

Changes in Windows XP Beta 2

Refinements to Caching Policy for Consumer Storage
Essentially, anything a user can physically remove from a machine could be removed from a running system without prior warning to the operating system - for example, any kind of device on CardBus, PC Card, USB, IEEE 1394, and so on. However, the area of greatest concern is storage devices, because of the possibility of data loss or corruption when surprise removal of these devices occurs.

To mitigate the likelihood of data loss in these scenarios, Windows XP has a refined caching policy for removable storage. As of Windows XP Beta 2, for consumer-oriented removable storage (USB, Flash, Zip, and so on), write caching is disabled by default.

Disabling write caching means that, instead of saving up changes for a file on a removable storage device and then doing a bulk write, Windows XP writes changes to the file as the changes are made. This keeps data on removable storage devices more current, mitigating the likelihood of data loss. However, disabling write caching also has a performance impact. Therefore, for IEEE 1394 hard disk drives, Windows applies a special case for the default caching policy by not disabling write caching for these devices.

The basic way to think of write caching policy is:
- If write caching is disabled by default, the storage device in question is optimized for safe surprise removal. This is the appropriate action for slower, consumer-oriented storage devices such as flash-type memory.
- If write caching is enabled by default, the storage device in question is optimized for performance. This is the appropriate action for high-performance storage such as SCSI and IEEE 1394 hard disk drives.

Note that caching policy defaults for a given device can be changed in Device Manager.

Optimizing the Default Caching Policy
As noted earlier, in Windows XP Beta 2, IEEE 1394 hard disk drives have write caching enabled by default, to optimize for performance rather than for safe surprise removal. This also means users should first stop IEEE 1394 hard disk drives using the hotplug applet before removing them. However, the Beta 2 mechanism for special-casing IEEE 1394 hard disk drives requires additional refinement.

This content has been culled from the Microsoft site - http://www.microsoft.com/whdc/system/pnppwr/hotadd/XPrem-devs.mspx

(4) Is applicable for all hot swappable devices like - IEEE 1394 devices and USB devices.

(5) In case, you got a hot swappable mass storage device plugged in and you do NOT get the "Safely Remove Hardware" option to STOP the device before unplugging it, you can use the following instructions to manually invoke the "Safely Remove Hardware" option -

You can click on Start, Run..., and type in:
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll
And press OK.
That will bring up the "Safely Remove Hardware" dialog.
A side effect could be that the "Safely Remove Hardware" icon reappears as it should.
If it happens often enough, you can create a desktop shortcut for this geeky looking command.

These instructions have been pulled from the site -
http://ask-leo.com/safely_remove_hardware_where_did_the_icon_go_how_do_i_safely_remove_hardware_without_it.html

(6) Bottom line -

If it is a hot swappable mass storage device, you MUST stop the device before you unplug it. In this case, you might go to the extent of manually invoking the "Safely Remove Hardware" wizard.
If it is just any other hot swappable device and is self powered, go ahead, unplug it without any need to STOP the device.
If it is a hot swappable device, NOT self powered and NOT a mass storage device, see if you can locate the "Safely Remove Hardware" wizard. If you can, stop the device before you unplug it. If you cannot, well go ahead and yank it out anyway.