LG K4 (M151)

I needed a new phone so I bought the LG K4, wanting a phone that was relatively cheap and could do the basic things (e-mail, messaging, basic surfing, music). The phone comes with little internal memory and a lot of “bloatware” (apps by LG that you don’t need) so I felt it needed some hacking. I did some surfing and was only moderately succesful, but wanted to present you the main findings and links, because some things I found didn’t work and others did. Please let me know if you find out things I haven’t listed here.

Image from LG.com


Installing ADB under Linux

You can use ADB to control your phone from a PC: reboot it, copy files, etc. If you’re on Linux, here is a great installation guide.

ADB also allows you to copy files to and from the phone. This worked better for me than MTP which gave errors and stopped working in the middle of copying files. Not sure why – maybe it’s support under Linux is limited? There is a nice tool AAFM that allows you to do the copying using ADB through a graphical interface.


Removing bloatware

Once you have ADB installed, you can remove bloatware, as described in this great recipe. You don’t need root access for this.

Inside adb shell, type

pm list packages

THen choose the app you want to uninstall, say <name> and type

pm uninstall -k --user 0 <name>

You can get more info about a particular package using

adb shell dumpsys package my.package

And yet more info here.


Download mode

Managed to get into Download mode by switching off, holding the volume up button and then plugging in the USB cable to the PC. Then it says updating firmware and in the bottom you see “633A B100” (or some similar number). Then nothing happens anymore. The phone does show up as a USB device, but ADB cannot connect to it. To get out of this mode, I just removed the battery.

To communicate with the phone in this state, you use an interface called LAF, which appears to be specific to LG. Peter Wu “Lekensteyn” made a terrific set of command-line tools that allow you to interface with the phone through LAF, and you can download his tools here. Through those tools, you can execute shell commands on your phone. However, in more modern phones (such as the one I have) the commands you can run are extremely limited. If you run a command that is restricted, you will see:

Hello, I am LAF. Nice to meet you.

See this issue for more detailed discussion of this phenomenon. I wanted to use the LAF mode to root the phone but eventually just gave up.



Recovery mode
Unclear how to put the phone in recovery mode.

Here they say: press Volume UP, Power button and Home button simultaneously





I wanted to get root access to this phone but I had no luck yet. Some forums say I should try KingRoot but that doesn’t work. It’s just an annoying app on your phone.

There is this forum post claiming they rooted the LG K4 but it looks like you require to purchase a box of some sort.




I did not have luck getting into fastboot mode either.

It seems LG phones have LAF instead of Fastboot (if I understood that correctly). I didn’t manage to get anything useful from that but here is the link. There may be a way to wipe (remove) the LAF partition, in which case the phone should revert to using Fastboot which should give you more control.



Making Asus UX305CA touchpad work in Ubuntu (temporary fix!)

Hello everyone – I acquired a fine Asus UX305C “ultrabook” but I was somewhat disappointed to find that its touchpad, the ELAN1000, doesn’t work under Ubuntu.

A bit of Googling taught me that this is a widespread problem. It seems to come down to a bug in the i2c driver, and relating to some timing delay not being respected. It’s likely also to get fixed in the major next Linux kernel (4.5), but I don’t know when that one will come along. Anyway, as you can hear from the way I talk about it I have no clue what the actual problem is, but I found Kevin Fenzi’s fix here (and thanks to Benjamin Tissoires for pointing me to it):


The problem is at the above link it’s only explained how to do this for Fedora. Here I’ll show how to do this under Ubuntu.

This is a workaround – it’s not a real fix. The problem is expected to be actually solved in the 4.5 kernel but for the time being, you can use the instructions here as a workaround.

First, get ready to download, build and install a custom kernel. This is nowhere near as scary as it sounds. Follow the instructions here:


It may be a wise idea to test that you can get this custom kernel compiled, installed and running using the instructions above. It won’t actually solve your problem but once you manage to, you’re almost there.

Now in the kernel sources that you downloaded in the above tutorial, open the file


In this file, find the following section:

static int dw_i2c_acpi_configure(struct platform_device *pdev)
        dw_i2c_acpi_params(pdev, "SSCN", &dev->ss_hcnt, &dev->ss_lcnt, NULL);
        dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt,
        return 0;

Depending on the source you downloaded, there may be some extra lines before the return statement, but that’s irrelevant. Now after the two lines that start with dw_i2c_acpi_params, add the following line:

dev->sda_hold_time = 30;

When this is done, save the file. Now you just need to recompile the kernel sources and install them as explained in the kernel building tutorial, and then boot into the new kernel, and voilà, your touchpad should work. Booting into the new kernel is fairly easy: if you followed the steps in the tutorial then it should appear in your boot menu.

Confirmed to work for XUbuntu 15.10 on UX305.

Faema Family Grinder – When the adjustment is stuck

I wanted to share some of my experiences taking apart the Faema Family grinder. When I got it second-hand, I did not manage to adjust the grind. Normally you can turn the plastic bean hopper left or right to adjust the grind coarseness.


So here I’ll jot down what I did hoping that it may help somebody in the future with a similar problem.

I took off the lid from the bean hopper and undid the three screws, taking out the little black cap shown in the picture below:


