Log in

pavelmachek's Journal

Recent Entries

You are viewing 25 entries, 25 into the past.

9th January 2015

11:32pm: fight with 2.6.28
...was not easy. 2.6.28 will not compile with semi-recent toolchain (eldk-5.4), and it needs fixes even with older toolchain (eldk-5.2). To add difficulty, it also needs fixes to work with new make (!). Anyway, now it boots, including nfsroot. That should make userspace development possible. I still hope to get voice calls working, but it is not easy on 3.18/3.19 due to all the audio problems.

24th December 2014

11:42pm: Merry Chrismass from DRAM vendors
As a Chrismass present, you may be interested to learn that your computer's memory (DRAM) does not work as well as you thought.

Iteration 139 (after 326.41s)
49.460 nanosec per iteration: 2.13668 sec for 43200000 iterations
(check took 0.213835s)
Iteration 140 (after 328.76s)
48.805 nanosec per iteration: 2.1084 sec for 43200000 iterations
error at 0x890f1118: got 0xfeffffffffffffff
(check took 0.244179s)
** exited with status 256 (0x100)

And yes, it probably means "your memory, too". Thread on lkml is "DRAM unreliable under..."

20th November 2014

10:18pm: fight with pulseaudio
On nokia n900, pulseaudio is needed to have a correct call. Unfortunately that piece of software fights back.

pavel@n900:~$ pulseaudio --start
N: [pulseaudio] main.c: User-configured server at {d3b6d0d847a14a3390b6c41ef280dbac}unix:/run/user/1000/pulse/native, refusing to start/autospawn.

Ok, I'd really like to avoid complexity of users here. Let me try as root.

root@n900:/home/pavel# pulseaudio --start
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
N: [pulseaudio] main.c: User-configured server at {d3b6d0d847a14a3390b6c41ef280dbac}unix:/run/user/1000/pulse/native, refusing to start/autospawn.

Ok, I don't need per-user sessions, this is cellphone. Lets specify --system.

root@n900:/home/pavel# pulseaudio --start --system
E: [pulseaudio] main.c: --start not supported for system instances.

Yeah, ok.root@n900:/home/pavel# pulseaudio --system
W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set!
W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set!
N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode!
N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time!
W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
W: [pulseaudio] main.c: Please read http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode for an explanation why system mode is usually a bad idea.

Totally my fault that someone forgot to document this pile of code. Thanks for blaming me. I'd actually like to read what is wrong with that, except that the page referenced does not exist. :-(.

17th November 2014

9:45pm: gcc trying to be helpful... in pretty unhelpful way
gcc tried to help me with figuring pulseaudio-module-cmtspeech-n9xx compilation... It says:

/lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line

To decrypt it, you should understand that "DSO" is a library. So it wants you to add /lib/x86_64-linux-gnu/libz.so.1 to command line you are using to compile. It took me a while to figure out...

9th November 2014

10:46pm: Dialer for ofono?
I have stock Debian running on Nokia n900, with ofono stack (on 3.18-rc1 and nfsroot)... and would like some GUI dialer. There's none in ofono project. mer had some, so I went to http://gitweb.merproject.org/gitweb ... but it gives me "service temporarily unavailable"... I was told to look at telepathy-ring, but that is not in Debian 7.7, and would have a lot of dependencies. Any ideas where to get sources of dialer from mer or what other software to use?

And... Is there a recommended camera application in Debian? I'd like to test that the drivers still work...

18th October 2014

9:43pm: N900 nfs root
So you'd like to develop on Nokia N900... It has serial port, but with "interesting" connector. It has keyboard, but with "interesting" keyboard map, you mostly need full X to be useful... and it is too small for serious typing, anyway. You could put root filesystem on SD card, but that is disconnected when back cover is removed. And with back cover in place, you can't reset the machine.

Ok, so NFS. Insecure, tricky to setup, but actually makes the development usable. I started with commit 4f3e8d263^ (because that should have working usb networking according to mailing lists).. and with config from same page. Disadvantage is that video does not work with that configuration... but setting up system blind should not be that hard, right?

Assemblying minimal system with busybox from so I could run second-stage of debootstrap was tricky, and hacking into the resulting debian was not easy, either, but now I have telnet connections and things should only improve.

6th September 2014

