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.