Tuesday, August 18, 2015

Upgrade to Windows 8.1 with Gentoo and Ubuntu on Dual-Boot (Triple-Boot actually)

I finally upgraded Windows 8 to 8.1 on my laptop today. Yes, I know Windows 10 is available and I am behind time.

The installation (took almost four hours!) was completed with only one problem: it rendered my boot-loader "rEFInd" temporarily unusable. No panic. Nothing happened to the refind directory and nothing was deleted. The following steps will get refind up and running again: (I just copied and pasted part of the instructions from rEFInd's author Roderick Smith's website)

1. mountvol S: /S in the Administrator Command Prompt window

2. cd EFI\refind

3. bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi

That's all. Basically I just needed to reset rEFInd as the default EFI boot program. 

Tuesday, March 17, 2015

Convert WAV to MP3 using lame

Today I found a most excellent command line from the Ubuntu forums by mc4man. I'm just going to note it down here so that I don't have to go searching for it every time:

mkdir temp && for f in *.wav; do lame --vbr-new -V 3  "$f" ./temp/"${f%.wav}.mp3"; done

Sunday, January 18, 2015

International keyboard layout on Gentoo

This is my keyboard setup for an international layout because I used quite a lot of umlauts and eszett.

Entry from /usr/share/X11/xorg.conf.d/10-evdev.conf:

Section "InputClass"
   Identifier "evdev keyboard catchall"
   MatchIsKeyboard "on"
   MatchDevicePath "/dev/input/event*"
   Driver "evdev"
   Option        "XkbModel" "pc105"
   Option        "XkbLayout" "us_intl"
   Option        "XkbOptions" "compose:menu"
EndSection


The compose key is used to type "ß" because for a long while I couldn't for the life of me figure out how to get "Alt-Gr" to work on Gentoo. And then I found out that all I had to do was to map "Mode_switch" to the right Alt keycode.

Using xev, I found that the keycode for the right Alt is 108. So this is my entry in ~/.Xmodmap

keycode 108 = Mode_switch

And just for fun, this is how to map the "s" key so that you can type the capital eszett ẞ (not ß)

keycode 39 = s S ssharp U1E9E

For those who are curious as to how the keycode format works: here's the explanation I've taken from this website:


keycode  = <1> <2> <3> <4> <5> <6> <7> <8>
 
 
     <1>                           
     <2>                     
     <3>             <"Mode_switch"-key>
     <4>       
     <5>                <"Num_Lock"-key> 
     <6>               -
     <7>  <"Num_Lock"-"Mode_switch"-key>
     <8>              

Sunday, August 24, 2014

Gentoo, ALSA, mute speakers when headphones are used

Lenovo G400s 

Specifications:
lspci: 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)

cat /proc/asound/card0/code* |grep Codec :
Codec: Conexant CX20757
Codec: Intel PantherPoint HDMI

Kernel configuration: CONFIG_SND_HDA_INTEL=y and a hosts of other CONFIG_SND_HDA_xxx options.

I initially encountered a problem where the laptop speakers do not mute when I use headphones. As usual, the solution is very simple. 

Bring up the configuration for sound settings by typing alsamixer in the terminal. 

Enable the Auto-Mute Mode



Thursday, August 14, 2014

Gentoo, Black screen, Integrated Intel graphics

This is a record of a black screen problem that I initially faced after I installed Gentoo with kernel version 3.10 and below. 

Laptop: Lenovo G400S with rEFind as bootloader.
Integrated Intel graphics with Nvidia GT720M

** This problem has somehow been fixed in kernel 3.14.14 which I just compiled and the black screen problem is finally gone! 

1. During bootup into Gentoo, the screen goes blank after the initial few lines. (I wasn't patient enough to wait for the system to bootup completely and kept thinking it was kernel panic and went through countless of times recompiling the kernel only to realise much later that the backlight wasn't switched on! Duh. *face palm*)

2. This problem occurs when I enable KMS for Intel together with EFI framebuffer. I just have to press the hotkey to increase the brightness of the backlight. (/sys/class/backlight/acpi_video0/brightness is somehow always set to zero), It doesn't solve the problem completely, but at least I am able to view the screen. If I disable KMS for Intel, no problems with backlight, but I am not able to start the X-server without KMS.

3. A few suggestions on the net are to add i915.invert_brightness=1 or acpi_backlight=vendor as a kernel option. That doesn't work quite well for me because:

a. If I boot the kernel with the option i915.invert_brightness=1, the backlight doesn't switch off. But everything is inverted. If I press the key to increase brightness, the display dims and vice versa. Same thing happens if I change the value in /sys/class/backlight/acpi_video0/brightness. If I increase the value, the display dims. If I decrease it, the display brightens. 

b. If I boot the kernel with the option acpi_backlight=vendor, the backlight also doesn't switch off. But brightness is at maximum and I am unable to change it at all.

4. My solution is to  create a file called "backlight.start" (Remember to chmod +x the file) in "/etc/local.d" The content of the file is as follows: 

 #!/bin/sh

echo 60 >> /sys/class/backlight/acpi_video0/brightness

 This will cause the backlight to be set at 60 when I see the login prompt. You may have to check your system first to see if setting value in /sys/class/backlight/acpi_video0/brightness will actually change the brightness or not. For some people it might be /sys/class/backlight/acpi_video1 or /sys/class/backlight/intel_backlight. 

5. There are, by the way, 3 ways (in my case) to adjust the brightness of the screen: The brightness keys on the keyboard, adjusting the values in /sys/class/backlight/acpi_video0 or /sys/class/backlight/intel_backlight and using xbacklight.