11:38pm: Fraud attempt from DAD GmbH
Got snail mail from DAD GmbH, Postfach 11 35 68, 20435. I should update my business info (which I never gave to them) and by submitting updated info, they would charge me 500 euro (small notice so that you are likely to miss it). I hope they go to jail for this.

3rd September 2014

11:09am: Boot shell
Yesterday I got electric shock. Yes, the device was supposed to be turned off by remote-control outlet, but I was still stupid to play with it.

Have you ever played the "press any key to stop autoboot" game, followed by copying boot commands from your notes, because you wanted to keep boot loader in original (early project phases) or final (late project phases) configuration? Have you reached level 2, playing autoboot game over internet?

If so, you may want to take a look at boot shell (bs) from Not Universal Test System project. In ideal case, it knows how to turn off/on the target, break into autoboot, boot your target in development mode, and login as root when user land is ready.

30th July 2014

6:33pm: Friends don't let friends freeze their hard drives
Hour and 15 minutes later, platters look really frozen... and heads are leaving watery trails on the harddrive, that clicks. Ok, this is not looking good.

Should not have let it run with water on board -- outside tracks are physically destroyed.

Next candidate: WD Caviar, WD200, 20GB.

This one is actually pretty impressive. It clearly has place for four (or so) platters, and there's only one populated. And this one actually requires cover for operation, otherwise it produces "interesting sounds" (and no data).

It went to refrigerator for few hours but then I let it thaw before continuing operation. Disk still works with few bad sectors. I overwrote the disk with zeros, and that recovered the bad sectors.

Did fingerprint on the surface. Bad idea, that killed the disk.

Ok, so we have two information from advertising confirmed: freezing can and will kill the disk, and some hard drives need their screws for operation.
6:27pm: I have seen the future
...and did not like what I saw. I installed Debian/testing. Now I know why everyone hates systemd: it turned minor error (missing firmware for wlan card) into message storm (of increasing speed) followed by forkbomb. Only OOM stopped the madness.

Now, I've seen Gnome3 before, and it is unusable -- at least on X60 hardware. So I went directly into Mate, hoping to see friendly Gnome2-like desktop. Well, it look familiar but slightly different. After a while I discovered I'm actually in Xfce. So log-out, log-in, and yes, this looks slightly more familiar. Unfortunately, theme is still different, window buttons are smaller and Terminal's no longer can be resized using lower-right corner. I also tried to restore my settings (cp -a /oldhome/.[a-z]* .) and it did not have the desired effect.

24th July 2014

3:00pm: Nowcasting for whole Europe, international travel script
CHMI changed their webpages, so that old.chmi.cz no longer worked, so I had to adapt nowcast. My first idea was to use radareu.cz, that has nice coverage of whole europe, but pictures are too big and interpolated... and handling them takes time. So I updated it once more, now it supports new format of chmi pictures. But it also means that if you are within EU and want to play with weather nowcasting, you now can... just be warned it is sligtly slow... but very useful, especially in rainy/stormy weather these days.

Now, I don't know about you, but I always forget something when travelling internationally. Like.. power converters, or the fact that target is in different time zone. Is there some tool to warn you about differences between home and target countries? (I'd prefer it offline, for privacy reasons, but...) I started country script, with some data from wikipedia, but it is quite incomplete and would need a lot of help.
2:51pm: More fun with spinning rust
So I took an old 4GB (IBM) drive for a test. Oops, it sounds wrong while spinning up. Perhaps I need to use two usb cables to get enough power?

Lets take 60GB drive... that one works well. Back to 4GB one. Bad, clicking sounds.

IBM actually used two different kinds of screws, so I can not non-destructively open this one... and they actually made platters out of glass. Noone is going to recover data from this one... and I have about 1000 little pieces of glass to collect.

Next candidate: Seagate Barracuda ATA III ST320414A, 20GB.

Nice, cca 17MB/sec transfer, disk is now full of photos. Data recovery firms say that screw torque matters. I made all of them very loose, then removed them altogether, then found the second hidden screw and then ran the drive open. It worked ok.

Air filter is not actually secured in any way, and I guess I touched the platters with the cover while opening. Interestingly, these heads do not stick to surface, even when manually moved.

Friends do not let friends freeze their hard drives, but this one went into two plastic back and into refrigerator. Have you noticed how the data-recovery firms placed the drive there without humidity protection?

