Saturday, 2022-11-19

xmnAnyone get stuck after updating to the latest 4.4.0.72. Can't open any apps and the background are all gone. Can't even get to the terminal to clean up after with post_sfos_update06:04
T42<elros34> testing or devel sailfish image/repos?08:41
*** Ischwitch is now known as Ingvix09:01
T42<Ayman_rgab> @edp_17 samsung also ? (re @edp_17: I have the same issu...)16:27
T42<Ayman_rgab> hello17:51
T42<Ayman_rgab> on my device changing usb mode didn't work unless i restart usb-moded manually17:53
T42<Ayman_rgab> this log from usb-moded https://hastebin.com/eyazorivak.yaml17:53
malwhich device is that?18:25
T42<Ayman_rgab> mal: https://github.com/Exynos7880-Linux/droid-config-a5y17lte18:29
T42<edp_17> Yep. :] (re @Ayman_rgab: @edp_17 samsung also...)18:44
T42<Ayman_rgab> is anyway to restart usb-moded when usb connected or disconnected 0_018:46
malprobably we should find a proper fix instead of such a hack19:04
T42<Ayman_rgab> any suggestion19:07
mal@Ayman_rgab could you try to check what kind of power supply type it reports in /sys/class/power_supply/*/type for all of the devices there19:08
T42<Ayman_rgab> okay19:08
T42<Ayman_rgab> Mains19:09
T42<Ayman_rgab> Battery19:09
T42<Ayman_rgab> OTG19:09
T42<Ayman_rgab> POWER_SHARING19:09
T42<Ayman_rgab> Unknown19:09
T42<Ayman_rgab> Unknown19:09
T42<Ayman_rgab> USB19:09
T42<Ayman_rgab> Wireless19:09
maldoes any of those change when you disconnect the cable19:10
T42<Ayman_rgab> no they are the same19:12
malwell probably the present value in the USB one changes19:19
T42<Ayman_rgab> root@SamsungA52017 ~# cat /sys/class/power_supply/*/online19:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 419:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 119:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> usb connected19:25
T42<Ayman_rgab> root@SamsungA52017 ~# cat /sys/class/power_supply/*/online19:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 119:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> 019:25
T42<Ayman_rgab> usb disconnected19:25
malso it's the one that says USB as type if I read those correctly, also please don't paste that many lines here, use pastebin or similar service19:26
T42<Ayman_rgab> type USB changed to 0 from 1 when cable disconnected and type BATTERY changed to 1 from 4 (re @SailfishFreenodeIRCBridgeBot: <mal>so it's the one...)19:33
T42<Ayman_rgab> this's all types with full path https://hastebin.com/xacenubumi.kotlin19:34
malwhat could be causing it to not start charging19:35
malcan you check for any usb_moded related messages in journal log after reboot and also show those when you restart usb_moded19:37
piggz_mal: spiiroin: another fun weeirdness in the PP port ... sometimes pressing the power button shuts the system down....19:38
piggz_[32731.785667] DSME[2167]: pwrkeymonitor: Timer triggered, initiating shutdown19:39
piggz_[32731.620753] sun4i-drm display-engine: [drm:drm_atomic_check_only] checking 00000000fd30c25219:39
piggz_[32731.887976] DSME[2167]: state: shutdown request received from dsme19:39
piggz_[32731.908613] D[32731.645005] sun4i-drm display-engine: [drm:drm_atomic_nonblocking_commit] committing 00000000fd30c252 nonblocking19:39
piggz_SME[2167]: state: Normal shutdown19:39
piggz_[32731.935577] DSME[2167]: state: new state: SHUTDOWN19:39
piggz_[32731.952958] DSME[2167]: state: Shutdown or reboot in 2 seconds19:39
piggz_wonder why dsme is doing that19:39
T42<Ayman_rgab> maybe because of this /sys/class/power_supply/s2mu004-charger/ it's of type Unknown and it's online value always 0 (re @SailfishFreenodeIRCBridgeBot: <mal>what could be c...)19:39
T42<Ayman_rgab> okay (re @SailfishFreenodeIRCBridgeBot: <mal>can you check f...)19:39
piggz_@Ayman_rgab you can specify the exact device to monitor in the usb_moded config, i did this recently19:40
T42<Ayman_rgab> how ? (re @SailfishFreenodeIRCBridgeBot: <piggz_>@Ayman_rgab ...)19:40
piggz_grep the logs for udevadmin commands which monitor power_supply devices19:41
malpiggz_: but that seems to detect usb just fine, if I understood correct, just won't start charging19:41
T42<Ayman_rgab> charging work when i connect usb cable19:42
malso what doesn't work?19:42
malI'm a bit confused how that behaves19:42
T42<Ayman_rgab> when i change usb mode i had to restart usb-moded to take effects19:43
piggz_i would add -d to usb-moded command line to see what its doing19:44
malwait so changing usb mode manually is not working but otherwise it works?19:44
T42<Ayman_rgab> i did that (re @SailfishFreenodeIRCBridgeBot: <piggz_>i would add ...)19:45
piggz_it might be my problem, beause charging is done from other events19:45
piggz_on the pinephonepro, plugging in usb would not trigger the dialog, but would detect charging, so, had to manually specify the udev device to monitor19:46
T42<Ayman_rgab> for example i change mode  from developer mode to mtp mode and disconnect the usb cable then connect it again it still on developer mode only if i restart usb-moded.service mtp works (re @SailfishFreenodeIRCBridgeBot: <mal>wait so changin...)19:48
T42<Ayman_rgab> exactly the same issue with my device (re @SailfishFreenodeIRCBridgeBot: <piggz_>on the pinep...)19:50
piggz_see https://piggz.co.uk/sailfishos-porters-archive/index.php?log=2022-11-11.txt#line619:51
spiiroinpiggz_: mce & display on/off - in theory it can be mce, compositor, or both. if mce does it, then it is in mce via fbdev ioctl, or in mce-plugin-libhybris using android hal19:55
spiiroinit really should be only in compositor, but both doing fbdev ioctl:s does not hurt. if it goes to that hybris plugin... usually it should not19:56
piggz_spiiroin: its a native port, so not hybris19:56
piggz_ive been trying to collect logs for the kernel dev, however, last few times ive tried, dsme has decided to shut the phone down!19:56
spiiroinpiggz_: dsme & power key shutdown -> the idea is that if ui goes bonkers you can still do an orderly shutdown by pressing power key for five seconds19:57
piggz_spiiroin: this isnt 5 seconds though19:57
piggz_just a quick press19:57
piggz_maybe ill disable dsme until i get the other logs19:58
spiiroin1st thought: missing key up event? or dsme being seriously late with processing it?19:58
spiiroinpiggz_: you can also just move/rename the dsme power key plugin19:58
spiiroinhmm... "sun4i-*drm* display-engine" -> drm/kms? -> display power control should be in compositor20:00
* spiiroin is afk for a while, but... you might need to explicitly disable/hack mce side if it finds fbdev nodes20:01
piggz_spiiroin: i enabled drm logs to see if display is being commanded to power up...20:02
piggz_spiiroin: ill paste some logs showing mce getting power button then dsme shutting down...20:02
piggz_spiiroin: https://paste.mozilla.org/j7gAKJYq#L52,143 those lines are mce and dsme20:03
T42<Ayman_rgab> mal: all related usb-moded messages after reboot, when changing mode and after restart usb-moded https://hastebin.com/fejabitagu.apache20:15
T42<Ayman_rgab> udevadm monitor -p -s power_supply https://hastebin.com/veguyipuga.properties20:21
piggz_is that while plug /unplug cable?20:22
piggz_doesnt look like it20:22
T42<Ayman_rgab> yes (re @SailfishFreenodeIRCBridgeBot: <piggz_>is that whil...)20:22
T42<Ayman_rgab> POWER_SUPPLY_STATUS=Charging and POWER_SUPPLY_STATUS=Discharging20:23
T42<adampigg> but, that only lists the battery device, no others .. no wonder usb-moded doesnt react20:24
T42<Ayman_rgab> what could cause this20:25
piggz_try without the -s power_supply and see what event happen when you plug in a cable20:26
T42<Ayman_rgab> okay20:30
T42<Ayman_rgab> udevadm monitor -p https://hastebin.com/anabalusuh.properties20:32
piggz_interesting, there is typec add/remove events only20:36
piggz_best ask an expert now :)20:37
T42<Ayman_rgab> waiting for mal20:38
mal@Ayman_rgab I see something like "droid-hal-init: starting service 'usbd'.." try disabling that usbd if it's running20:53
malif android side usb process is running it can confuse usb when usb_moded is also controlling it20:54
spiiroinpiggz_: there is ~4.5 seconds from mce logging power key down and dsme deciding to shut down because it is still down... is there key up event? does mce/dsme see it? is it coming from a input device that could be grabbed by mce? which should no longer be necessary, but I can't recall if it is still default behavior21:09
malso evdev_trace -i and check also -t21:09
spiiroin(if kernel sends it, it could be/seem lost by a process X due to buffer overrun, input device grabbing, scheduling delay, whatnot)21:11
spiiroinbut testing will be simpler if you disable/mask whole dsme, or just the power key handler i.e. "mv /usr/lib/dsme/pwrkeymonitor.so /usr/lib/dsme/pwrkeymonitor.so.disabled"21:12
spiirointhere have been some devices where weird things can happen to input devices around suspend, so kernel bugs are possible too21:14
T42<Ayman_rgab> mal usbd disabled https://hastebin.com/niyogunelo.apache21:14
malany difference?21:20
malin how it works now21:21
T42<Ayman_rgab> no difference21:21
malhow did you test it21:22
T42<Ayman_rgab> . (re @Ayman_rgab: for example i change...)21:22
maltry some other mode than mtp just in case mtp has some issue21:24
mallike charging only mode or something21:24
T42<Ayman_rgab> same also every mode change requires restarting usb-moded21:27
malit's quite difficult to check those logs when I have no idea at what timestamp you did what21:28
T42<Ayman_rgab> and with always ask mode when plugging cable it just charging not show a menu of modes21:29
malshow log from such attempt21:30
T42<Ayman_rgab> https://hastebin.com/iyivaqaquv.yaml21:36
T42<Ayman_rgab> setting mode to ask then detached usb and attach again didn't trigger usb moded21:37
malcan you check what usb-moded packages you have installed?21:41
T42<Ayman_rgab> https://hastebin.com/ibasidoxig.properties21:46
malI think you should have usb-moded-defaults-android and usb-moded-developer-mode-android instead the non -android ones21:46
T42<Ayman_rgab> # USB mode controller21:51
T42<Ayman_rgab> Requires: usb-moded21:51
T42<Ayman_rgab> Requires: usb-moded-developer-mode-android21:51
T42<Ayman_rgab> Requires: usb-moded-defaults-android21:51
T42<Ayman_rgab> Requires: usb-moded-mtp-mode-android21:51
malyou have those?22:03
T42<Ayman_rgab> now yes22:10
T42<Ayman_rgab> https://hastebin.com/gadizozuba.apache22:10
T42<Ayman_rgab> but no difference22:11
malno difference in dmesg either?22:13
maljournal I mean22:13
T42<Ayman_rgab> yes same22:13
malthe udevadmin output you showed is odd since it only showed battery messages22:19
malyou mentioned you tried hardcoding path in usb moded config, have you done anything else there? and what was the change you did22:20
T42<Ayman_rgab> this one shows android_usb and typec also https://hastebin.com/anabalusuh.properties22:20
malyou didn't answer if you had changed something in usb moded configs22:30
T42<Ayman_rgab> ah didn't see that, no i did not change anythings22:31
T42<Ayman_rgab> "you mentioned you tried hardcoding path in usb moded config" didn't help at all22:33
malwhich path did you use?22:34
T42<Ayman_rgab> this one /sys/class/power_supply/battery/22:35
T42<Ayman_rgab> is this ok22:36
T42<Ayman_rgab> rpm -qe -s usb-moded-defaults-android22:36
T42<Ayman_rgab> (contains no files)22:36
malyes22:37
T42<Ayman_rgab> what all this https://hastebin.com/ogasoxehus.yaml22:38
T42<Ayman_rgab> is it normal ?22:39
T42<Ayman_rgab> what if i run udevadmin while changing mode and restarting usb-moded22:41
T42<Ayman_rgab> https://hastebin.com/menavilaqi.properties (re @Ayman_rgab: what if i run udevad...)22:44
T42<edp_17> I've tried exactly that and it worked well before 4.4.0.72. Then this update broke something, so I had to remove that hack. (re @Ayman_rgab: https://hastebin.com...)22:45
T42<Ayman_rgab> which hack ? (re @edp_17: I've tried exactly t...)22:47
T42<edp_17> This hack: https://paste.ubuntu.com/p/BW9Hg3Jdf3/22:49
T42<edp_17> Basically, with these two used rule I force-restarted usb-moded when I plugged the cable in.22:50
T42<elros34> mask usb-moded, restart device and then get logs from udevadm. I think usb-moded can mess with gadget so your kernel stops sending power_supply present/online events. IIRC there wer some options to handle it but it could be removed22:51
malone option is -a parameter for usb-moded22:52
malwhich is "keep gadget active on broken android kernels"22:52
T42<elros34> but is it even handled or it is just dummy option. I think long time ago when I have tried it didn't help but I could be wrong22:53
malseems that is not used anymore22:54
T42<Ayman_rgab> why you remove it (re @edp_17: Basically, with thes...)22:55
T42<edp_17> Because the usb menu popped up when the cable wasn't attached.22:56
T42<Ayman_rgab> when i set -a or -i it said that these are deprecated (re @SailfishFreenodeIRCBridgeBot: <mal>one option is -...)22:56
T42<Ayman_rgab> i'll try this (re @elros34: mask usb-moded, rest...)22:57
T42<Ayman_rgab> that's Mess (re @edp_17: Because the usb menu...)22:59
T42<Ayman_rgab> https://hastebin.com/tumufasuso.properties (re @elros34: mask usb-moded, rest...)23:07
T42<elros34> can't check it, this paste service blocked me now23:08
T42<edp_17> I've added -a to usb-moded.service (into usb-moded-args.conf) and applied the hack I described above. Are the "Fallback since cable detection might not be accurate." and "unexpected change" messages expected? https://paste.ubuntu.com/p/nwZpqSvzbg/23:09
T42<elros34> but support for -a was removed 4 years ago23:10
T42<edp_17> mal has mentioned it a few minutes ago. ;)23:11
T42<Ayman_rgab> yes same here (re @edp_17: I've added -a to usb...)23:11
T42<Ayman_rgab> if you add -d you will see a message telling that -a are deprecated (re @edp_17: mal has mentioned it...)23:12
T42<edp_17> Ah, okay. Thanks. I've removed it as didn't help anyway.23:13
T42<elros34> just a hint, you should be adding -D for debugging purposes23:13
T42<edp_17> Thanks!23:14
T42<Ayman_rgab> https://pastebin.com/rvgEB2zK (re @elros34: can't check it, this...)23:14
T42<Ayman_rgab> i have a wired behavior if usb-moded running when i remove usb cable battery icon take 5 seconds to changed but if usb-moded stop it changed immediately23:17
T42<edp_17> Interesting, when I plug the cable in the device plays a sound so it recognises that a cable is attached. But the usb  mode selection window isn't popping up.23:17
T42<Ayman_rgab> same sound, vibration and showing charging message (re @edp_17: Interesting, when I ...)23:18
T42<Ayman_rgab> * only if mode set to ask23:19
T42<edp_17> or it set to Charging only23:20
T42<Ayman_rgab> yeah23:21
T42<elros34> so you never get any udev event from power_suppply device other then battery when connecting/disconnecting cable?23:22
T42<Ayman_rgab> only battery23:22
T42<elros34> but parameters change if you do cat /sys/class/power_supply/<something different than battery>/* right? If yes then I think it would be the best to fix it in kernel and call power_supply_changed() method23:24
T42<edp_17> @elros34 : I have these. udevadm monitor -p -s power_supply: https://paste.ubuntu.com/p/SMsc2Xqr9D/23:25
T42<edp_17> grep . /sys/class/power_supply/*/uevent: https://paste.ubuntu.com/p/698wvGvMG3/23:25
T42<elros34> looks sane, just no power_supply_cahnged in kernel23:26
T42<Ayman_rgab> yes it's changed (re @elros34: but parameters chang...)23:26
T42<elros34> I wonder if usb-moded how some poll method23:27
T42<edp_17> Yes. I've checked /sys/class/power_supply/max77843-charger/*: https://paste.ubuntu.com/p/jkp93VdjvR/ (re @elros34: but parameters chang...)23:28
T42<edp_17> Do you know what to fix in kernel?23:29
T42<elros34> I was messing with this but it was long time ago23:33
T42<Ayman_rgab> @elros34 https://github.com/Exynos7880-Linux/android_kernel_samsung_universal7880/blob/d23407efef675eb885d9a7f1d261b670fd0b003b/drivers/battery_v2/s2mu004_charger.c#L11423:33
T42<Ayman_rgab> or https://github.com/Exynos7880-Linux/android_kernel_samsung_universal7880/blob/d23407efef675eb885d9a7f1d261b670fd0b003b/drivers/battery_v2/s2mu004_charger.c#L114223:33
T42<elros34> yeah that function must be called whenever usb connection change but not with otg but some different device23:34
T42<edp_17> Thanks, I'll try this.23:35
T42<elros34> but maybe there is easier way, because IIRC mainline drivers also do not use this23:37
T42<edp_17> How should I know what charger the device has? I only have drivers/battery in kernel source. Do not have battery_v2. And within I have these: https://paste.ubuntu.com/p/9C5KKSrhVB/23:41
T42<Ayman_rgab> this one max77843-charger23:42
T42<Ayman_rgab> not v223:42
T42<elros34> I think I linked you obj2pro whhich should help you figure out which drivers your device use23:42
T42<edp_17> Oh, yes. I remember that.23:44
T42<elros34> this is the ugly patch I  have created once for usb issues: https://github.com/elros34/freetab_8014/blob/master/droid/kernel/0007-Some-battery-usb-changes.patch. vbus_id_hw_scan changed on every connection so I call power_supply_changed(&axp_charger->usb); based on some params23:48

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