Maemo Leste - Thirteenth Update (April, May, June) 2020

droid4 n900 pinephone cellular extras light sensor power management ofono openrc keyboard layout vibration cellular data | 2020-06-24

It's been several weeks since our last update, so let's start with a few highlights:

  • We have improved power management on the Droid 4, and currently, under ideal conditions, the power draw is about 60mW with the modem turned on. That should last a few days on a decent battery
  • Various sensors and other hardware of the Motorola Droid 4 are now usable with Maemo Leste
  • A lot of kernel bugs/regressions have been chased and fixed
  • Cellular support is improving; cellular data should now work
  • Maemo Leste Extras should contain quite a few more packages now
  • leste-config-* packages now exist to provide seamless configuration updates and changes, so there should be less of a need to "reinstall" on every new image release

Software changes

mce

The Mode Control Entity has seen significant changes.

MCE will now properly blank the screen, allowing the SoC to idle, which in turn allows for significant power saving (see issue #338, MCE PR 5).

With the newer versions, the touchscreen will also be properly disabled when the device is locked. This will prevent 'accidental' input events being sent to applications while the device is locked. MCE will also close the file descriptors of any touchscreen devices and tell X11 to disable the touchscreens to let the touchscreen driver idle properly. For more details, see issue #340, MCE PR 6 and MCE PR 7.

Furthermore, we've made a change to the default /etc/mce/mce.ini configuration file to prevent accidental shutdowns on the Droid 4. We've increased the time one has to press the power key to shutdown the device (issue #392).

ALS (Ambient Light Sensor) support has been extended, and it now also works on the Motorola Droid 4. See MCE PR 8.

A module contributed by uvos to support vibration in MCE is also expected to land in the next few days. See issue #132 and MCE PR 9.

Something else to look forward to is the execution of mode-change shell scripts, to allow certain programs or scripts to be executed when a device is locked, unlocked, or enters other mce (sub)modes.

Input and Focus fixes

libmatchbox2 and hildon-desktop (the Maemo window manager) have had long standing bugs with regards to input focus, which also made it impossible to send keyboard events to vanilla Qt 5 applications.

freemangordon and uvos have been trying to get to the bottom of the problem. The result of that effort is that all known problematic input and focus issues are now fixed. Now xev happily receives events, es2gears responds to keyboard input events, and Qt 5 applications take input the way they are supposed to.

Relevant pull requests:

Qt 5: Progress is being made

The Maemo Qt 5 port is not finished yet, but has seen various improvements. Merlijn has been doing work porting the "Hildon Input Method" virtual keyboard patches to Qt 5. Due to the more clear architecture of Qt 5, our unwillingness to fork Qt 5 as a whole, and the fact that we're also porting from old Xlib code to xcb, the work is taking a little bit more time. On the upside, all the Maemo Qt 5 bits will hopefully available via a Qt 5 loadable platform module.

Apart from the virtual keyboard, there are at least two important pieces missing:

  • QMenu support, to allow hildon-style menu items to show when the application title is touched/pressed
  • Hildon-style stacked windows

We've also ported over a sample application, countdowntimer:

To make it usable, we had to have the application respect desktop sizes other than the 800x480 that the Nokia N900 screen supports, to prevent it from looking like this:

Countdowntimer itself also makes use of the specialised QMenu and Hildon stackable windows, but is already quite usable even without those modifications.

Development can be done directly on the VM, using X11 forwarding:

You can also use Qt Designer with the native Maemo theme, but, well...:

If you plan to use Qt designer on your device, you might want to look at Xephyr (Nested Xorg server) on Maemo instead.

In the next month, we hope to mostly finish the Qt 5 port. Keep in mind that many Qt 5 applications are already usable on Maemo Leste as is. This is also documented in Community showcase!

Xephyr (Nested Xorg server) on Maemo

Xephyr is a nested X server, which can run in a window on Maemo Leste, allowing you to run any ordinary desktop application on Maemo Leste, in a window.

It's especially useful for devices with physical keyboards.

Installing it is as simple as:

sudo apt install xephyr

And then start it as follows:

Xephyr :1 &

And launch applications inside that server like so:

DISPLAY=:1 dwm &
DISPLAY=:1 xterm

Enjoy!

Cellular data and ofono support

The beowulf-devel repository of Maemo Leste now has the libicd-network-ofono plugin for icd2 to allow for making GPRS/UMTS/LTE data connections:

This should work on all of the supported devices, as long as their ofono version (and SIM) supports data connections.

Additionally, there were some problems on Beowulf where user user (the default user in Maemo) had no access to the ofono dbus interface, but this has been fixed in issue #372.

Finally, once this work has seen a bit more testing, we will create a meta package to automatically install all the cellular packages, and all devices will automatically get the cellular support when they apt update && apt upgrade.

Wireless

Wireless is mostly just working, although the UI still has some rough edges. In particular, sometimes connecting to a network fails if entering the password takes too long.

One other bug was fixed: a problem where the networks would appear in the network dialog, but would not be selectable until the next scan returned, which was really annoying. See issue #253 and connui-internet PR.

Themes

The retro Okuda theme is now available:

Miku theme:

Matrix theme:

OpenRC integration in Debian fixes

We've successfully submitted a patch to SysVinit upstream, which brings in better support for OpenRC and its internals to both Debian and Devuan. It has not yet propagated to Devuan, but it is expected to happen, of course. In Maemo Leste we already provide the patched version and maintain it ourselves until it is available in Devuan. The patch itself brings in proper OpenRC support in the insserv tool, which means that LSB headers aren't necessary for OpenRC initscripts and they now get installed in the default runlevel without the need for manual interference.

The patch was merged in 6a65f4412a2d24d78741f49e64e1128993341e65, and can be seen here:

If you found that some init scripts ended up in /etc/runlevels instead of /etc/runlevels/default, try reinstalling the affected packages; they should install fine now.

More languages added to virtual keyboard layouts

Many more virtual keyboard layouts have been added. If you were ever in need of a Belarusian or Bulgarian keyboard layout, now is your time to apt update && apt upgrade.

See hildon-input-method-plugins PR 2.

Steps towards calls and texts

With Cellular data and ofono support improving and other projects getting close to finished, it will soon be time to turn our attention to usable calls and texts on Maemo. We will use many of the same components that Maemo Fremantle uses, just in their updated forms, like the Mer project does.

Issue #390 documents some of the steps we will be taking. It will look something like:

  1. Perform further analysis on how this works in Fremantle
  2. Import all the FOSS components (there are quite a number of them)
  3. Figure out audio (routing and) policies
  4. Reimplement the non-FOSS ones: call and sms UI are the big ones
  5. Use osso-abook in the alternative call and sms UIs

The addressbook interface is also underway and is being RE'd from the Fremantle binaries: https://github.com/maemo-leste/osso-abook/

maemo-input-sounds

To test the MCE vibration driver, work has been started on maemo-input-sounds, which uses the X11 Record extension to monitor for touchscreen and key presses, and in reaction to those, either vibrate the device, play a sound, or even both.

The status can be tracked in issue #389. A fully functioning maemo-input-sounds probably depends on getting the audio set up completely (see Next up: Audio routing/Pulseaudio, Contacts, Calls/SMS, Qt 5).

Calendar backend and frontend

Some more work is being done by buZz and sicelo to get the calendar software up and running. The backend, calendar-backend is already building fine, but the frontend (qalendar) is still blocking on the Qt 5 port:

We expect this to fold in rather quickly once osso-abook is mostly ready.

hildon-home fixes

hildon-home would frequently try to monitor non existing directories for changes, but because the directories did not exist, kept retrying the monitor calls. This resulted in significantly higher power usage. This has been fixed now, see issue #264 for more details.

Additionally, since our move to Beowulf, two plugins for hildon-home would no longer load (due to hildon-home loading them from a non-existing path), but this too has now been fixed:

Device support

Motorola Droid 4

The Motorola Droid 4 has seen a big set of improvements:

Ambient Light Sensor

Just like the Nokia N900, the Droid has an ambient light sensor, used to measure exactly that: ambient light levels. This can be used to adjust the screen brightness to the ambient light levels, based on the brightness profile selected. For observant users, this already worked on the Nokia N900, but now this also works on the Droid 4.

This should make your device more pleasant to use in darker rooms, but also outside - in direct sunlight.

Additionally, if the light level is low, the device is unlocked, and the keyboard is exposed, the keyboard backlight LEDs will be turned on, to allow for optimal typing in the dark. :-)

See MCE PR 8.

Vibration Motor

Once MCE PR 9 is merged, the vibration motor on the Motorola Droid 4 (and actually also the Nokia N900 and other devices that support the Linux FF interface) will work. This allows for vibration of the device to provide touchscreen haptic feedback to the user, but also when (in the near future) an SMS is received, or the device receives a phone call.

See also these notes on Maemo.org on how to start and stop vibrations. Since we are compatible at least on the DBUS level, the original Maemo instructions just apply. It is also possible to add more patterns by editing /etc/mce/mce.ini.

Accelerometer

The accelerometer driver is now enabled, meaning that things like the droidsaber are now possible:

This will also be useful for automatically changing the screen orientation, based on the device orientation. The powervr driver might need a bit more work before that will work smoothly and well though.

Power Management

The power management on the Droid 4 should be in much better shape now. Under ideal circumstances, with the modem online, the device should idle at about 60mW. This is made possible by the incredible Linux kernel support, droid4-pm, our various mce improvements, and in general OMAP being well designed when it comes to power management. This should last most batteries for several days. Things might improve a little more if OMAP OFF mode ever starts to work on OMAP 4.

Merlijn recently acquired a few lab power supplies, and (after actually making it work with sigrok, working around insanely stupid firmware bugs) was able to generate the following graph of power usage from a clean power-up, showing the ~3 minutes it takes to fully boot and enter the promised 60mW idle power usage:

Here's what using the vibration motor does to the power draw:

And the same for receiving an SMS (exposing a problem where the modem doesn't properly idle after sms receive - it stays around 180mW as opposed to the 60mW - this is still being investigated, but it looks like the USB doesn't idle afterwards, requiring to be manually kicked into idle mode):

NTPD and power management

The ntp daemon currently causes a lot of wake ups, and negatively impacts battery life. The current stop-gap is to stop it manually after booting, by issuing the following as root:

/etc/init.d/ntp stop

Cellular and power management

While the modem itself should idle pretty well, the modem reports on the signal strength very frequently, waking up the device even when the signal strength should not be shown. The signal strength can be temporarily disabled like so:

printf 'U1234AT+SCRN=0\r' > /dev/gsmtty1

Graphing power logs from the device

The GNOME Power Manager can plot upower data, and it runs on Leste:

But the upower data is located in /var/lib/upower and not at all hard to plot yourself, which might actually be more insightful (although this graph is very basic):

We're still figuring out how to properly plot all this data, but more information (including the source to generate the above graph) can be found in issue #396.

Maybe we can take one of these maemo.org applications and port them.

Battery calibration

uvos has written an init script and tool to store the battery capacity when known, and restore it, using spinal84's experimental kernel patches, see issue #374.

It will be added to the Droid 4 meta package imminently, and then eventually everyone should have a calibrated battery, hopefully.

Also see upower PR 4 for the UPower fix that was required for this to work properly.

Keyboard layout

For a long time, it was not possible to summon the special keys virtual keyboard on the Droid 4, which was particularly annoying since some important keys were not available.

By digging through the N900 keyboard files and learning a bunch about xkb, both of these issues have now been resolved by Merlijn. buZz provided a nice geometry file, which allows us to visualise the keys on various keyboard levels:

(Yes, the shift button on the Droid 4 is mapped to control, and the caps lock key is mapped to shift)

Additional extra keys are also available when using the ISO_Level3_Shift key, see the actual xkb file for more details and this image for a quick reference:

Compare that to the N900 layout:

Bringing up the special keys virtual keyboard is done by pressing the "OK" (ISO_Level3_Shift) key and the Control (Shift) key.

And finally, the virtual keyboard didn't look quite good on the Droid 4, since it has a larger resolution, but as of hildon-input-method-plugins PR 3, the keyboard will render properly regardless of the screen dimensions:

Modem integration

tmlind and Pavel Machek have been doing a lot of work on improving ofono on the Droid 4. The result of most of that work is currently packaged in the droid4 component, so any droid 4 will automatically get the latest/best ofono version. Additionally, the technology is now also reported properly:

More work remains, including upstreaming ofono and dealing with some power management regressions, but it's starting to look quite good indeed.

Current work can be found here: https://github.com/maemo-leste/ofono-d4/tree/motmdm-serdev-ngsm

increasing font size in osso-xterm

On the Nokia N900, the font size in osso-xterm can be changed using the volume buttons, but this does not work yet on the Droid 4. The reason is that osso-xterm expects specific (hardcoded) keys to be used to change the font, and the Droid 4 has different keys mapped to its volume buttons, see issue #385

Latest Linux kernel

A month or so ago we switched to Linux 5.7: https://github.com/maemo-leste/droid4-linux/tree/droid4-pending-v5.7

After that, there were various regressions to figure out, the most painful ones being random resets, which took quite a while to pin down. tmlind has been incredibly helpful in getting these problems resolved. Onto the next Linux version and set of regressions - and bugfixes, and features...

Nokia N900

Powermanagement update

A while ago we tweeted out a photo of a Nokia N900 using very little power, while in OMAP OFF mode. We haven't yet brought this to our latest images, but it's still planned (it might be relatively simple, but also might be a lot of work). In addition, we will likely provide an n900-pm script, similar to the droid4-pm script.

Pinephone

Thanks to the packaging work from people in postmarketOS, we now also support the modem in the Pinephone. While we've mostly been working with cellular things on the Droid4, lots of that work can simply be reused on the Pinephone, and we plan to do so in the near future. A package called pinephone-modem-config can be installed, and along with updating the kernel (latest available version is 5.6), it will bring in modem support. This is already automatically enabled in the latest images. A note to keep in mind: While the modem is off, combined with the latest kernels, the system outputs KEY_WAKEUP events which cause some trouble with the virtual keyboard. The current solution to this is to just have pinephone-modem-config installed and after a reboot, things should be ok. We will see if it's possible to patch this in some proper way in the future.

Weekly builds

From July, we will also implement and enable weekly image builds on our CI infrastructure. This means we won't be building images on demand anymore. Instead they shall be built each week, containing all the latest packages and goodies. Obviously, this will require more storage space, so we will be removing device images older than five weeks.

Hopefully this will also help us polish up our build frameworks and alert us about possible bugs that arise during development. It is also a very important step towards reproducible builds - which is one of our milestones we wish to fulfill.

However, for this occasion, we built new images and they can be downloaded as usual. This time we've also built 64bit images for the Raspberry Pi 3 and 4.

Community showcase

PS 1 emulator

PCSX-ReARMed runs quite nicely on the Droid 4:

Unfortunately, the community hasn't yet packaged the program for Maemo Leste Extras, but we're confident someone will, at some point.

Photo Light meter

Written in Free Pascal, photolightmeter can be used calculate aperture and shutter values.

Telegram

If you're a fan of Telegram, the desktop client just works on Maemo Leste:

Proxmark3

If you like toying with RFID cards, then you can (for example) use the bluetooth module on the Droid 4 to connect a capable reader and run proxmark3 on the Droid itself:

You can find specific installation notes here: http://web.archive.org/web/20200623220049/https://paste.debian.net/plainh/34a66276

Quicknote

A simple notes application written in Python is also available: https://github.com/maemo-leste-extras/quicknote

mihphoto

A Qt 5 photo viewer is available, and optionally supports multitouch when supplied as a startup argument: https://github.com/maemo-leste-extras/mihphoto

personal-ip-address

The good old personal-ip-address has returned, this time to Leste: https://github.com/maemo-leste-extras/personal-ip-address

Maemo Leste Extras

More community packages are being maintained in the extras repository and we're very glad and excited about it. If you're interested in maintaing your own community package for Maemo Leste, there are instructions for you to do so on the bugtracker .

Next up: Audio routing/Pulseaudio, Contacts, Calls/SMS, Qt 5

So what can you expect from future updates?

The big things on our radar are still:

  • Audio: Currently most devices do not even ship with pulseaudio, but we'll probably want to start using it, and create ALSA UCM files for our soundcards, provide proper pulseaudio sink names for call routing, and so on. This is also a prerequisite for the volume applet

  • Contacts (osso-abook), this will provide all of the Hildon contacts APIs with the evolution database as a abackend, definitely required for proper SMS and Call UI

  • Qt 5 updates: hopefully we will soon have the virtual keyboard integration ready, with the hildon menus and stacked windows following right after. That should be enough to make most applications work, and from there on we'll probably port things on an as-needed basis: like APIs for home and status widgets

  • Nokia's rtcom packages and telepathy. https://github.com/maemo-leste/bugtracker/issues/390 Some of this is covered in Steps towards calls and texts, but to reiterate: the plan is to use telepathy-ring as an interface to ofono, and use rtcom-eventlogger and other libraries to read from and log to the same database format as used on Fremantle. This approach is particularly exciting because it allows loading many other telepathy plugins. There also exists a telepathy-haze plugin to load (any) Pidgin (libpurple) plugin, allowing for potentially loading (for example) the slack-libpurple slack plugin into telepathy, and being able to directly interface with Slack using the native hildon UI, potentially even with contacts, too. And of course, there are also SIP plugins for telepathy, allowing for VOIP calls from the same (native) UI

  • Speaking of UIs, once the backend (rtcom) is mostly there, the last thing we'll have to do is to bring up the call and text UIs. The Fremantle SMS UI relied on an html rendering engine, allowing for cool customisations like these:

Web interface for packages

We're considering creating a web interface to browse the core maemo packages, the development packages and also the extras packages. See issue #395 for more details. If you have suggestions, want to see specific features, or want to help out, please do let us know on the issue.

Sneak peak of an alpha version of the interface:

More frequent updates?

We often get the question if we can provide update posts more frequently. Often, we delay update posts because we want to complete just one more package... - and then another, and another... So if you'd like to get more frequent update posts, please volunteer to write them for us. If you hang out in the IRC channel, maybe follow the frequent updates and write about them, and we'll be able to post it here, on our website.

That said, we're considering doing detailed write-ups of various core components of Maemo Leste every few weeks or so, so if that's your thing, you might be able to peek at those too, soon.

Interested?

If you have questions, are interested in specifics, or helping out, or wish to have a specific package ported, please see our bugtracker

We have several Nokia N900 and Motorola Droid 4 units available to interested developers, so if you are interested in helping out but have trouble acquiring a device, let us know.

Please also join our mailing list to stay up to date, ask questions and/or help out. Another great way to get in touch is to join the IRC channel.

If you like our work and want to see it continue, join us!

Merlijn Wajer