So, any bets if it will be operational after I remove it from the freezer?

15th July 2014

12:00am: Fun with spinning rust
Got a hard drive that would not spin up, to attempt recovery. Getting necessary screwdrivers was not easy, but eventually I managed to open the drive. (After hitting it few times in an attempt to unstick the heads). Now, this tutorial does not sound that bad, and yes, I managed to un-stick the heads. Drive now spins up... and keeps seeking, not getting ready. I tried to run the drive open, and heads only go to the near half of platters... I assume something is wrong there? I tried various torques on the screws as some advertising video suggested.

(Also, drives immediately stick to the platters when I move them manually. I guess that's normal?)

Drive is now in the freezer, and probably beyond repair... but if you have some ideas, or some fun uses for dead hard drive, I guess I can try them. Data on the disk are not important enough to do platter-transplantation.

3rd July 2014

12:29pm: Web browser limits desktop on low-powered machines
It seems that web browser is the limit when it comes to low-powered machines. Chromium is pretty much unusable with 512MB, usable with 1GB and nice with 2GB. Firefox is actually usable with 512MB -- it does not seem to have so big per-tab overhead -- but seems to be less responsive.

Anyway, it seems I'll keep using x86 for desktops for now.

30th June 2014

10:03pm: Warning: don't use 3.16-rc1
As Andi found, and it should be fixed in newest -rcs, but I just did

root@amd:~# mkfs.ext4 -c /dev/mapper/usbhdd

(yes, obscure 4GB bug, how could it hit me?)

And now I have

root@amd:/# dumpe2fs -b /dev/mapper/usbhdd
dumpe2fs 1.41.12 (17-May-2010)


>>> (2059923-1011347)/1024.
>>> (3108499-1011347)/1024.

. Yes, badblocks detected error every 4GB.

I'll update now, and I believe disk errors will mysteriously disappear.

22nd June 2014

4:59pm: Feasibility of desktop on ARM cpu
Thinkpad X60 is old, Core Duo@1.8GHz, 2GB RAM notebook. But it is still pretty usable desktop machine, as long as Gnome2 is used, number of Chromium tabs does not grow "unreasonable", and development is not attempted there. But eats a bit too much power.

OLPC 1.75 is ARM v7@0.8GHz, .5GB RAM. According to my tests, it should be equivalent to Core Solo@0.43GHz. Would that make an usable desktop?

Socrates is dual ARM v7@1.5GHz, 1GB RAM. It should be equivalent to Core Duo@0.67GHz. Oh, and I'd have to connect display over USB. Would that be usable?

Ok, lets try. "nosmp mem=512M" makes thinkpad not boot. "nosmp mem=512M@1G" works a bit better. 26 chromium tabs make machine unusable: mouse lags, and system is so overloaded that X fails to
interpret keystrokes correctly. (Or maybe X and input subsystem sucks so much that it fails to interpret input correctly on moderate system load?)

I limited CPU clock to 1GHz; that's as low as thinkpad can go:
/sys/devices/system/cpu/cpu0/cpufreq# echo 1000000 > scaling_max_freq

Machine feels slightly slower, but usable as long as chromium is stopped. Even video playback is usable at SD resolution.

With limited number of tabs (7), situation is better, but single complex tab (facebook) still makes machine swap and unusable. And... slow CPU makes "unresponsive tabs" pop up way too often.

Impressions so far: Socrates CPU might be enough for marginally-usable desktop. 512MB RAM definitely is not. Will retry with 1GB one day.

19th June 2014

4:49pm: debootstrap, olpc, and gnome
Versioned Fedora setup that is by default on OLPC-1.75 is a bit too strange for me, so I attempted to get Debian/ARM to work there. First, I used multistrap, but that uses separate repositories. debootstrap might be deprecated, but at least it works... after I figured need to do debootstrap --second-stage in chroot. I added firmware, set user password, installed system using tasksel, and things started working.

So now, I have a working gnome on OLPC... with everything a bit too small. I don't know how OLPC solved high-dpi support, but Debian certainly does not do the right thing by default.

21st May 2014

12:31pm: I love Python
Timetable conversion finally finished. It only run for 3.5 days...

159645.09user 151296.77system 311825.86 (5197m5.860s) elapsed 99.71%CPU

And as a bonus... Did you ever see ssh man-in-the-middle in the wild?

Someone could be eavesdropping on you right now (man-in-the-middle
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /data/pavel/.ssh/known_hosts to get rid of
this message.
Offending key in /data/pavel/.ssh/known_hosts:137
RSA host key for ....de has changed and you have requested
strict checking.
Host key verification failed.

That was Hotel Kossak in Krakow. Apparently when your internet connection key
expires, they launch a free attack at you as a bonus.

18th May 2014

8:27am: Python
...easy to program in, but hard to program when you want your programs to run at useful speed.

I'm currently fighting with gtfs convertor for timetab (was running overnight; and that's after I spent yesterday speeding it up 30 times or so; still not done). And yes, I realize that Python is probably not best language for weather nowcasting...

Are there some books / online things one should read to learn Python? Or is there some different language I should be using? (Yes, I like the language. No, I don't like whitespace-based syntax. No, I don't the fact that I have to actually test the application to discover typos in variable names.)

25th April 2014

1:27pm: Never trust spinning rust that refuses to reallocate sectors
(old indian proverb)

Playstation PS/3 is a small computer... that tries a lot not to look like a computer. I thought journalling is an old invention, but when I powered it off using power plug I was reminded that that's not the case. Result was 10 minute filesystem check, with note that it will take 4 (?!) hours if any problems are found. Ouch.

Anyway, it got me thinking. With 4 hours filesystem check time, it clearly has way bigger drive that it needs. 500GB... And hdd in my notebook refuses to reallocate bad sectors. (By some miracle, I did not really lose any data, and it was mostly behaving ok.) Refusing to finish tests is also not big problem, but it also made me nervous. Time to swap disks.

Model Family:     Seagate Momentus 5400.6 series
Device Model:     ST9500325AS
Serial Number:    5VE41HDA
Firmware Version: 0001SDM1
User Capacity:    500,107,862,016 bytes
SMART overall-health self-assessment test result: PASSED
  1 Raw_Read_Error_Rate     0x000f   097   092   006    Pre-fail  Always       -       23719990
  3 Spin_Up_Time            0x0003   099   098   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   099   099   020    Old_age   Always       -       1349
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       12
  7 Seek_Error_Rate         0x000f   082   060   030    Pre-fail  Always       -       8963080173
  9 Power_On_Hours          0x0032   062   062   000    Old_age   Always       -       34070
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   099   037   020    Old_age   Always       -       1320
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       179
188 Command_Timeout         0x0032   100   094   000    Old_age   Always       -       42950329567
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   061   045   045    Old_age   Always   In_the_past 39 (Lifetime Min/Max 22/42)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       2
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       2337789
194 Temperature_Celsius     0x0022   039   055   000    Old_age   Always       -       39 (0 6 0 0)
195 Hardware_ECC_Recovered  0x001a   049   029   000    Old_age   Always       -       23719990
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       2
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       2
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0
Error 170 occurred at disk power-on lifetime: 34070 hours (1419 days + 14 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      13:30:21.079  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:18.250  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:17.700  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:17.646  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:17.644  READ DMA EXT
...Error 166 occurred at disk power-on lifetime: 34057 hours (1419 days + 1 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      00:56:25.218  READ DMA EXT
  25 00 08 ff ff ff ef 00      00:56:25.217  READ DMA EXT
  25 00 08 ff ff ff ef 00      00:56:25.216  READ DMA EXT
  25 00 18 ff ff ff ef 00      00:56:25.215  READ DMA EXT
  25 00 10 ff ff ff ef 00      00:56:25.214  READ DMA EXT

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Aborted by host               90%     33409         -
# 2  Extended offline    Completed: read failure       90%     31692         961237184
# 3  Extended offline    Completed: read failure       90%     30723         961237184
# 4  Extended offline    Completed: read failure       90%     28305         961237188
# 5  Extended offline    Completed: read failure       90%     28262         961237187
# 6  Extended offline    Completed: read failure       90%     28257         961237188
# 7  Extended offline    Completed: read failure       90%     28251         961237188
# 8  Extended offline    Completed: read failure       90%     28233         961237188
# 9  Extended offline    Completed: read failure       90%     28227         961237188
#10  Extended offline    Completed without error       00%     23826         -
#11  Extended offline    Completed without error       00%      9419         -
#12  Extended offline    Completed without error       00%        40         -

It turned out that swapping disk in PS/3 is not an easy process. You need additional disk to perform backup to, side cover is not really easy to remove, and box is dead and needs "software update" after you swap the disk. It took few hours total. (Come on, 18GB of save game data...?)

I got single transient error when trying to copy out the data.

cp: reading `wnow/tmp/www.chmi.cz/meteo/rad/data/1309201315.gif': Input/output error

So far so good.

24th April 2014

4:11pm: Unison: delete a file but don't delete a file
Unison keeps filesystems synchronized across machines... If you are still manually using rsync, you might want to take a look. Now... question. I'm running low on space on one of those machines synchronized. Now what I'd like to do is to remove a file in such a way that it is not removed from other replicas. In fact, I'd like to be asked to copy the file back on next synchronization (same situation as if the file never existed in the first place). Any ideas how to do that?

20th April 2014

8:57pm: ext3 -> ext4 switch: 3x improvement of find performance
I switched filesystem on old Thinkpad X60 from ext3 to ext4. It took a while, but it looks like it will be worth it. find over kernel tree now takes 6.3 second instead of 17.7, performance improvement of 2.8x. As I use unison to synchronize machines, I expect to see some real improvement.

And here's some fun you can have with busybox. Spot 3 glitches.

root@socrates:/mnt/my# dd if=u-boot.img of=/dev/mmbclk0p1 bs=64K seek=4
3+1 records in
3+1 records out
224220 bytes (224 kB) copied, 0.00113385 s, 198 MB/s

root@socrates:~# dd if=/dev/mmcblk0p1 of=orig.spl.1 bs=64k seek=0 count=0
0+0 records in
0+0 records out
0 bytes (0 B) copied, 3.972e-05 s, 0.0 kB/s

socrates login: riit^H^H^H^[[2~^H^H^[[3~
login: loginprompt.c:164: login_prompt: Assertion `wlen == (int) len -1' failed

18th January 2014

4:55am: Evil people at mozilla
Mozilla people are now officially evil. When asked, why they don't offer database for download, it was for "privacy of the contributors". Nice. I contributed quite a bit of data. At that time, map only showed numbers of known points in the area.

Now, map contains precise GPS points. So, I can not only see where I live, or where my horse lives, but also where I have been, and how fast I was traveling at that time. Thanks, mozilla. Data actually useful for non-evil purposes, like cell numbers and wifi APs are still not available for download.

Can you spot your house on mozilla map?

(Ideal solution would be of course to stop displaying detailed information on the map, and start allowing database download, in "central point for given cell id / wifi id" form. That should be enough to protect privacy, and it is also useful for geolocation.. without offering your position to mozilla.)

17th January 2014

5:02pm: How to benchmark battery in flashlight, low temperature performance
I have Zebralight H600... and TrustFire cells from dx.com. TrustFire cells may have been a mistake.

Anyway... they do perform as advertised -- when benchmarking, it gives > 1 hour on 420lm. Not bad. it also has low light modes, like 65lm and 3lm. Using the low-power modes will make battery last significantly longer, right?

Well, not at all. I use it for horseback riding, which means in weather around 0 celsius (freezing). The lamp will behave quite nicely if I switch it on and let it on. It will start in 750lm mode, heat itself, and continue in 420lm, warm, for cca hour. But if I try to extend battery life (or try to be nice to my surroundings) by keeping light down, the temperature will go down, and when I then attempt to use high mode, it will fall to 3lm mode, or even fail completely. Usually it is possible to restart it in 3lm mode after few minutes wait. Ouch. (Switching to 750lm mode is too easy; that usually kills the light when cold. Selecting 420/200/100lm is not possible without going through 750lm mode; that does not help, either).

I have had light failing within 10 minutes -- go low for 10 minutes in cold weather, then switch 750lm mode, then battery trips.

Would some kind of isolation for the light help? Would the results be significantly different with better battery? Is NiMH better than LiIon for this? Is someone doing more realistic benchmarks that cycle maximum mode, but let the light cool down between tests?
3:49pm: Searching for gamma radiation pictures
Do you have radioactive source and N900? I have program that should detect radiation -- script for N900. But, without gamma source nearby, I have no way to test it. If you have both, could cover the lens, and let the script run for a while, and then would send me the resulting jpeg-s / stdout, I could do some attempts at calibration. Anyone?
Powered by LiveJournal.com