Apr 24, 2013 - Intel graphics extreme color saturation using HDMI and M2250D

Comments

When I acquired the LG M2250D display I noticed that when connecting it to my computer via HDMI, under Windows, the colors would be extremely saturated. This issue was not reproduceable in other operating systems and also not via VGA (under Windows too).

Saturated color of Windows' window
Expected color of Windows' window

My display (when via HDMI) is detected and assumed by the Intel graphics driver as a "Digital Television" instead of a "Monitor". I think that is because it is a hybrid monitor and TV. The consequence of this is that the driver will adjust the color scheme to match a TV watching scenario (and won't let us change it in a straightforward way!).

What I did to fix (workaround) this was open up "Intel(R) Graphics and Media Control Panel" (one way can be by pressing Ctrl+Alt+F12) and change a few settings. Here's how you can do it:

First:
Select "Advanced Mode" in the dropdown that, by default, is set to "Basic Mode". Then select "Custom Resolutions" inside "Display".

Changing to Advanced Mode
Second:
Fill the "Add Custom Resolution" fields with the intended screen resolution and under "Timing Standard" select "CVT-RB" (this is where the secret lies).

Changing Timing Standard for specific resolution
Finally:
If your screen doesn't flicker automatically, you may need to restart your computer. You need to add a custom resolution configuration for every different resolution you may need. The "Timing Standard" can be different from "CVT-RB", but that one I can assure works.

How it should look after everything

Apr 22, 2013 - A working bashrc function without parameter expansion (globbing)

Comments

I have noticed that the function I had under my bashrc script to simplify the syntax of the find command wasn't actually working for all cases. When I passed asterisks for the search criteria, I was left with weird findings resulting from parameter expansion (globbing). Here is the failing function (from my home .bashrc):

function findf() {
find $1 -name "$2" 2>/dev/null
}
Which doesn't work properly for the case mentioned above.

After meddling a little bit with this I was able to have a working "findf" by using an alias just to deactivate globbing (set -f) before calling the function (which I have renamed to avoid conflicting with the alias):

alias findf='set -f; findf_func'
function findf_func() {
find $1 -name "$2" 2>/dev/null
set +f
}
Deactivating globbing inside the function is not enough because the parameters will be expanded before the first line is executed.

After the find command finishes, globbing can be activated again with set +f.

Apr 18, 2013 - ADB - CPU usage and staggering mouse cursor

Comments

After tuning my system to develop an Android app, I noticed that every time ADB (Android Debug Bridge) daemon was started, the mouse cursor (and all graphics for that matter, as well as other I/O tasks like playing music) in my GNU/Linux system would start flickering, staggering, jumping, get slow, I'm not even sure what to call it. Besides that, the CPU usage was always around 2% to 7% (if seen from KSysGuard, lower using ps).
KSysGuard shows the ADB daemon consuming an average 4% CPU time
After monitoring the adb process and system I/O operations, I noticed that the problem was probably related to ADB polling the host USB devices periodically. That made me think of the disastrous xHCI controller from Fresco Logic, which I have in my computer for providing USB 3.0 connectivity, that had already given me problems before.

For now, what I do to avoid this issue when I need ADB is simply unloading the kernel module xhci_hcd:
sudo modprobe -r xhci_hcd
If I didn't want to use my USB 3.0 port I would just blacklist the module.

If you have this issue, post a comment or contact me so we can have a further chat and possibly get more insight.

Mar 13, 2013 - The vmware-usbarbitrator binary closes itself with "Pipe unexpectedly closed."

Comments


The binary closes itself after around 5 seconds. If run directly from the terminal it shows the following:
# vmware-usbarbitrator
Pipe unexpectedly closed.

The following command only shows the following:
# vmware-usbarbitrator --info -f
VTHREAD initialize main thread 2 "usbArb" pid 7554

This is caused by an empty /etc/arch-release (owned by filesystem).
To fix it, add a version string to /etc/arch-release in the form of <year>.<month>(.<day>) (e.g. 2013.03.01).

I have added this fix to ArchWiki, the official Arch Linux Wiki where more troubleshooting information is available.

Update (2013/04/17):
I have also added the AUR package vmware-usbarbitrator, which provides a systemd service to automatically run VMware-USBArbitrator on computer startup. This systemd service has now been integrated into a single, feature-complete package: vmware-patch.

Feb 25, 2013 - Cannot find application with Spotlight (the missing solution)

Comments

As a recent user to the Apple world, I've been exploring and optimizing the OS X based on my needs. After playing with my OS X installation I ended up losing access to some applications (native ones!). I managed to restore them by copying the files from another OS X installation. However, Spotlight couldn't find the applications anymore. I searched for solutions but all I got was disappointment. So, I decided to fix it myself and share it with you.
Spotlight cannot find an application that is installed

After non-deliberately deleting some native applications I restored them by copying the files from another OS X installation. However, Spotlight couldn't find the applications anymore (but I could run them).

I tried multiple ways to rebuild the Spotlight index as suggested in the community. Nothing did it.

It turns out that the applications had a wrong set of permissions which made them invisible to Spotlight.

After observing the other native applications' files I discovered that:
  • The main application directory and all its contents must belong to the user root and group wheel;
  • The main application directory and all directories recursively inside of it must have a set of permissions equal to 755 (Traditional Unix permissions);
  • All files recursively inside the main application directory must have a set of permissions equal to 644
  • The file inside the Contents/MacOS/ from the main directory must have the set of permissions 755 because it must be executable or the application won't run;
The most important aspect is that the file Contents/Info.plist be readable in the others class so that Spotlight can view it.


Now that we know the theoretical aspects of the issue, let's delve into some Terminal exercise:

  1. Open up Terminal and cd to the directory containing the main directory of the application you want to fix, e.g: cd /Applications/Utilities. Let's assume the application is called MyApp and its main directory MyApp.app;
  2. Set the right owner and group to every file and directory: sudo chown -R root:wheel MyApp.app;
  3. Set the general permissions to every file and directory: sudo chmod -R 775 MyApp.app;
  4. Change the permissions of only the files: find MyApp.app -type f -print0 | xargs -0 sudo chmod 644;
  5. Change the permissions of the actual executable file, to be executable: sudo chmod 775 MyApp.app/Contents/MacOS/MyApp;
Although it doesn't need to be exactly like this, these steps get your application consistent with the other ones.

If the application still doesn't show up in Spotlight, try to force a rebuild of its database:

mdutil -E

Update: Some application files may require specific permissions. Run Disk Utility to verify and repair the disk files' permissions.

References

Traditional Unix permissions

Jan 26, 2013 - Sudden FPS drop in F.E.A.R (Logitech hardware)

Comments

Some users have noticed that they cannot play the game F.E.A.R. (or Condemned: Criminal Origins) with a high framerate, even though their machine is powerful enough for running 5 instances of the game simultaneously. Even weirder is the fact that the game will usually start with the correct framerate but will suddenly drop to 10-20 FPS, after some seconds or minutes. With such a low framerate, it gets difficult to play with pleasure.

You won't let Alma run away from you at 15 frames per second, will you?

If the user has Logitech hardware peripherals, then the source of the problem is already known among the community of players. However, the workarounds presented in every place I visited are far from being confortable to the user.

In this post I present you a simple workaround for the problem that almost feels like a fix.

According to this link, the problem lies in the fact that the game engine overpolls the USB I/O in Windows 7 when Logitech Human Interface Devices (HIDs) are connected to the computer. Some users have reported that disabling the Human Interface Device Access service is enough to fix this issue, but I could not reproduce it.

The usual workaround is to disable all HIDs that belong to Logitech devices from the Windows Device Manager. When they are disabled, special controls like keyboards' volume up/down keys will not work anymore. So, if users make use of these controls they will need to keep enabling the HIDs after playing F.E.A.R.

The transparent workaround

I have created a simple batch script that automatically disables the HIDs and runs the game. Then, when the game quits, the script automatically enables the HIDs.

There is only one requirement besides the actual script: the devcon command-line utility, though it can also be downloaded from this page.

Make it work

Download the following files:
  1. devcon (32-bit) or devcon (64-bit);
  2. the script;
Follow the steps:
  1. Extract the devcon executable to the game directory (where the game executable is);
  2. Copy the script also to the game directory;
  3. The script is only ready for the multiplayer version of F.E.A.R., or F.E.A.R. Combat. Edit the script with a text editor and change FEARMP.EXE to the desired game executable;
  4. Create a shortcut to the desktop and change its icon if you want... you will be playing the game using the script from now on;
  5. Make sure you run it as an administrador and let UAC (User Account Control) proceed. Right-click the script, select Compatibility and check "Run this program as an administrator";
Troubleshooting:
  1. You can mess with the script until it fits your system properly, in case your hardware isn't compatible with the script, though I am using the vendor ID 0x046D, which is Logitech's;
  2. You can lose all keyboard and mouse input to your computer in case the script doesn't fit your hardware properly. If that happens, grab another mouse or keyboard, go to the Device Manager and enable all Human Interface Devices;
  3. The mouse may stop working for one or two seconds when the script is being executed, but that's normal.
References

  1. F.E.A.R. - Logitech/FPS fix
  2. F.E.A.R - Low FPS + random freezes
  3. F.E.A.R. - FPS / Logitech fix
  4. FEAR Horrible FPS Issue
  5. G5/G7/G15 + FEAR ! Solved ! (F.E.A.R.)