Sunday, 2025-10-05

T42_<roundedrectangle> hello, i'm having a weird issue, my device boots (not to the ui) and i can telnet into it on port 2323, test_hwcomposer and minimer segfault. i tried to check logcat but i get this: `/bin/sh: /system/bin/logcat: not found`. same for `/usr/libexec/droid-hybris/s09:32
T42_<roundedrectangle> ystem/bin/logcat`. i remembered that when initially building hal i got an error saying libdl_android.so file was not found. to fix i ran this:09:32
T42_<roundedrectangle> 09:32
T42_<roundedrectangle> ```09:33
T42_<roundedrectangle> cp out/target/product/s2/system/lib/libdl_android.so out/target/product/s2/system/apex/com.android.runtime.release/lib/bionic/09:33
T42_<roundedrectangle> cp out/target/product/s2/system/lib64/libdl_android.so out/target/product/s2/system/apex/com.android.runtime.release/lib64/bionic/```09:33
T42_<roundedrectangle> 09:33
T42_<roundedrectangle> could this be why logcat fails now?09:33
T42_<roundedrectangle> 09:33
T42_<roundedrectangle> `/system/bin/ls` also fails. `/system/bin/apexd` shows this:09:33
T42_<roundedrectangle> ```09:33
T42_<roundedrectangle> Binder driver could not be opened.  Terminating.09:33
T42_<roundedrectangle> libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 1227 (apexd), pid 1227 (apexd)09:33
T42_<roundedrectangle> Aborted (core dumped)```09:33
T42_<roundedrectangle> also `file /system/bin/logcat` shows that it requires `/system/bin/linker64` linker, and it is a symlink to `/apex/com.android.runtime/bin/linker64` which doesn't exist (/apex is an empty directory)09:34
T42_<elros34> check hadk-hot generating logs and so on sections then see what fails in journalctl (probably droid-hal-init)11:54
rinigus... and I just managed to get my first BT headset call working on SFOS/nagara. will keep the suspense, check more, and report details later.12:10
malrinigus: what did you change?12:27
rinigusnow tested several times and after reboot - all the same and I have a way to make it work12:29
rinigusfrom older logcats in android, I observed that there are logs like "APM::HwModule: createDevice: adding dynamic device AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, @:SUPPRESSED to module primary"12:30
rinigusthis leads to creation of devices that were later probed for BTSCO12:30
rinigusso, I traced back in android sources where it comes from and where it calls something on hidl12:31
rinigusturns out that on BT headset connection, there are calls to audio service that setConnectedState on BT headset to true.12:32
rinigusthis is reproduced in a small code at https://dpaste.org/fRpVm12:32
rinigusfinally, to make it work, I have to use https://github.com/Halium/android_vendor_halium_hardware/tree/halium-14.0 (correct branch)12:33
rinigusthen after establishing connection via BT, run my utility, and after that... all calls work as expected12:34
malit needs something else that just the halium hw module?12:34
mala bit odd that no other devices seem to need it12:34
rinigusmal: it needs https://dpaste.org/fRpVm12:34
malI'll need to do a bit of testing on some other devices12:35
rinigusmal: right now, I am used to have nagara as permanent "first". same was with SMS12:35
rinigusand probably more, don't manage to keep a track12:35
rinigusmal: basically, now I have to bake it into some daemon in SFOS that will track BT connections and will either enable or disable SCO on these devices.12:36
malwhich part of android code calls that usually?12:37
malrinigus: can you show output of binder-list for both /dev/hwbinder and /dev/binder12:39
rinigusin addition, how do you solve a problem with ld.config.txt and having audio.primary...so not loading when in /usr/libexec/droid.../lib64/hw? right now I manually bind mount hacked ld.config12:39
rinigus(will search for where it is called usually meanwhile)12:39
rinigusmal: my binders: https://dpaste.org/g2mkF12:40
maltrying to remember the audio module loading12:43
rinigusmal: all calls start from audio/BtHelper.java in frameworks. from there it goes through AudioPolicyManager to libaudiohal/.../DeviceHalHidl12:44
T42_<elros34> rinigus I don't know what I am talking about but maybe you could add appropriate code to https://github.com/mer-hybris/audiosystem-passthrough12:44
rinigusI was thinking about minimedia. but these days I have to pull repos together and see where it should go12:45
rinigusminimedia or whatever its called these days12:45
malI also feel that audiosystem-passthrough or https://github.com/mer-hybris/pulseaudio-modules-droid-hidl/tree/master or something would be more proper place but need to investigate more first12:46
riniguswhat about droidmedia?12:47
malmaybe but not sure how it would get the needed info, needs some thinking12:47
rinigusin android its part of audiomediapolicy and audioflinger, hence the suggestion12:48
rinigusbut we do need some BT stack knowledge too :(12:49
malI don't quite remember how bt call audio is even supposed to be handled12:52
malthat reminds me that I should try to finish pulseaudio update, only one device known to have issues with the new version, and that was bt audio, maybe even just call audio12:52
rinigusfor me call audio was working. I will look into candidates for inclusion of this BT headset handling.12:54
rinigushowever, please tell how you solve this: library "/usr/libexec/droid-hybris/system/lib64/hw/audio.primary.taro.so" ("/usr/libexec/droid-hybris/system/lib64/hw/audio.hidl_compat.default.so") needed or dlopened by "/usr/libexec/droid-hybris/system/lib64/libvndksupport.so" is not accessible for the namespace: [name="(default)", ld_library_paths="/usr/libexec/droid-hybris/system/lib64:/system/lib64:/vendor/lib64",12:54
rinigusdefault_library_paths="/vendor/lib64:/vendor/lib64/hw:/vendor/lib64/egl", permitted_paths="/odm:/vendor:/system/vendor"]12:54
rinigusbasically I need elegant way to add namespace.default.permitted.paths += /usr/libexec/droid-hybris/system to ld.config.txt12:55
malis that when you run regularly or from terminal?12:55
malor both12:55
rinigusmal: both.12:56
riniguswhich makes sense as /linkerconfig/ld.config.txt doesn't have that path permitted12:57
malI had that issue in a15 base12:59
malI was planning on patching linker a bit didn't yet finish it12:59
malin libhybris12:59
rinigusyes, makes sense. I can check it out...13:00
malsomehow appending libexec to allowed paths in there13:01
rinigusmal: after looking into libhybris linker code, decided to add patched ld.config.arm64.txt to /system/etc via overlay. that seems to be cleaner solution than messing with the linker14:53
malhmm, ok15:14
rinigusreasoning: current code is probably very close to aosp. we can easily pull these files from device, our packages don't change => regenerated ld.config.txt stays the same. that path has a preference to /linkerconfig and will be used instead if we have it. overlay makes it trivial to inject such config there15:21
T42_<roundedrectangle> now i have this in journalctl https://justpaste.it/7an25, it says it can't mount sysfs, selinuxfs, proc and some other stuff and shows Device or resource busy, how can i debug this further?15:21
mal@roundedrectangle are you sure you correctly applied patches before building hybris-hal?15:25
T42_<roundedrectangle> mal: i re-ran repo sync a few times after applying, do they reset after this?15:26
malyes, they do reset15:27
T42_<roundedrectangle> ok, thank you, i will re-apply them then15:27
malif you run full repo sync (without path at the end) it can lose the changes15:27
T42_<roundedrectangle> it's weird because fixup-mountpoint changes didn't get reset, but thank you anyway15:29
malrinigus: does that BT_SCO=on get set on that device and what is seen in log when that happens?17:41
rinigusmal: corresponding logs for broken case in SFOS are here: https://github.com/sailfishos-sony-nagara/main/issues/35#issuecomment-335917796117:44
riniguswhat's missing in SFOS logs is something like this: https://dpaste.org/rCQgk17:46
malthat log only show BT_SCO=off so wondering if that was earlier in log or not sent at all?17:48
malafaik BT_SCO=on is needed on some devices17:48
maland pulseaudio droid module show be setting that17:49
malunless for some reason it doesn't17:49
malhttps://github.com/mer-hybris/pulseaudio-modules-droid/blob/master/src/common/droid-util.c#L203517:50
malwould be interesting to know if that condition does not apply for some reason, please add some debug printing to see what happens maybe?17:50
rinigusmal: my mistake, it does try to set it to 1 but fails. failure in principle is on the top of https://dpaste.org/M1J2Z17:51
rinigus"ResourceManager: setParameter: 7988: SCO output and input devices are all unavailable"17:51
rinigusso, that happens if I use SFOS as usual. if I precondition with my util, all will work17:52
malwhat do you see in logcat when you run the util?17:53
rinigusessentially similar to android. just a sec17:53
rinigusmal: paste: https://dpaste.org/SwVGK17:55
malany idea which code prints that "SCO output and input devices are all unavailable"17:55
riniguson top - what happens after calling util; later during call17:56
rinigusmal: sorry, cut off - full line for failure was https://dpaste.org/M1J2Z#L10 . Its PAL17:56
malwhich project has that or is in blobs?17:57
malah, in qcom vendor oss stuff17:58
rinigusso, I am pretty sure that I need to make something that monitors connection of BT headsets/cars and then assist audiohal by stating that they are connected. (now to your question)17:58
rinigusmal: I think its in proprietary blobs. but let me check17:58
rinigusits a blob in my case: https://github.com/sony-nagara/android_device_sony_sm8450-common/blob/staging/lineage-21/proprietary-files.txt#L12018:00
malit's in vendor/qcom/opensource/pal afaik18:03
rinigusmal: with sony, I had to get that from blobs. otherwise something was breaking in my tests. but it was a while ago and I don't remember details18:05
rinigusI think I will make small standalone daemon and later we can decide whether it is POC and has to be integrated somewhere or would stay.18:14
malrinigus: possible idea: implementing PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED in droid module or some extra custom pa module which would call whatever is needed18:27
malassuming I understood correctly how those hooks work18:28
rinigusmal: I can check it out, thanks! but that will be tomorrow :)18:31
malrinigus: wondering if it would be possible do that what you do with set_parameters call since in PAL the stuff is handled in setParameters function in PAL_PARAM_ID_DEVICE_CONNECTION and there is also that PAL_PARAM_ID_BT_SCO and in your log from that util it does show also setParameter being called so you just need to find what to call18:36
malrinigus: in that log the set parameters call might be very simple if that is all, just the mac address and some other stuff18:40
rinigusmal: quite possible, as I call with just BT addr and string encoded type of device: https://dpaste.org/fRpVm#L42,43,46,52,53,5619:33
rinigusand for some reason I don't have anything in vendor/qcom/opensource/pal :(  . not part of my LOS tree19:38
rinigusbut it is in aosp1419:39
maloh, that is in x10iv and v source tree19:39
malbut I would assume it is relatively close to that19:39
malrinigus: line 4 in the paste you showed before https://dpaste.org/SwVGK#L419:40
rinigusprobably. yes, I have these sources in aosp14 / sodp for nagara too.19:41

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