Log in

pavelmachek's Journal

Recent Entries

You are viewing the most recent 25 entries.

26th February 2017

11:32pm: Using Linux notebook as an alarm clock
Is someone using notebook as an alarm clock? Yes, it would be easy if I did not suspend machine overnight, but that would waste power and produce noise from fans. I'd like version that suspends the machine...

21st February 2017

11:21pm: X220 to play with
Nice machine. Slightly bigger than X60, bezel around display way too big, but quite powerful. Biggest problem seems to be that it does not accept 9.5mm high drives...

I tried 4.10 there, and got two nasty messages during bootup. Am I the last one running 32 bit kernels?

I was hoping to get three-monitor configuration on my desk, but apparently X220 can not do that. xrandr reports 8 outputs (!), but it physically only has 3: LVDS, displayport and VGA. Unfortunately, it seems to only have 2 CRTCs, so only 2 outputs can be active at a time. Is there a way around that?

17th November 2016

12:49am: Linux did not win, yet
http://www.cio.com/article/3141918/linux/linux-has-won-microsoft-joins-the-linux-foundation.html Yes, Linux won on servers. Unfortunately... servers are not that important, and Linux still did not win on desktops (and is not much closer now than it was in 1998, AFAICT). We kind-of won on phones, but are not getting any benefits from that. Android is incompatible with X applications. Kernels on phones are so patched that updating kernel on phone is impossible... . This means that Microsoft sponsors Linux Foundation. Well, nice, but not a big deal. Has Microsoft promised not to use their patents against Linux? Does their kernel actually contain vfat code? Can I even get source for "their" Linux kernel? [Searching for Linux on microsoft.com does not reveal anything interesting; might be switching to english would help...]

14th November 2016

11:22am: foxtrotgps: not suitable for spacecraft navigation
Subject: foxtrotgps: not suitable for spacecraft navigation
Package: foxtrotgps
Version: 1.2.0-1
Severity: normal
Dear Maintainer,
Trying to use foxtrotgps in the spacecraft leads to some interesting
When date line is reached, "track traveled" jumps over the whole
world, and "your position" gets de-synchronized from point when the
red line is painted.
Reproduced with Vostok-1 spacecraft.

6th October 2016

10:56am: FlightGame
FlightGear is a very nice simulator, but it is not a lot of fun: page with "places to fly" helps. But when you setup your flight details, including weather and failures, you can kind of expect what is going to happen. FlightGame was designed to address this (not for me, unfortunately, alrough... if you ever debugged piece of software you know unexpected things happen): levels are prepared to be interesting, yet they try to provide enough information so that you don't need to
study maps and aircraft specifications before the flight.
Don't expect anything great/too complex, this is just python getting data from gpsd, and causing your aircaft probles over internal webserver. But it still should be fun.
Code is at
. I guess I should really create a better README.
Who wants to play?

3rd October 2016

1:13pm: Linux V4.8 on N900
Basics work, good. GSM does not work too well, which is kind of a problem. Camera broke between 4.7 and 4.8. That is not good, either.

If you want to talk about Linux and phones, I'll probably be on LinuxDays in Prague this weekend, and will have a talk about it at Ubucon Europe.

24th September 2016

12:05pm: Audio fun
Documentation for audio on Linux... is pretty much nonexistent.

There is a hidden pointer somewhere in this text to a page containing deeper information about using audio. You should have perfect understanding about the features described in this page before jumping into more complicated information. Just make sure you read this text carefully enough so you will be able to find the link.
Oh, thank you, so we are now on treasure hunt?
Under construction!
This page is currently being written. A more complete version should be released shortly.
Last updated Fri 16 Aug 1996 (minor changes).
Seems like the complete page is not going to be available any time soon.
Still, that was best page explaining how audio is supposed to work on Linux. Ouch. I could not get ALSA to work. OSS works fine. (I guess that also talks a bit about state of audio on Linux). And then I discovered that modem does not work in kernel 4.8, so my problems were not pulseaudio problems but modem problems. Oh well.

8th September 2016

