libera/#maemo-leste/ Tuesday, 2025-04-22

siceloin the case i have seen, we reach it from the last switch case, PA_CONTEXT_FAILED/default00:00
uvosin that case we should probubly just exit sphone00:00
uvossince theres no recovering from that00:00
uvosso yeah thats a bug in sphone, but we also should not get there unless something else is also unhappy00:01
siceloi was wondering if we reach it because of CONTEXT_FAILED or "PA_CONTEXT_UNCONNECTED" ... because no one's trying to catch that00:01
uvosi think sphone should never trigger PA_CONTEXT_UNCONNECTED00:02
uvosbut could be00:03
sicelobut yeah, as we've discussed with arno11, there's most likely something else that causes sphone to reach this state, but at this point we likely can't know what it is. makes sense to fix the sphone side then take it from there00:03
uvossure00:03
uvosi think PA_CONTEXT_TERMINATED and PA_CONTEXT_FAILED can just exit sphone00:04
uvossince it cant recover from that00:04
uvosand PA_CONTEXT_UNCONNECTED we can just ignore00:04
Wizzupuvos - can't you reconnect to pulseaudio?00:38
WizzupIsn't that what PA_CONTEXT_TERMINATED would be?00:39
sicelofreemangordon: https://git.maemo.org/leste/libicd-network-wpasupplicant/commit/23a6e250faa178de87f96043b396b17170c58b77  - i can understand the reasoning behind it. however, disconnection can happen at other times as well, e.g. while associating. this seems to be why we now get the blinking wlan icon if we go out of range of a network10:02
sicelowhat do you think: (1) we revert that commit, or (2) add more conditions, e.g. ` if (ctx->state == STATE_CONNECTED || ctx->state == STATE_CONNECTING) { .. } `10:03
uvos__Wizzup: we could, but simply exiting sphone unsucessfully achives the same thing for less effort, since the other sphone process will respawn us.10:34
Wizzupuvos__: ok, much like dsme for most of the other core programs then, that works for me12:10
Wizzupsicelo: I might be wrong but I feel like my d4 is much more prone to shutting down by itself now when it thinks it has a low battery12:12
Wizzupthe past few times I touched it it appeared to be turned off12:12
Wizzupyeah, it powers off even when connected to charger, wth12:14
uvos__Wizzup: i gues one issue with not handling PA_CONTEXT_UNCONNECTED by trying to reconnect without restartig sphone is that sphone will drop any call that is ongoing12:14
uvos__then again im not sure that there are any senarios where a call would survive pulseaudio dieing in the first place12:15
Wizzupyes, it's not great, but I think it's fine for now. on fremantle the phone app crashing I think means a reboot of the whole device because they decided it has to be robust12:15
Wizzupsicelo: so I am seeing upower or mce decide to power off even when there is a charger attached, I don't think this should ever happen12:15
Wizzupsicelo: it could be that my d4 powers off for another reason (maybe dsme things some sw crashed, but I think I have the lg disabled)12:16
sicelowith that upower conf, it's not upower. you can confirm with `upower -d` and ensure under critical-action it says Ignore12:19
WizzupI can't get to a shell12:20
WizzupI'll see if my charger suddenly turned flaky since the last 'apt update ; apt upgrade' :p12:20
siceloso the only remaining battery-related reason to power off would be (1) mce, or (2) just the battery dying completely12:21
siceloyou're still on old mce, so anything happening with new upower is not affecting it12:21
Wizzupwell, it's a controlled power off12:21
Wizzupso it's initiated by some software12:22
Wizzupcharge-mode says the battery is well in the green12:24
siceloright. so could be worn-out battery reaching MinVoltage quickly when you enable the display12:24
Wizzupbut status applet says 0%12:24
siceloah12:24
Wizzupif there a filter for this minvoltage?12:24
Wizzuplow pass or so12:24
sicelothere isn't :-)12:25
siceloand that's why i hate it12:25
Wizzupthat's a problem12:25
Wizzupbut something must have changed12:25
WizzupI didn't have these kind of problems before12:25
Wizzupand in any case, never when attached to a charger12:25
sicelostatus applet says 0% ... what does /sys/class say?12:25
Wizzupah, it turned off again before I could reach a terminal12:26
WizzupI think I'm hosed12:26
WizzupI'll deal with this later and find another way to congratulate something on their birthday :P12:26
sicelojust chmod -x upower then :-)12:26
Wizzupbbiab12:26
Wizzupgood idea12:26
Wizzups/something/someone/12:26
siceloi think i know what's happening ...12:27
sicelohttps://git.maemo.org/leste/mce/src/branch/master/src/modules/battery-upower.c#L194 ... you are hitting the UP_DEVICE_STATE_EMPTY condition12:28
sicelonot to be bad, but to resolve all this, let's get that review on https://git.maemo.org/leste/mce/pulls/64 completed12:29
sicelothe older upower didn't report UP_DEVICE_STATE_EMPTY since it would do the estimation itself ...12:30
Wizzupgood catch12:30
Wizzupand the || there makes it not care about charger state then12:30
siceloyup12:31
sicelobut for your to hit that so much also suggests the capacity-saving script might not be working for you anymore ... that also would be good to investigate. my battery is toast, so i can't check that myself12:39
siceloif the script had worked, you would not hit this part of the code, https://git.maemo.org/leste-upstream-forks/upower/src/branch/maemo/daedalus-devel/src/up-device-battery.c#L376 ... which is the only place in upower where UP_DEVICE_STATE_EMPTY gets set on a system battery12:45
WizzupIt would appear that the script probably didn't work given that I also saw 0% in the status applet12:52
Wizzupmaybe doing 'apt update; apt upgrade' triggered somethnig that make the script write something strange12:53
siceloif we're not ready for mce/#64, then a quick workaround/solution would be to change https://git.maemo.org/leste/mce/src/branch/master/src/modules/battery-upower.c#L194 to `if ((upowbat.state == UP_DEVICE_STATE_EMPTY && !mcebat.charger_connected) || ...`12:53
Wizzupor something else happened, I can investigate a bit later12:53
Wizzupyes, I do think we want that change in any case, but I will also look at the MR12:53
siceloyeah. actually i think all add more of the charger tests in the MR as well12:55
uvos__on d4 i think the kernel also shutsdown13:58
uvos__it tirggers of voltage, the limit is very low13:58
uvos__mce min_voltage could be improved by requireing a couple of reads below the minimum to react, yeah13:59
Wizzupyes, the kernel does it, but with some filter at least14:00
Wizzupiirc14:01
sicelosomeday we will need to extend mce/battery-upower so it is responsible for reporting the properties status-applet-battery wants14:15
sicelocurrently, they're making different decisions, when some really need to be in sync. to be specific, the low and empty states really need to work the same. right now, applet might notify that battery is completely empty, while mce is chugging along happily.14:18
sicelothis was there even in older upower14:18
siceloat some point I somewhat with uvos that we shouldn't even have battery stuff in mce. however, having worked on it a bit, I think we just need it in mce always14:20
sicelothis ensures we can delay power off due to emergency call for example, something upower won't care about14:21
uvos__sicelo: well ideally shutdown would just not work when there is an emergency call15:37
uvos__this is trival in systemd, im not sure you can do it in openrc15:38
uvos__currently on leste is only enforced when you ask dsme to shutdown15:38
uvos__mce duplicates it too, but thats just in case you dont use the dsme module15:38
uvos__besides low bat shutdown, which i added to mce, mce only uses the battery state to turn on the patterns, which honestly dosent belong in mce, since when the patterns get turned on is a ui descission that belongs in the ui.15:42
siceloyes, @ systemd. i know about the inhibitor interface, and someday it would be nice for Leste (through dsme perhaps) to use it. it's also available on openrc via elogind16:10
uvos__holding an inhibit would be either mces or sphones job imo but thats details16:55
siceloan inhibit against shutdown is best owned by a 'system-level' component (mce/dsme?) instead of something like sphone16:59
siceloI should check if HAM still cares about battery level ... at least in Fremantle it would refuse to do a system upgrade if battery level was below some threshold17:00
siceloi see it's commented out for now ... https://git.maemo.org/leste/hildon-application-manager/src/branch/master/src/dbus.cc#L858  :-)17:05
uvos__sicelo: the wrinkel being that the inhibit is held at the session level17:06
uvos__so doing that from a system daemon is contorting yourself a bit17:07
uvos__which is why i suggested sphone17:08
siceloit can be held anywhere iirc. upower and iio-s-p use it, for example, and it doesn't operate at session, unless i'm mistaken17:08
uvos__on the other hand mce should not be a system daemon anyhow17:08
uvos__it almost exculively deals with session level things17:08
uvos__like display brigtness and sutch17:08
uvos__session level mce (which is possible with systemd) would be the ideal place imo17:09
* sicelo thinks we should restore that enough_battery() check in HAM ... would suck to bork one's system with apt upgrade or dist-upgrade that fails due to system running out of juice17:09
uvos__sicelo: yeah soulds good, but maybe we could have an apt hook instead17:10
uvos__that makes mce not shutdown while apt is running17:10
uvos__that way it works outside of ham too17:10
uvos__i think the hook could also make apt fail17:11
uvos__if battery is to low at the start17:11
uvos__but not sure17:11
uvos__anyhow ideally this would be at apts level not ham17:11
freemangordonsicelo: this is the commit that makes d4 connect every time on start17:51
freemangordonalso, there should be a timer, that closes the connection on timeout, so the must be somethign else goinbg on17:52
sicelothanks for the context. Will have a closer look18:54
siceloor I'm the only one experiencing unusual wlan icon behavior?18:55
Wizzupsicelo: no, I think I have it to19:56
Wizzuptoo19:56
Wizzupthe commit fixes the one problem but introduced another I think19:56
siceloah. anyway manually disconnecting then reconnecting works. i'll leave it be for now20:05
siceloguess i'll look at sphone ... because operating without ringtone is killing me. no idea how it works out for arno11 unless they're constantly looking at the phone :p20:06
arno11sicelo: hehe, in fact vibration is so high on my phone that it works better than a ringtone20:23
arno11so no issue with missed calls so far20:25
Wizzupis this the tonegen thing? I don't think so right20:31
arno11yeah probably not related20:31
arno11Wizzup: no issue on d4 with ringtone btw ?20:32
siceloWizzup: i don't believe it's tonegend20:34
siceloarno11: d4 doesn't have issues. i was daily-driving it for some weeks until the battery went south20:34
arno11ok20:35
arno11under daedalus, right ?20:36
siceloon N900 it's clearly a bad combination of PA (under sphone control) , cmtspeech (whatever dragons lie in there), and our ant-sized resources :;20:36
sicelodaedalus, yes20:36
arno11oh, cmt_pulse crashes and restart when the issue happens20:41
sicelobut didn't you find the issue was also there on SIP? or it wasn't?20:44
arno11yes indeed20:45
arno11so maybe the root cause is elsewhere20:45
Wizzuparno11: I will need to check, I always have my phone on silent20:45
arno11ah ok20:46
siceloarno11: uvos__: btw, last night i ran sphone under gdb for a short time, and i had a BP on ./src/route-pulseaudio.c:sphone_pa_state_callback(). everything was idling, then i either disconnected or connected the charger, which sends an audible notification. at that moment, the BP was hit20:50
sicelomaybe it's expected ... not sure. i would have thought the context is unique to each application, but yeah, not too familiar with PA internals yet20:51
arno11sounds weird anyway20:57
arno11hmm...if i play a music through audacious (PA) and call my n900 at the same time with general profile, the ringtone doesn't work but the call works fine with no crash (but ofc remixing makes music playing during the call)21:16
sicelohey! does the person hear your music? :p21:18
arno11apparently not21:21
sicelowould been a fun thing to do :p21:21
arno11yeah21:22
arno11just 1 or 2 alsamixer changes and it works iirc21:25
sicelowhat works?21:27
arno11music to the other side21:28
sicelonice. poor man's IVR system21:31
sicelono, MOH :-)21:32
arno11lol21:42
arno11sicelo: i found a workaround21:56
arno11call the n900 using general profile, ringtone works, then before answering click on mute ringtone, then answers. seems to work21:58
arno11so the problem is maybe with ringtone mute stuff22:01
arno11it works 100% of time on my device but now the old issue with ringtone re appears: sometimes the ringtone works, sometimes not lol22:02
arno11i tried again without clicking on ringtone mute btn and it crashed22:04
arno11yeah so i'm able to get general profile working again this way but ringtone works randomly (like in chimaera in fact)22:07
arno11so there is another issue with sphone apparently and still an unknown issue with ringtone22:10
arno11sorry i meant 'mute ringing' btn22:21
siceloi understand. it's probably that (because we're slow and near-freezing) we take too long to switch between the profiles22:24
sicelowhich is why no-ringtone seems to work better22:25
arno11maybe yeah22:26
siceloarno11: when you saw cmt_pulse crashing, PA had not crashed?22:37
arno11idk, i just figured out cmt_pulse crashed/restarted because i reniced it (for testing) and it was back to default value after sphone crash22:40
sicelook22:40
arno11btw how to explain that things work fine if i click on mute ringing button before answering ? (switching profile seems fast on my device)22:42
arno11maybe i should try with no ucm and default asound state btw22:43
siceloprobably sphone's PA connection idles a bit when you mute the ringtone ... so we're ready for the soon-to-happen switch to VoiceCall use case22:44
arno11ok22:44
arno11hmm even if the ringtone doesn't work, i have to click on mute ringing btn to avoid sphone crash (general profile)22:51

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!