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/s | 09: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 |
mal | rinigus: what did you change? | 12:27 |
rinigus | now tested several times and after reboot - all the same and I have a way to make it work | 12:29 |
rinigus | from 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 |
rinigus | this leads to creation of devices that were later probed for BTSCO | 12:30 |
rinigus | so, I traced back in android sources where it comes from and where it calls something on hidl | 12:31 |
rinigus | turns out that on BT headset connection, there are calls to audio service that setConnectedState on BT headset to true. | 12:32 |
rinigus | this is reproduced in a small code at https://dpaste.org/fRpVm | 12:32 |
rinigus | finally, to make it work, I have to use https://github.com/Halium/android_vendor_halium_hardware/tree/halium-14.0 (correct branch) | 12:33 |
rinigus | then after establishing connection via BT, run my utility, and after that... all calls work as expected | 12:34 |
mal | it needs something else that just the halium hw module? | 12:34 |
mal | a bit odd that no other devices seem to need it | 12:34 |
rinigus | mal: it needs https://dpaste.org/fRpVm | 12:34 |
mal | I'll need to do a bit of testing on some other devices | 12:35 |
rinigus | mal: right now, I am used to have nagara as permanent "first". same was with SMS | 12:35 |
rinigus | and probably more, don't manage to keep a track | 12:35 |
rinigus | mal: 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 |
mal | which part of android code calls that usually? | 12:37 |
mal | rinigus: can you show output of binder-list for both /dev/hwbinder and /dev/binder | 12:39 |
rinigus | in 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.config | 12:39 |
rinigus | (will search for where it is called usually meanwhile) | 12:39 |
rinigus | mal: my binders: https://dpaste.org/g2mkF | 12:40 |
mal | trying to remember the audio module loading | 12:43 |
rinigus | mal: all calls start from audio/BtHelper.java in frameworks. from there it goes through AudioPolicyManager to libaudiohal/.../DeviceHalHidl | 12: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-passthrough | 12:44 |
rinigus | I was thinking about minimedia. but these days I have to pull repos together and see where it should go | 12:45 |
rinigus | minimedia or whatever its called these days | 12:45 |
mal | I 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 first | 12:46 |
rinigus | what about droidmedia? | 12:47 |
mal | maybe but not sure how it would get the needed info, needs some thinking | 12:47 |
rinigus | in android its part of audiomediapolicy and audioflinger, hence the suggestion | 12:48 |
rinigus | but we do need some BT stack knowledge too :( | 12:49 |
mal | I don't quite remember how bt call audio is even supposed to be handled | 12:52 |
mal | that 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 audio | 12:52 |
rinigus | for me call audio was working. I will look into candidates for inclusion of this BT headset handling. | 12:54 |
rinigus | however, 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 |
rinigus | default_library_paths="/vendor/lib64:/vendor/lib64/hw:/vendor/lib64/egl", permitted_paths="/odm:/vendor:/system/vendor"] | 12:54 |
rinigus | basically I need elegant way to add namespace.default.permitted.paths += /usr/libexec/droid-hybris/system to ld.config.txt | 12:55 |
mal | is that when you run regularly or from terminal? | 12:55 |
mal | or both | 12:55 |
rinigus | mal: both. | 12:56 |
rinigus | which makes sense as /linkerconfig/ld.config.txt doesn't have that path permitted | 12:57 |
mal | I had that issue in a15 base | 12:59 |
mal | I was planning on patching linker a bit didn't yet finish it | 12:59 |
mal | in libhybris | 12:59 |
rinigus | yes, makes sense. I can check it out... | 13:00 |
mal | somehow appending libexec to allowed paths in there | 13:01 |
rinigus | mal: 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 linker | 14:53 |
mal | hmm, ok | 15:14 |
rinigus | reasoning: 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 there | 15: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 |
mal | yes, they do reset | 15:27 |
T42_ | <roundedrectangle> ok, thank you, i will re-apply them then | 15:27 |
mal | if you run full repo sync (without path at the end) it can lose the changes | 15:27 |
T42_ | <roundedrectangle> it's weird because fixup-mountpoint changes didn't get reset, but thank you anyway | 15:29 |
mal | rinigus: does that BT_SCO=on get set on that device and what is seen in log when that happens? | 17:41 |
rinigus | mal: corresponding logs for broken case in SFOS are here: https://github.com/sailfishos-sony-nagara/main/issues/35#issuecomment-3359177961 | 17:44 |
rinigus | what's missing in SFOS logs is something like this: https://dpaste.org/rCQgk | 17:46 |
mal | that log only show BT_SCO=off so wondering if that was earlier in log or not sent at all? | 17:48 |
mal | afaik BT_SCO=on is needed on some devices | 17:48 |
mal | and pulseaudio droid module show be setting that | 17:49 |
mal | unless for some reason it doesn't | 17:49 |
mal | https://github.com/mer-hybris/pulseaudio-modules-droid/blob/master/src/common/droid-util.c#L2035 | 17:50 |
mal | would 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 |
rinigus | mal: my mistake, it does try to set it to 1 but fails. failure in principle is on the top of https://dpaste.org/M1J2Z | 17:51 |
rinigus | "ResourceManager: setParameter: 7988: SCO output and input devices are all unavailable" | 17:51 |
rinigus | so, that happens if I use SFOS as usual. if I precondition with my util, all will work | 17:52 |
mal | what do you see in logcat when you run the util? | 17:53 |
rinigus | essentially similar to android. just a sec | 17:53 |
rinigus | mal: paste: https://dpaste.org/SwVGK | 17:55 |
mal | any idea which code prints that "SCO output and input devices are all unavailable" | 17:55 |
rinigus | on top - what happens after calling util; later during call | 17:56 |
rinigus | mal: sorry, cut off - full line for failure was https://dpaste.org/M1J2Z#L10 . Its PAL | 17:56 |
mal | which project has that or is in blobs? | 17:57 |
mal | ah, in qcom vendor oss stuff | 17:58 |
rinigus | so, 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 |
rinigus | mal: I think its in proprietary blobs. but let me check | 17:58 |
rinigus | its a blob in my case: https://github.com/sony-nagara/android_device_sony_sm8450-common/blob/staging/lineage-21/proprietary-files.txt#L120 | 18:00 |
mal | it's in vendor/qcom/opensource/pal afaik | 18:03 |
rinigus | mal: 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 details | 18:05 |
rinigus | I 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 |
mal | rinigus: possible idea: implementing PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED in droid module or some extra custom pa module which would call whatever is needed | 18:27 |
mal | assuming I understood correctly how those hooks work | 18:28 |
rinigus | mal: I can check it out, thanks! but that will be tomorrow :) | 18:31 |
mal | rinigus: 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 call | 18:36 |
mal | rinigus: in that log the set parameters call might be very simple if that is all, just the mac address and some other stuff | 18:40 |
rinigus | mal: quite possible, as I call with just BT addr and string encoded type of device: https://dpaste.org/fRpVm#L42,43,46,52,53,56 | 19:33 |
rinigus | and for some reason I don't have anything in vendor/qcom/opensource/pal :( . not part of my LOS tree | 19:38 |
rinigus | but it is in aosp14 | 19:39 |
mal | oh, that is in x10iv and v source tree | 19:39 |
mal | but I would assume it is relatively close to that | 19:39 |
mal | rinigus: line 4 in the paste you showed before https://dpaste.org/SwVGK#L4 | 19:40 |
rinigus | probably. 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/!