12:46pm: Security getting hard/impossible on recent systems
Cache attacks: this is not good. Ok, so we have a rowhammer: basically very common, hard-to-work-around, hardware problem. Bits in your memory may flip. Deal with it.
And now, there are cache attacks, too. Users should not be able to spy on each other on multiuser system, but they very probably can. In particular, other users can tell which parts of emacs you are executing, and when. They can probably not distinguish what characters you are typing, but they can probably learn when you are typing space, normal letter, or moving cursor. Ouch. And if they indeed can spy on individual characters... you can hardly blame emacs. With plain keyboard, cache attack on individual letters is probably not feasible. With t-9 like system on touchscreen... it probably is. Deal with it. But how?
12:36pm: fcam-dev now gets autofocus on 4.7 kernel
Ok, without proper timing support, everything is really, really slow, but hey - I already got one usable photo out of the system :-).
Oh, and this is the reason to run Debian on your phone: https://citizenlab.org/2016/08/million-dollar-dissident-iphone-zero-day-nso-group-uae/ .
12:32pm: 25 years of Linux
25 years of linux and yes, I know Linux is popular. Still it was unexpected when I was asked in public transport if I know about Linux. Man wanted me to help with X restarting due to bad graphics drivers... I asked how he realized... and he told me about my T-shirt. I realized I have UnitedLinux T-shirt on... Given SCO's involvement in that one... should I burn the shirt?
12:31pm: ext4 encryption incompatible with grub
You encrypt a directory -- sounds easy, right? Support is in 4.4 kernel, my machines run newer kernels than that. Encrypting root would be hard, but encrypting parts of data partition should be easy.
Ok, lets follow howto... Need to do tune2fs. Right. Aha, still does not work, looks like I'll need to reboot.
Hmm. Will not boot. Grub no longer recognizes my /data partition, and that's where new kernels are. Old kernels are in /boot, but those are now useless. Lets copy new kernel on machine using USB stick. Does not boot. Fun.
tune2fs on root filesystem is useless, as it is too old. New one is ... on the data partition. Right. Ok, lets bring newer version of tune2fs in. "encryption" feature can not be cleared.
Argh! Come on, I did not even create single encrypted directory on the partition. I want the damn bit to go off, so I can go back to working configuration. "Old kernels can not read encrypted files" sounds ok, but "old kernels can not mount filesystem at all" is not acceptable here :-(.

You encrypt a directory -- sounds easy, right? Support is in 4.4 kernel, my machines run newer kernels than that. Encrypting root would be hard, but encrypting parts of data partition should be easy.
Ok, lets follow howto... Need to do tune2fs. Right. Aha, still does not work, looks like I'll need to reboot.
Hmm. Will not boot. Grub no longer recognizes my /data partition, and that's where new kernels are. Old kernels are in /boot, but those are now useless. Lets copy new kernel on machine using USB stick. Does not boot. Fun.
tune2fs on root filesystem is useless, as it is too old. New one is ... on the data partition. Right. Ok, lets bring newer version of tune2fs in. "encryption" feature can not be cleared.
Argh! Come on, I did not even create single encrypted directory on the partition. I want the damn bit to go off, so I can go back to working configuration. "Old kernels can not read encrypted files" sounds ok, but "old kernels can not mount filesystem at all" is not acceptable here :-(.
Ok, it seems it is possible to go back, as long as encryption was not actually used. fsck -fn; debugfs -w -R "feature -encrypt" /dev/device; fsck -fn;. I guess I was too optimistic. Using ext4 encryption would require at least new e2fsprogs at the root filesystem, which was something I was hoping to avoid.
12:28pm: Anyone with x60 and working gigabit?
On the lists, I was told that I probably have broken wire inside my notebook. I believe broken wires simply don't happen, so... is there anyone with working gigabit on x60?

16th August 2016

11:42pm: Vala -- seems ideal so far
I was searching for a language to write the phone GUI with... python3+gtk3 is way too slow; 9 seconds for trivial application is a bit too much (on N900). python2+gtk2 is a lot better at 2 seconds. Lua should be even faster.

But while searching for good language, Vala caught my mind. Designed to be integrated with gtk/dbus, compiled language. I was woried about error messages and errors from vala->c->binary compilation, but seems good so far.

Oh and it seems that emacs org mode is right thing to use for calendar. It looks like a bit too complex at first, but it seems the complexity is well justified... and I was doing similar things manually. Still have to search for a component to notify using popup / audio when an event is upcoming.

5th August 2016

1:50pm: Continents move... fun for openstreetmap
Openstreetmap has a problem... and a rather fundamental one. Saving all data in WGS-84 is nice and simple... but continents actually move. And that's why different countries use different coordinate systems. Australia moves a lot... cnet.com/.../australia-has-moved-1-5m Good thing is that we could map ships with that support. I guess there are other fundamental issues: world is 3D, and that is actually problem for multi-floor buildings. Plus, attributes for attributes would be useful. As in source:surface=survey...
1:46pm: Keyboard mapping and UCW czech
So I configured scroll-lock & pause to select volume up/down. Works well so far. I also remapped workplace switching to F1-F12 (without alt). Works well so far, as I switch workplaces a lot, and nothing really uses F1-F10.

Ouch, and for czech readers... UCW keyboard lives. Mate (== gnome2), in layouts add Czech Czech (UCW layout...), a v optionech "switching to another layout" capslock (while pressed)".

3rd August 2016

12:56am: 4 extra keys on desktop, 2 on notebook
Ok, so they are 4 keys on my keyboard I know absolutely no use of: "wakeup" key -- when any key wakes machine up, "power" key, which just duplicates "sleep" key, "scroll lock" and "pause". The first two are slightly non-standard, but surely there should be some use for scroll lock and pause in X (those are present even on notebook)? But it seems there is none. Scroll lock LED is also unused. Ideas?
12:55am: Tor browser a bit too unique?
Ok, this is scary: tor browser on https://browserprint.info/test -- "Your browser fingerprint appears to be unique among the 8,440 tested so far. Currently, we estimate that your browser has a fingerprint that conveys 13.04 bits of identifying information."

21st July 2016

10:54pm: Something usable for N9/N950?
I have both N9 and N950 here. Unfortunately, both are useless, as developer mode can not be enabled (because Nokia servers are down?).
There's tutorial -- how to install Sailfish. I'd love that. Neccessary images for N9 are no longer available. N950 images are still there, but... tutorial needs developer mode, and that's no longer possible.
Is there any way out of this for me?
Would it be possible to download image of working N9/N950 from some device, so that I could flash it?

19th July 2016

9:32am: Google play store playing with GPS?
Microsoft broke my father's computer: it made him update to Windows 10, when Windows 10 can not use two of 3 USB ports. Ouch.
Now it seems Google is trying to break my LG E720 cellphone. I did the right steps: it is running Cyanogen. One method is "we have great update for google Talk". Unfortunatelly, update is 20MB or more, basically filling internal flash and making phone unusable. And you can't disable update completely, you can only avoid clicking on it.
Now, Google seems to have invented new method of breaking my phone: Google Play Store started activating GPS. It does it on background. I tried downgrading to factory version of the play store, and not accepting its terms and conditions, but somehow I think it will come back.
Google Play Store definitely behaves like malware now. Unfortunately, on Android, it is hard to tell if malware-like behaviour is intentional by Google or if I have some third-party malware on the phone, too.

16th July 2016

8:42am: Updating userland on phone is... fun.
So I updated debian on my N900, because having different version on phone and PC sucks.
It booted, after I added "rw" to kernel command line, which is small miracle.
But X are without usable mouse, without panel, and without reasonable keymap. In particular, I don't have numbers, or any symbols besides ',.<>'. But I have root shell. Now I need to enable remote access somehow... which will be fun because sshd disappeared.
emacs to the rescue. By editing existing script, I can get access to characters such as '/', and launch telnetd. Installing sshd was easy with nmtui. Good.
Now, it seems something changed in the X land, and "xinput --set-prop --type=int 8 249 0 1" no longer works, which means touchscreen is
"upside down". If you know the replacement commands, let me know...

13th July 2016

10:17am: Ad blocking: yes, its war now
idnes.cz: they put moving advertisment on that their web, making browsers unusable -- they eat 100% CPU and pages lag when scrolling. They put video ads inside text that appear when you scroll. They have video ads including audio...  (Advertisment for olympic games is particulary nasty, Core Duo, it also raises power consumption by like 30W). Then they are surpised of adblock and complain with popup when they detect one. I guess I am either looking for better news source, or for the next step in adblock war...
...hmm. Perhaps time to disable javascript for such pages? No. Javascript is needed for video play back. But this seems to do the trick:


Ok, seems Richard Stallman was right once again, and non-free javascript is a problem. News websites now commonly serve javascript that goes against interests of users.
Now, disabling javascript completely solves the problem, but it also breaks video playback. Is there time to create whitelist of reasonable javascript code?

12th July 2016

10:24pm: Facebook spyware push and unexpected N900 advantages
Dear Facebook. I'm aware that your Facebook lite is only 1MB. It is also dangerous spyware. You try to push it to me every time I attempt to use m.facebook.com. Would not it be nice if you avoided pushing your spyware to phones that can not handle it? Yes, that's right, your spyware requires too new android, so my phone is actually immune from it.
At least N900 seems tu be immune from this problem, you don't even try to push your crap there. Good.
10:14pm: Fun with the camera (on N900)
Ivaylo Dimitrov got camera to work on N900. Great. Unfortunately... there's works and works.
Working /dev/video* devices does not mean you get useful photos easily. I managed to get flash and autofocus hardware to work... But that still does not mean useful photos.
It seems that http://fcam.garage.maemo.org/fcamera.html is the best way to get the photos. Now... having phone act as a ssh server on local network, with gcc and development tools installed is very convenient... but sometimes you forget that this is not a powerful machine you normally work at.
Oh and BTW... is someone maintaining fcam-dev? Last update in svn is in 2011... I guess I'm maintaining it now...

Auto exposure is quite tricky to do right, and fcam-dev relied on some kernel patches to provide adequate performance. (If someone has pointer to the patch, that would be nice, BTW.) But... people were taking photos before auto exposure was available. And n900 has light sensor, so we can actually use it to bootstrap the auto exposure, making it slightly faster. Seems to work now. I had auto focus working with extremely ugly hacks... but I guess it will be easier to just let user focus manually. The camera is small enough that it should be feasible.

I played with the camera cover, and if you open it in the dark, it starts the flashlight (because that's what you probably want). If you open it with enough light, it will start camera for you. I feel proud.

N900 is a "little" loud in headphones. And it still plays PCM when mixer is set to 0. Weird. But probably topic for another investigation.

Charging (etc) on N900 is still funny. If you poweroff while charging, it will keep charging. That's probably a Linux bug. Charge counter (battery percent) are "kept" even if you replace the battery. Ouch. (So you replace empty battery with full one and still get empty reading. I guess normal people don't have 3 batteries for their phones?) That may be a hardware bug.
You can set charge voltage to more than 4.2V. That will make battery catch fire. I wonder what it is useful for, I guess when you want to have fun on the airplane? /sys/class/power_supply/bq24150a-0/registers is not exactly one value per file. Not sure about mode. model_name is definitely not one value per file.

dx.com 406496 : USB power meter. Seems to work quite well (I compared amper meter with other one, and they agreed +- 10%, so numbers do not look completely useless), and is very useful for debugging power issues. But it seems that USB power supplies often provide about half of their rated current...

2nd July 2016

9:34pm: You know your build machine is too small when...
...you don't have enough memory to run cc1plus and emacs at the same time. Ouch. Development directly on target (N900) is nice, but it has some unexpected pitfalls.

OTOH, I was able to modify fcam-dev to work with new kernel, and I'm slowly moving towards some real photograhs.

15th April 2016

1:17pm: Python is a nice... trap
Python is a nice... language
Easy to program in. No need to recompile, you can hack in as you would in shell. Fun.
Lets see if I can predict the weather. Oh yes, lets hack something in python. Hey, it works. But it is slow on a PC and so slow on a phone that future is already past when you predict is.
Then you try to improve the speed. That's very very bad idea. You can't optimize Python, but you can spend hours trying. You make a mental note to never ever use Python for computation again.
But Python should be fine for simple Gtk project, communicating over Dbus, right?
For bigger projects, Python has some support. Modules / object orientation really helps there. Lack of compilation really hurts there, but this is fun language, right? Allowing you to write nice and clean code.
Refactoring is hard, because variables are not declared.
Python is a nice... trap
But then your project grows larger, and you realize it takes 30 seconds to start up. Because many module need gtk, and importing gtk takes time. Heck... compiling _and_ running C based hello world is still faster then running Python based one.
Ok, C++ was tempting. Gtk Hello world takes 55 seconds to compile. My g++ does not support "auto", so the application starts with Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example"). I think I'll stick with C.

Oh, and I already used my main SIM in N900/Debian... and I really used N900/Debian. I needed to tether a network, but not provide wifi hotspot. Done.
Powered by LiveJournal.com