[Gta04-owner] Wakelocks working on GTA04/Replicant

Dr. H. Nikolaus Schaller hns at goldelico.com
Sun May 11 09:39:41 UTC 2014


Hi Paul,

Am 11.05.2014 um 11:22 schrieb Paul Kocialkowski <contact at paulk.fr>:

>> I've reached another step in improving the suspend/wakelock behavior of
>> Replicant on the GTA04. The mainline implementation of wakelocks, which
>> is used in our kernel was already working in theory, but the Android
>> userspace was not able to acquire any locks, due to insufficient
>> permissions and process capabilities.
> 
> Well, I have already fixed that last week, see:
> https://gitorious.org/replicant/kernel_goldelico_gta04/commit/4741b20879962d6838b0925fa0680891e2b7c86d
> 
> Did I forget to mention that on the list? I so, then same on me. It's a
> waste of time solving the same issues the same way separately!

Indeed. But even then, coming up independently with the same solutions is a strong indicator that it is the right solution :)
> 
> Perhaps take a look at the tree so we avoid such a mix-up next time!
> https://gitorious.org/replicant/kernel_goldelico_gta04/commits/bdb7dbfe8039225429584f294233a909daedf69f

Maybe we should only have one tree since asking others to look into foreign trees does not work.

So I suggest that Replicant simply imports (or mirrors):

	https://github.com/goldelico/gta04-replicant/

and the others. instead of running its own GTA04 code repo.

Why this way around? You are in the exceptionally comfortable situation that
a hardware vendor is maintaining the system…

If we choose it the other way round, we are never sure that GTA04 development gets
the priority by Replicant developers it needs (there was some time where Replicant did
not develop at all for GTA04 because of lack of resources).

And if you have upstream patches, please submit them to Lukas.

If in any case we stop supporting GTA04 in the future, you can still go back.
Thanks to those who invented distributed version management by git :)

> 
> The commits to have USB gadget properly working are there too, along
> with some other things as I explained in my message on the thread
> "Replicant 4.2 upstream status" from the 3rd of May.
> 
> Since then, I've also worked on better headphones/headset/button
> detection. Getting a raw value from twl4030 seems to provide reliably
> constant values (without it, the threshold between mic/nomic was
> sometimes ~700 and sometimes ~300).
> 
> On the user-space side, headset detection is now fully working and I've
> corrected the configuration for all the scenarios as well (currently,
> only earpiece/speaker/headphones/headset are supported for output and
> main mic/headset mic for input, that is, no bluetooth yet).

Great!

> 
> See:
> https://gitorious.org/replicant/device_goldelico_gta04/commits/0bcd90da87361c7109d02e02950b5fb87674e10d
> 
>> The solution was to change the permissions of the needed files in sysfs
>> (/sys/power/wake_[un]lock) [1] and to disable the process capabilities
>> check in the kernel [2]. The later is actually a workarround and the
>> process capabilities (i.e. CAP_BLOCK_SUSPEND) should be set correctly,
>> which I think is done in Android's libcore [3]. Our version of libcore
>> doesn't set CAP_BLOCK_SUSPEND, though. And as I don't want to fork
>> libcore, I disabled the capabilities check in the kernel. As soon as we
>> have a userspace, which sets correct capabilities, we can remove this
>> workaround.
> 
> I agree and came to the same conclusion.

Indeed nice!

BR,
Nikolaus



More information about the Replicant mailing list