Sunday, 2023-04-23

dodoradio[m]I understand that geoclue-providers-hybris loads a gps.[platform].so. I've noticed that two of my devices, on which I haven't been able to get gps working, have an flp.[platform].so. does anyone know what this is used for? flp is the fused location provider.00:35
dodoradio[m]is there any circumstance in which gps may be accessed without using FLP?00:35
dodoradio[m]https://developer.android.com/reference/android/location/package-summary this seems to be the way that location was accessed before flp, I imagine there won't be anything critical in flp that will be required for it to run00:39
maldodoradio[m]: which android base?00:58
malare you sure your device doesn't use binderized gps?00:59
dodoradio[m]Oreo. Hal backend01:18
dodoradio[m]That's the first one - casio wsd-f2001:19
dodoradio[m]The second, casio wsd-f21hr has pie and binder, though still has both libraries01:19
dodoradio[m]I'm very confused, the gps implementations between the two are very similar and I've not managed to get either working01:19
dodoradio[m]On both, gps is attached via serial. I have got the permissions for those serial ports both set correctly.01:21
dodoradio[m]Sorry to clarify, on both devices I have serial port permissions set correctly.... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/biGKKpmVqIykJoXHREuZCVUM>)01:27
maldoes strace reveal anything?01:30
Mister_Magistermal: u not asleep? lol01:34
malI probably should01:34
Mister_Magistersaaaaaaaame01:34
dodoradio[m]Strace does not reveal anything02:08
dodoradio[m]mal There's a power_gps method in the libraries used by both devices which sends the power command to the module, and I'm not sure if it's getting called. I tried gdb this morning to see if I could catch that method, but I'm a gdb noob and can't figure out how to set breakpoints on that library02:11
dodoradio[m]I can send a strace in the morning if you'd like to see that02:11
Mister_Magisterspeaking of gps, my gps also broke after i updated to 4.502:33
Mister_Magistergotta fix it someday02:33
T42<k1gen> any thoughts on this airbrush and seccam issues that I have? here are the logs: journal: https://0x0.st/HK8h.txt; logcat with camera actions: https://0x0.st/H8ED.txt; dmesg: https://0x0.st/H8E7.txt. /dev/ab_sm is owned by vendor_airbrush user&group, and setting 777 doesn't fix it10:44
T42<k1gen> *these10:44
maldodoradio[m]: also send full journal and logcat logs11:48
dodoradio[m]Oh, you're going to see some evil things in the journal. But yeah, give me a moment, will send.11:49
mal?11:51
dodoradio[m]https://dodorad.io/casio-ayu-journaldump12:07
dodoradio[m]https://dodorad.io/casio-ayu-logcatdump12:07
dodoradio[m]https://dodorad.io/casio-ayu-geoclue-hybris-strace12:07
dodoradio[m]mal sorry for the delay, here you go12:07
dodoradio[m]this is from the HAL device, running oreo12:07
dodoradio[m]it's using the vendor gnss library, I've got a copy of the so here if you want to take a look12:08
dodoradio[m]https://dodorad.io/gps.ayu.so12:09
maldodoradio[m]: none of the callbacks are ever called?12:19
maldid you add some debug printing to all of those12:19
dodoradio[m]I can't remember exactly, I think there is a bit of debug printing12:20
dodoradio[m]I'll try to find the patch12:20
malmake sure all of the callback functions in hallocationbackend.cpp have some printing so we can see if any of those get called12:20
dodoradio[m]Ok, I'll do that a bit later. Iirc I have a debug line for every nmea message, and I never get any nmea messages in loh12:22
dodoradio[m]In log*. But yeah, I don't believe I'm getting any callbacks. I'm very confused.12:22
malsome devices don't send nmea12:22
malafaik12:22
dodoradio[m]Oh, what?12:23
dodoradio[m]Ok, I'll add debug lines everywhere else as well then12:23
malI somehow remember that being the case, not 100% sure, but getting those status callbacks etc would be nice12:23
malalso wondering if your device could have custom gps header, you can see in the code that there is custom callback for some devices so getting information if any callbacks are called would be useful12:24
dodoradio[m]There's also a 'gpsAssistService.apk' on this watch, which runs in dalvik, but uses a native library to talk to the hw. I'm sure it's not relevant, but have you ever seen any gps setup being done from android's userspace?12:25
malif the callback struct is not matching your device it could cause issues12:25
dodoradio[m]By 'custom gps header' do you mean it could have completely different methods? I assumed that can't be the case because it would break compat with the rest of android's hal12:26
dodoradio[m]sorry, I can't check the patches right now, but here's a chunk of the symbol tree from looking at the binary in ghidra12:29
* dodoradio[m] uploaded an image: (103KiB) < https://matrix.org/_matrix/media/v3/download/matrix.org/VMpYVcbpwsFiVtWgiWAHPmut/clipboard.png >12:29
dodoradio[m](hopefully the image comes through fine on irc)12:29
malI mean this https://github.com/mer-hybris/geoclue-providers-hybris/blob/master/hal/hallocationbackend.cpp#L35512:30
malsomething like that exists in android side header12:30
malhttps://github.com/LineageOS/android_hardware_libhardware/blob/lineage-20.0/include/hardware/gps.h#L58812:31
malso find in your android sources the gps.h your device uses12:31
malanyway, first thing to check is whether any callbacks get called12:33
dodoradio[m]I don't have android sources - is there anything I can do with the existing binary, such as extracting the method names from something such as ghidra?12:33
malhmm, maybe12:34
dodoradio[m]Casio's gps solution is very custom and involves a microcontroller running a version of freertos12:34
dodoradio[m]I was expecting to see some errors talking about geoclue-hybris being unable to attach to the nonexistent callbacks...12:35
dodoradio[m]Anyway, yep, I'll try to patch in some more debug info later. Sorry, I was just trying to ask as many questions as possible while you're online. Thank you in any case.12:37
maldodoradio[m]: against which headers did you build that geoclue-provider-hybris?12:39
malyou said you don't have sources12:39
attahIs there a way to log hidl messaging?12:39
dodoradio[m]I believe asteroid builds geoclue-provider-hybris against generic headers, and it seems to work on most watches12:40
dodoradio[m]Sorry, my understanding of the gps hal isn't great. I wasn't sure at which layer it all converges to a universal interface.12:41
attahI can't help but think calling release on codecs for *any* stopping error, including not really having started might not be entirely optimal... but i really should check that a bit more scientifically12:42
T42<k1gen> mal: Mister_Magister said that fixing airbrush and seccam may help with camera issues, but I don't know why airbrush service is failing with right ownership on /dev/ab_sm, and I know even less about seccam. can you help, please?13:16
T42<elros34> disable airbrush and then start it with correct user defined in .rc file maybe via 'runuser' ro something like that. If i fails  than strace14:13
T42<k1gen> I'm sorry, I have a dumb question. I can't find airbrush service with systemctl. I have service airbrush /vendor/bin/hw/vendor.google.airbrush@1.0-service line in /vendor/etc/init/vendor.google.airbrush@1.0-service.rc14:25
T42<k1gen> systemctl list-unit-files --no-pager | grep '*airbrush*' doesn't give me anything14:27
T42<elros34> of course it's android service (it's in lineage's vendor) not linux14:28
T42<k1gen> can I even manage it with systemd?14:29
T42<elros34> systemd is not for android so you can't14:30
T42<k1gen> alright, but you said to "disable airbrush and then start it", how do I do that?14:31
T42<elros34> there was some command setprop/start but I do not remember exactly so use the easiest way: disabled_services.rc14:32
T42<k1gen> service airbrush /vendor/bin/hw/vendor.google.airbrush@1.0-service_HYBRIS_DISABLED then?14:33
T42<elros34> yeah14:34
T42<k1gen> and after rebooting runuser -u vendor_airbrush -g nobody /vendor/bin/hw/vendor.google.airbrush@1.0-service?14:34
T42<elros34> if that is the name of binary then yes looks sane but I didn't debug android services for a while so..14:35
T42<k1gen> service isn't crashing, but I have droid-hal-init: Service 'airbrush' (pid 14283) exited with status 1 in logcat again14:37
T42<k1gen> how should I strace it? runuser -u vendor_airbrush -g nobody -- strace?14:38
T42<elros34> so you still have service restarting? check why first instead14:39
T42<k1gen> https://paste.opensuse.org/pastes/6f03047853a214:40
T42<k1gen> runuser -u vendor_airbrush -g nobody /vendor/bin/hw/vendor.google.airbrush@1.0-service doesn't ouput anything at all14:40
T42<k1gen> @elros34 any other way to check why the service is restarting? I can send dmesg14:44
T42<k1gen> here's dmesg if it can help: https://0x0.st/HKPB.txt14:46
T42<elros34> add something like that: https://github.com/b100dian/droid-config-sake/blob/master/sparse/usr/libexec/droid-hybris/system/etc/init/disabled_services.rc#L14-L1514:46
T42<k1gen> thanks14:47
T42<k1gen> let me reboot and try again14:48
T42<elros34> check whether it prevents restarting airbrush. Then show logcat form running airbrush with runuser, does it show some initialization?14:48
T42<elros34> what do you have in vendor.google.airbrush@1.0-service.rc?14:48
T42<elros34> and do not use grep, it may hide output14:50
T42<k1gen> sorry for not answering, sometimes I just have to restart the phone 3+ times for it to boot fully, it may be stuck on spinning circle14:52
T42<k1gen> this time 6 reboots were needed14:53
T42<k1gen> @elros34 airbrush.rc: https://paste.opensuse.org/pastes/0dc548fc802b14:54
T42<k1gen> logcat with runuser -u vendor_airbrush -g nobody /vendor/bin/hw/vendor.google.airbrush@1.0-service running in the background: https://0x0.st/HKPS.txt14:57
T42<k1gen> I will be busy for one hour, I'll be back :)15:00
T42<k1gen> @elros34 I'm back, did the logs help?16:11
dodoradio[m]mal the thing is, I've also got the binder device. That one seems to just use the binder as an interface to a nearly identical hal to the ayu device I posted above. When using binder backend, it only starts the service, prints two lines to logcat and then idles. When using hal backend, it behaves exactly the same as ayu.16:25
dodoradio[m]I assume that the calls to binder are always standard, or is there a header file for those somewhere as well?16:25
dodoradio[m]and I've built a version with callback logging - I'm not getting any logs, it's not sending any callbacks at all16:27
dodoradio[m]the 'gnss_start' method does succeed though16:28
maldodoradio[m]: binder interface should be always the same, unless it has some custom interface, if you have libgbinder for the device you can get from the binder-list program from the libgbinder-tools package to see what interfaces there are on the device16:28
dodoradio[m]Ok, thank you16:33
dodoradio[m]Do you think it's possible that any hardware setup is being done by the gpsassistservice I mentioned above?16:34
malit's possible16:36
dodoradio[m]I will investigate the callbacks, but I'm thinking that the gps module may not even be on.16:36
malyeah, that could be16:36
malsince there was no error from the init I would assume the struct is ok, not sure though16:37
T42<k1gen> mal: can you help me with airbrush and seccam?16:46
T42<k1gen> still waiting for advice17:45
T42<elros34> so at least it starts for a while then I do not get why android service fails. Maybe you could add strace straight to .rc file18:13
T42<elros34> have you tried whther starting it manually helps for camera at all, maybe it's irrelevant anyway18:13
T42<elros34> for the seccam maybe you need such a change: https://review.lineageos.org/c/LineageOS/android_device_oneplus_sm8150-common/+/289848 but did you compare with lineage logs? maybe you have same irrelevant error in android18:20
T42<k1gen> I just tested, camera works as intended while runuser -u vendor_airbrush -g nobody /vendor/bin/hw/vendor.google.airbrush@1.0-service is running18:24
T42<k1gen> trying to record video crashes camera app though, and if I try to open it again I get black screen where preview should be18:26
T42<elros34> so check what fails when you try recording and after stopping18:26
T42<k1gen> @elros34 logcat: https://0x0.st/HKZY.txt18:30
T42<elros34> did you mark in logs your first camear start/stop or I need to read line by line18:31
T42<k1gen> I'm sorry, I didn't. how can I do it, so it would be easier for you to read the logs?18:32
T42<elros34> whatever you like: put "\n\n<<<<<<<<<< here I started jolla camera\n\n". these new android device are so verbose that it's hard to find right line in logs18:33
T42<k1gen> so I type things while /usr/libexec/droid-hybris/system/bin/logcat > logcat.txt 2>&1 is running, and then they appear in the file?18:34
T42<elros34> I do not know, how do you follow logs if you generate logs like that instead running logcat normally18:37
T42<k1gen> I don't really understand 99% of logs anyway. how should I type something while constant wall of text from logcat is moving?18:40
T42<k1gen> /usr/libexec/droid-hybris/system/bin/logcat > logcat.txt 2>&1 outputs everything in a file, which I then curl to 0x018:41
T42<elros34> you think I do, It's about search for some errors. If you start logcat normally then it should stop printing at some point then you write some comment, start jolla camera in other window, and try to understand something18:42
T42<elros34> like: "ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA" right before same camera attempts which may or may not be relevant18:43
T42<k1gen> I'm sorry, but logcat won't stop printing even if I wait for 5 minutes, there are constant errors happening in background18:44
T42<k1gen> if writing comment while logcat gets redirected to file works, I will do that in the future18:45
T42<elros34> errors from what service? you should fix that on efirst18:47
T42<k1gen> from a lot of stuff, this is included in the last logcat I sent, I didn't grep anything18:47
T42<k1gen> let me capture another one18:49
T42<k1gen> logcat of a phone, locked and display off: https://0x0.st/HKZU.txt18:51
T42<k1gen> oh and I noticed that when I start jolla-camera via ssh, I have [W] unknown:0 - CameraBin error: "Could not initialize supporting library." spam while preview is black18:52
T42<elros34> " Waiting for service 'media.audio_flinger' on '/dev/binder" could be relevant18:59
T42<k1gen> I searched for it in chat, do you need the output of binder-list -d /dev/binder?19:01
T42<elros34> read this: https://github.com/mer-hybris/audiosystem-passthrough, do you have audisystem packages installed?19:02
T42<k1gen> audiosystem-passthrough-dummy-af and audioflingerglue are not installed, audiosystem-passthrough and pulseaudio-modules-droid-hidl are installed19:06
T42<k1gen> should I install them and reboot?19:07
T42<elros34> I would start with audiosystem-passthrough-dummy-af19:08
T42<k1gen> installed, enabled and started it19:10
T42<k1gen> media.audio_flinger appeared in binder-list -d /dev/binder19:12
T42<k1gen> here's the new idling logcat: https://0x0.st/HKZk.txt19:14
T42<k1gen> let me reboot19:15
T42<k1gen> @elros34 this time camera app crashed when I tried to end recording the video. logcat: https://0x0.st/HKZh.txt; jolla-camera stdout: https://paste.opensuse.org/pastes/4e1190088d3f19:24
T42<k1gen> I'm sorry, I tried to comment things, but it didn't work : https://irc.thaodan.de/.imgstore/d1082135/file_4916.jpg19:25
T42<elros34> so what error you got when you start camera?19:29
T42<elros34> in logcat19:29
T42<k1gen> in logcat? I have no idea, commenting to file didn't work19:30
T42<k1gen> same [W] unknown:0 - CameraBin error: "Could not initialize supporting library." in stdout19:30
T42<elros34> I am too lazy to read these few thousand of  lines to find right one too. At least you have similar message as @b100dian "Codec2Buffer: GraphicMetadataBuffer does not work on 64-bit arch"19:34
T42<k1gen> I hope you understand that I couldn't comment in logcat, though I wanted to help you. thanks for helping so far19:37
T42<b100dian> @k1gen here's what I try to do sometimes, might work or not in your case: I output logcat to terminal directly. Around the time I click the record button (or the stop one) I use the Enter key on my host to add lines to that screen that outputs logcat. When I have to grab the logs, I select them using the mouse (when you reach the top/bottom of window it helps to move left-right) and stop around the time the lines get separated apart by me pr20:12
T42<k1gen> so the Enter key pauses logcat?20:14
T42<b100dian> No, it just adds.. enters to the terminal (I use konsole for example)20:14
T42<b100dian> So I can recognize from the wall of text20:15
T42<k1gen> let me make kitty's buffer huge and try that20:16
T42<k1gen> hope elros is still online20:16
T42<k1gen> thanks for suggesting, @b100dian20:16
T42<elros34> strange that dummy af broke camer little more, maybe you need not dummy one?20:17
T42<k1gen> it didn't break camera more, it actually got me a little further20:18
T42<b100dian> In my case after dummy-af I can at least restart the camera, iirc20:18
T42<k1gen> without it jolla-camera would crash when I hit the video record button, now I can record the video, but app crashes on stop button trigger20:18
T42<k1gen> what I can't understand is why airbrush works with runuser, but not as a service20:19
T42<k1gen> maybe I don't have nobody group?20:19
T42<elros34> check: groups or some similar cmd. Have you tried adding strace to .rc file?20:20
T42<k1gen> nope, remind me please how can I do that. I mean, where in file exactly20:22
T42<elros34> in .rc file which starts airbrush, if you do not remember where it is then read your own messages form channel:)20:22
T42<k1gen> no, I mean where in file to add strace20:23
T42<k1gen> I remember the file location20:23
T42<elros34> like in terminal just before command you want to strace20:23
T42<k1gen> there's no group nobody, but also no vendor_airbrush, and I remember that I created it20:24
T42<elros34> try as root20:25
T42<k1gen> /vendor/etc/init/vendor.google.airbrush@1.0-service.rc is unwritable, where can I overwrite the values defined there?20:25
T42<k1gen> @elros34 https://paste.opensuse.org/pastes/dee405009c8320:26
T42<b100dian> hmm.. this might be complicated. Since it's a dmsetup partition I don't think it can be easily mounted read-write20:27
T42<k1gen> I remember that I can bind mount, but I don't know where should I create the file to overwrite the values from /vendor20:27
T42<elros34> then usual way: bind mount or override in some other file20:27
T42<elros34> what the difference where do you put file? use /myhackingndirectory/1.rc20:29
T42<k1gen> I see, thanks20:29
T42<elros34> about groups try: getent group20:33
T42<k1gen> service airbrush strace /vendor/bin/hw/vendor.google.airbrush@1.0-service, right?20:35
T42<elros34> I would use full path to strace binary20:36
T42<k1gen> getent group: https://paste.opensuse.org/pastes/8fad7239cf9120:36
T42<k1gen> used full path for strace, thanks for advice20:37
T42<k1gen> should I change anything else in .rc before bind mounting?20:38
T42<k1gen> https://paste.opensuse.org/pastes/ba72179dc83d20:38
T42<k1gen> oh, and how can I persist bind mount over rebooting?20:39
T42<b100dian> add it to /usr/bin/droid/droid-hal-early-init.sh ?20:40
maldoesn't override work in .rc?20:40
malwith that and then adding hte custom .rc to libexec20:41
T42<k1gen> hey mal! thanks for advice, let me try that20:41
T42<b100dian> Is there any `ldd`-like tool to see why jolla-camera is loading `/usr/libexec/droid-hybris/system/lib64/libsfplugin_ccodec.so` (instead of the 32-bit one) ?20:45
T42<k1gen> mal: sorry, I'm a little sleepy already. what override did you mean, the one in disabled_services.rc? also, what do you mean by libexec?20:47
T42<b100dian> /usr/libexec/droid-hybris/... probably20:49
T42<b100dian> so just repeat the service definition in disabled_services.rc and add an override keyword below, and use user/group of choice20:50
malyep, just like b100dian said, you can add a new .rc file i.e. copy the .rc you want from /vendor to the libexec place, edit it and hopefully it works20:51
T42<k1gen> here's my disabled_services.rc and modified airbrush.rc: https://paste.opensuse.org/pastes/c0d9112ce54e. do I have to change anything besides deleting disabled after override?20:52
malno need to have it in disabled_services.rc if you add something like /usr/libexec/droid-hybris/system/etc/init/google.airbrush@1.0-service.rc which is copy of that vendor file, just replace the group stuff with correct values and then add as last line "override"20:54
T42<b100dian> I dont' know, would that start as root? I think adding a user/group (camera?) would be good20:54
T42<b100dian> or sorry, whatever user/group it works correctly under20:55
T42<elros34> user/group is correct, the point is only when starting manually it behaves correctly20:56
T42<k1gen> thanks, mal. will that work: https://paste.opensuse.org/pastes/0139a9e1341a?20:57
T42<k1gen> I deleted airbrush stuff from disabled_services.rc, of course20:59
T42<k1gen> I'm rebooting for 10th time, stuck on spinning circle, can't ssh and turn on the screen once it turns off21:12
T42<k1gen> at least I don't have the "no slot to boot" issue when rebooting a lot21:13
T42<k1gen> finally booted21:13
T42<k1gen> @elros34 logcat with comment on line 6942: https://paste.opensuse.org/pastes/1929dc2b04ca21:16
T42<k1gen> also camera app crashes on record button now, so I guess airbrush doesn't work again21:18
T42<elros34> what did you change so you expect different behavior?21:23
T42<k1gen> well I at least expected strace. or is it in journal?21:23
T42<elros34> no but did you actually add command? According to your previous paste, definitely no21:25
malwhat did you change in that .rc file, the group looks same21:27
maland user21:27
malnot sure what changes were really supposed to be done in the file, I haven't read all channel logs21:28
T42<elros34> user and group are correct but for some reason there is permission error21:29
T42<k1gen> nothing really, I just forgot about strace somehow21:30
T42<k1gen> https://paste.opensuse.org/pastes/f1bf8370f07e line 6153 is when I start jolla-camera21:33
T42<elros34> but what this have to do jolla-camera?, you were supposed to debug airbrush right?21:34
T42<k1gen> yeah, I edited the .rc in libexec, added /usr/bin/strace21:35
T42<k1gen> it's late here, I'm going to sleep. thanks for helping, hope we continue in the morning21:37
T42<elros34> sure, try something like that: 'mkdir -m777 /data/strace/' and in .rc file: 'service airbrush /usr/bin/strace -ff -o /data/strace/airbrush.strace /vendor/bin/hw/vendor.google.airbrush@1.0-service'22:24

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