Well, all these solutions are now redundant as the problem has been fixed in the latest kernel. But it has been interesting researching for a temporary fix. :) 


Sunday, March 02, 2014

Root Samsung Tab 2 10.1" GT-P5110 Android 4.2.2

Recently I managed to root my Samsung Tab 10.1" using the instructions from xda-developers CF-Auto Root thread and this blogger. Unfortunately I had to use Windows as Odin is not available for Linux.

1. I installed Odin from the CF-Auto Root thread and Samsung USB drivers from the Samsung website.

2. Enable USB Debugging in Settings > Developer options

Here you may notice that there is no "Developer options" in Settings. This option has become hidden in Android 4.2. In order to make it visible, do the following:

i. Got to Settings > About device
ii. Tap on the Build number multiple times until you see a message that you are now a developer or something like that. (I can't remember the exact words)

3. Download CF-Auto Root from the XDA forum thread (CF-Auto-Root-espresso10wifi-espresso10wifixx-gtp5110.zip) and unzip the file.

4. Run Odin as administrator.



5. Switch off the Galaxy Tab and boot into Download Mode. Now, this is where the instructions did not work for me. Almost all the websites I've searched for instructed to press "Volume Down and Power" to boot into Download Mode. It didn't work for me and it took me ages to realise a very simple thing. On my device:

To boot into Download Mode: Press VOLUME UP and Power. And I see this:

Then I press Volume down as per the instruction to Continue and I see this:


To boot into Recovery Mode: Press VOLUME DOWN and Power and I get this:

I hope that clears up the matter for anyone who is having problems booting into Download Mode. Back to the rooting instructions:

6.  Connect the tab to the computer and in my case the ID:COM box turned yellow.


7. Click on PDA and select the CF-Auto-Root-espresso10wifi-espresso10wifixx-gtp5110.tar.md5 file.

8. Make sure that Auto Reboot and F. Reset Time is checked and Re-Partition is NOT checked.

9. Click Start. Once the installation is finished, the device will restart and we're done. :)

Using bluetooth on Gentoo and Fluxbox

These are my settings for bluetooth on my Gentoo. 

1. I don't use bluetooth often and on a side note, I'm connected to the internet using wired network. Therefore I created a script called wireless.start in /etc/local.d to switch off both wireless and bluetooth at boot.

Contents of wireless.start:

#!/bin/sh

rfkill block wifi
rfkill block bluetooth

2. When I want to use bluetooth to connect to my phone or tablet in order to transfer files, I just run the following commands:

rfkill unblock bluetooth

/etc/init.d/bluetooth start

blueman-manager

3. In my previous post regarding installing bluetooth, I mentioned that I was using gnome-bluetooth and not blueman. However the latest gnome-bluetooth package on Gentoo no longer provides bluetooth-applet which I used to manage pairing and file transfer with my handheld devices. The latest release of blueman on the other hand works. So I've switched to blueman.

Sunday, September 08, 2013

Gentoo and Atheros AR3012 Bluetooth chipset

I used the guides on the following websites to set up my bluetooth:
1. Gentoo WIKI
2. Fitzcarraldo's blog for installation of linux-firmware
3. Linux Wireless

This is my bluetooth chipset according to lsusb:

Bus 001 Device 006: ID 0cf3:3004 Atheros Communications, Inc.

lsusb -v shows:

Bus 001 Device 006: ID 0cf3:3004 Atheros Communications, Inc.
Device Descriptor:
  bLength                    18
  bDescriptorType       1
  bcdUSB                     1.10
  bDeviceClass            224 Wireless
  bDeviceSubClass      1 Radio Frequency
  bDeviceProtocol       1 Bluetooth
  bMaxPacketSize0      64
  idVendor                   0x0cf3 Atheros Communications, Inc.
  idProduct                  0x3004
  bcdDevice                 0.02
  iManufacturer           1 Atheros Communications
  iProduct                    2 Bluetooth USB Host Controller
  iSerial                       3 Alaska Day 2006

The steps to setting up my bluetooth:

1. Compile kernel as written in the wiki.
2. This error popped up in dmesg:
 
usbcore: registered new interface driver btusb
Bluetooth: Patch file not found ar3k/AthrBT_0x01020200.dfu
Bluetooth: Loading patch file failed
ath3k: probe of 1-1.1:1.0 failed with error -2

3. I realised that this patch file is found in linux-firmware package.  However this package installs a bunch of other firmwares which I do not need. In order to just install the firmware that I needed, I followed the instructions on Fitzcarraldo's blog.

emerge linux-firmware 

cp /etc/portage/savedconfig/sys-kernel/linux-firmware-currentversion /home/username/linux-firmware-currentversion.bak

awk '{ printf "#"; print }' /home/username/linux-firmware-currentversion.bak > /etc/portage/savedconfig/sys-kernel/linux-firmware-currentversion
- This actually place the sign "#" in front of every line in the file so that you don't have to insert them manually.

vim  /etc/portage/savedconfig/sys-kernel/linux-firmware-currentversion
# Remove the comment symbol from the files I want to install. The files that i needed were:
ar3k/AthrBT_0x01020200.dfu
ar3k/ramps_0x01020200_26.dfu
ar3k/ramps_0x01020200_40.dfu

USE="savedconfig" emerge linux-firmware

or echo sys-kernel/linux-firmware savedconfig >> /etc/portage/package.use and emerge linux-firmware

4. Continue with the instructions on the WIKI

emerge bluez

/etc/init.d/bluetooth start

rc-update add bluetooth default

gpasswd -a username plugdev

5. For the usage of bluetooth, I installed gnome-bluetooth and gnome-user-share. Blueman and bluedevil didn't work for me.