Wednesday, May 4, 2011

Language input (and disable IPv6) for my Kubuntu 11.04 desktop

Setting up a Kubuntu (or any other distro/flavour) is a one time pain - and things have gotten easier. But still work has to be done... It's not difficult, but it's troublesome for me to find the information time and again - so might as well blog it. I'm covering language input, disable IPv6 here. I'm on Kubuntu 11.04 btw.

Added Japanese/Chinese input

In the KDE menu, run System Languages. Select the languages (in my case, Chinese and Japanese) you want, and check the input methods and extra fonts. It doesn't end there - this GUI method is still not perfect yet. I needed to append this to my ~/.bashrc
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
You might wanna restart your X session (log out, log in) and then see if there's a language input icon. If there's isn't, just run ibus-daemon. There's a need to add the languages to the input as there isn't any set by default: go to Preferences -> Input Method -> Select an input method (say, Japanese -> Anthy) -> Add. This will provide the language option when pressing Ctrl-space. やったー!

Disabling IPv6

The reason for me to disable IPv6 is that the kernel does sometimes take time to look up IPv6. Maybe I'm wrong on this, but well, no harm done if it isn't. I'm running on SSD and I want things to be fast. Just append to /etc/sysctl.conf
#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Ok, done.

I've also noticed the my DVD drive delayed my boot up time by a lot (though it seems to be still working as per normal). Saw the Emask error when i run dmesg (happened to my other hard drives before, which eventually they died. zzz). I replaced the DVD drive with a new one and lengthy bootup problem was solved. Here's the error message for your reference.
[ 34.000061] ata7.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 34.000065] ata7.00: failed command: IDENTIFY PACKET DEVICE
[ 34.000070] ata7.00: cmd a1/00:01:00:00:00/00:00:00:00:00/00 tag 0 pio 512 in
[ 34.000071] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 34.000073] ata7.00: status: { DRDY }
[ 34.000076] ata7: hard resetting link
[ 34.550049] ata7: softreset failed (device not ready)
[ 34.550053] ata7: applying SB600 PMP SRST workaround and retrying
[ 34.750059] ata7: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 34.752058] ata7.00: configured for UDMA/100
[ 34.752784] ata7: EH complete

Wednesday, April 27, 2011

New SSD for desktop and "Clocksource tsc unstable" issue

Gotten a new SSD for my system - the Intel 320 120GB. Decided to reinstall my desktops, so I also spent time on looking for optimizations for my kubuntu (11.04) desktop. There's quite a number of posts out there on this topic, I found a SSD checklist pretty neat - but I lost the link (gah, combination of Blogger and my stupidity - I saved the draft with the link -> Blogger gave me a META error when I tried to publish the post -> I cut and pasted the content into a text editor, forgetting that it's plain text -> Saved the draft and lost the link. If only Blogger has a certain version control). Here's an alternative one. It even explains what you are actually doing too. I admit I cheated by using windows 7 to create the partitions - 1) going thru fdisk is a bit troublesome and requires calculation. 2) (kde) partition manager does not align the default starting cylinder at 64k. 3) gparted probably does the alignment correctly - but somehow not all the time for me. Time to be pragmatic.

As I'm dual booting, I installed Windows 7 first. After all the updates and stuff, it takes around 15 seconds to boot. There's also tweaks for Windows, such as turning off hibernation to save disk space on the tiny SSD. Great.


Next, I installed the Kubuntu 11.04. However it seems to boot up slower than Windows by a lot, varying from 15s to a few minutes! It sucks to be not able to see the verbose booting (why did the developers take that option away? Let me know if you know the answer to do it - It used to be ALt-F2 I think?), booting with/without the splash and verbose option doesn't help too. Anyway, I ran dmesg and noticed this
[ 3.970543] generic-usb 0003:08BB:2706.0004: input,hidraw3: USB HID v1.00 Device [Burr-Brown from TI USB Audio DAC ] on usb-0000:00:12.0-3/input2
[ 207.671545] Clocksource tsc unstable (delta = -188978571100 ns)
Seems that the default clock source for the kernel is off. 200 seconds wait is I solved it by adding clocksource=hpet to the booting entry. It's a temporary fix. To make the fix permanent, change the entry in /etc/grub/default
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash clocksource=hpet"
and then run grub-update to update the kernel listing.

Now it's much faster than before. It's probably a problem that existed earlier, yet I had never noticed.

Thursday, March 24, 2011

Preventing my Debian desktop to mount my MTP/MSC device as MTP

Done this before some time ago, and I've forgotten about it. Then the issue bites back at me. So might as well blog it in case I forget again. I looked around on the net, and most of the solutions were pointing me to disabling MSC instead of MTP.

I don't like MTP. The Sony NWZ-E438 I've gotten recently is both MTP/MSC. If you were on Windows, you could see this device mounted as an external drive (MSC) and also as MTP in Windows Media Player.

In Debian (or probably other Linux desktop as well), the computer will identify this device as MTP, and preventing it to be mounted as MSC.

So what I'm doing here is to not let HAL identify the device as MTP. The file at/usr/share/hal/fdi/information/20thirdparty/20-libmtp8.fdi has the entries for the different mp3 players. Just comment out the entry for your device.

>If the libmtp8.fdi file doesn't exist in that location, you could try finding it
find /usr -name *libmtp*
Can't find your device in the list? lsusb would give you the ID, my device gives:
Bus 002 Device 002: ID 054c:0385 Sony Corp.
Then find the corresponding entry in 20-libmtp8.fdi and comment out the entire entry by adding at the end.

Maybe there's a better way of doing this (blacklisting the mtp module? or just delete the fdi file?), as that fdi file could get updated from system updates. If you know a better solution, let me know. :)