Now the trick came. Below this hopper, I found the burrs that do the actual grinding. These are two metal elements on top of one another. In the following picture you can see the top one. It is supposed to be able to turn to make the grind finer or coarser, or, if you keep making it coarser, the entire top burr will come off which is great for cleaning. The trick is that it turns the opposite way from how a usual screw works: to loosen it, you turn it clockwise. I have illustrated this in the following picture:


Since these burrs were really stuck, I had to stick in a metal plate that had the right size and then use it as a kind of screwdriver. I got this idea from this forum, which I recommend to have a look at for further detail: http://www.planetcafe.fr/forums/viewtopic.php?f=5&t=3016

Then the burrs started coming apart and finally I could take the top burr out completely. Here is what that looked like:


Then it was a matter of lots and lots of cleaning and putting it together, and lo and behold, the grinder adjustment mechanism is fully functional again!

Rawstudio photo editing app on Ubuntu 15

Rawstudio is a great app for editing your RAW photos on Linux. However, its home site rawstudio.org seems to be offline these days. You can still get the program from github at: https://github.com/rawstudio/rawstudio

The program doesn’t seem to be available for Ubuntu 15 on PPAs yet so you’ll need to compile it yourself. Grab the code from the repository above, put it somewhere on your computer. You will probably need to install some packages. For me, I had to install some dependencies using the following command (you can run this in the terminal):

sudo apt-get install libtool libtool-bin libgtk-3-dev libgconf2-dev liblensfun-dev \
liblcms2-dev libexiv2-dev libfftw3-dev enfuse libtiff5-dev libxml2-dev sqlite3 \
sqlite3-dev libsqlite3-dev libgphoto2-dev

Then, go to the directory where you extracted the Rawstudio github source code, and run:


If you’re lucky and no errors are shown, you can proceed with:


cd src


And that should do it! Hope this is helpful.

Hooking up a MIDI keyboard to Ubuntu

I have a MIDI-capable keyboard and a MIDI-to-USB converter. Today it finally worked under Ubuntu Linux. The MIDI-to-USB converter was quite cheap and no-name, but in case this is of help for anyone, the vendor ID was: VF-21-USB-MIDI-KYBD-CBLE-A43

From Linux, the usb device looks as follows (type lsusb in the terminal to get this info):

Bus 002 Device 004: ID 1a86:752d QinHeng Electronics CH345 MIDI adapter

If you plug it in, it pretty much works straight out of the box. Here is the dmesg output:

[ 582.546409] usb 2-1.3: USB disconnect, device number 3
[ 613.878085] usb 2-1.3: new full-speed USB device number 4 using ehci-pci
[ 613.971701] usb 2-1.3: New USB device found, idVendor=1a86, idProduct=752d
[ 613.971709] usb 2-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 613.971714] usb 2-1.3: Product: USB2.0-MIDI

For me, this creates a device node under /dev/snd/midiC1D0 (but the exact name might depend on other MIDI-capable devices present in your system, so simply look in /dev/snd/ to see what devices appear or disappear when you plug or unplug the USB cable). This device can then be read by Jack and hooked up to Fluidsynth or Rosegarden for your MIDI enjoyment!

Installing FTAP for finger tapping synchronisation experiments (OR: How to use FTAP in the 21st century)

Steve Finney made a neat Linux program for running sensorimotor synchronisation tapping experiments. In tapping experiments, you typically have a participant tap her or his finger along with a metronome. Finney’s program FTAP is a C-based program that will read the taps from a MIDI interface and that can generate metronome sounds. However, the program was developed in the early 2000s and the Linux landscape has changed somewhat. These days I’m installing FTAP on my friend’s Linux box. I figured the world might learn something from our errors.

First of all, make sure you start with a 32-bit version of Linux. It seemed to us that the binaries (pre-compiled executables) that come with FTAP don’t work under 64-bit Linux (which nowadays is the standard). When you download FTAP it should come with source code, which should allow you to compile it, but this didn’t work out of the box for us. Also, it should be possible to run the 32-bit FTAP executables in 64-bit Linux but we were too lazy to figure out how. So make your life easy and install 32-bit Linux.

Second, install a realtime Linux kernel. Current Linux versions by default have a kernel that allows you to come close to real time (called lowlatency) but I got the impression that for the very best timing performance you need the kernels called “realtime” which you can get from abogani’s PPA archive. Note that this works for Ubuntu 12.04 but maybe not for newer versions. For details:




Third, download FTAP: http://csml.som.ohio-state.edu/ftap/ Extract it and you should be ready to roll! Note that FTAP can only read the MIDI device /dev/midi. So if your MIDI device somehow gets mapped to another device node, make sure you install a symbolic link in /dev/midi to the actual device node.

A final note (please learn from our stupidity): When we ran FTAP on a particular day, we found incredible delays (up to several seconds) between the MIDI input and MIDI output. These delays persisted when FTAP wasn’t even running, and the computer was set up (using aconnect) to immediately forward the MIDI signal back to the USB-MIDI device. It turned out to be due to the fact that Windows (which was also installed on the computer in a dual-boot set up) had not been shut down but was in hibernation mode. Apparently this meant that Windows was still using resources and this caused massive delays in the MIDI processing. Lesson learned: don’t hibernate Windows while you are running an experiment under Ubuntu!