KieronQuinn / AmbientMusicMod

Port of Now Playing from Pixels to other Android devices
GNU General Public License v3.0
1.81k stars 40 forks source link

[Bug] Ambient music failed to start. #13

Closed kriticalflare closed 2 years ago

kriticalflare commented 3 years ago

Device - Asus Zenfone Max Pro M1 (X00td) Android version - 10 Rom - Pixel Experience

When i try to test recognition, the process fails with "Ambient music failed to start" ambient_music_mod_log_dump_2021-04-20T19_22_39.353.zip

i found the lsposed logs to be interesting so attaching them as well

LSPosed Log
--------- beginning of information
Manufacturer: asus
Brand: asus
Device: ASUS_X00T_2
Product: X00TD
Model: ZenFone Max Pro M1
Fingerprint: google/coral/coral:11/RP1A.201105.002/6869500:user/release-keys
ROM description: coral-user 11 RP1A.201105.002 6869500 release-keys
Architecture: arm64-v8a
Android build: QQ3A.200805.001
Android version: 10
Android sdk: 29
LSPosed version: v1.3.5 (5551)
Riru version: v25.4.2.r415.f42e9c3 (415)
Riru api: 25
Magisk: 1469b82a (21101)
2021-04-20 17:03:44.044 E/?(1471-1471): de.robv.android.xposed.XposedHelpers$ClassNotFoundError: java.lang.ClassNotFoundException: com.android.server.soundtrigger_middleware.SoundTriggerHw2Compat
    at de.robv.android.xposed.XposedHelpers.findClass(Unknown Source:13)
    at de.robv.android.xposed.XposedHelpers.findAndHookMethod(Unknown Source:0)
    at com.kieronquinn.app.ambientmusicmod.xposed.apps.Android.setupSoundTriggerHooks(Android.kt:57)
    at com.kieronquinn.app.ambientmusicmod.xposed.apps.Android.onAppHooked(Android.kt:41)
    at com.kieronquinn.app.ambientmusicmod.xposed.Xposed.handleLoadPackage(Xposed.kt:25)
    at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(Unknown Source:2)
    at de.robv.android.xposed.callbacks.XC_LoadPackage.call(Unknown Source:6)
    at de.robv.android.xposed.callbacks.XCallback.callAll(Unknown Source:28)
    at X0.beforeHookedMethod(:1)
    at de.robv.android.xposed.LspHooker.handleHookedMethod(Unknown Source:75)
    at LspHooker_.startBootstrapServices(Unknown Source:8)
    at com.android.server.SystemServer.run(SystemServer.java:516)
    at com.android.server.SystemServer.main(SystemServer.java:359)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:918)
Caused by: java.lang.ClassNotFoundException: com.android.server.soundtrigger_middleware.SoundTriggerHw2Compat
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:454)
    at z0.b(Unknown Source:49)
    at de.robv.android.xposed.XposedHelpers.findClass(Unknown Source:5)
    ... 15 more
Caused by: java.lang.ClassNotFoundException: com.android.server.soundtrigger_middleware.SoundTriggerHw2Compat
    ... 19 more

Lsposed configuration

KieronQuinn commented 3 years ago

Considering SoundTriggerHw2Compat is literally part of AOSP, I have no idea what ASUS have managed to do there. Could you dump your entire framework directory maybe? I'll see if they're doing anything special.

Otherwise, you have the -61 error which has no known solution.

scientiac commented 3 years ago

EdXposed_Modules_20210421_035032.txt

My logs too show the same error, here in MIUI ,I guess it isn't only the case of ASUS 🤷

KieronQuinn commented 3 years ago

Same thing then, upload the framework directory.

scientiac commented 3 years ago

Can you tell me the path? I don't know where it is located

KieronQuinn commented 3 years ago

/system/framework

scientiac commented 3 years ago

Here you go:

https://drive.google.com/folderview?id=10HMsy86GSlTV2yY3I3gDqDjQrFIvDX9a

KieronQuinn commented 3 years ago

Thanks, I requested access

scientiac commented 3 years ago

Happy to help.

KieronQuinn commented 3 years ago

Please try this APK: https://drive.google.com/file/d/1LQMM1jb5ELc_gnCHsC8IrR7ihc_o5nLh/view?usp=sharing

No Magisk module update, just Xposed. Update and reboot when prompted by EdXposed.

If nothing now appears in the EdXposed logs, you can move on to the standard method of dumping logs if it doesn't work.

scientiac commented 3 years ago

Not the same one ,but similar error is still there. Screenshot_2021-04-22-06-00-17-677_org meowcat edxposed manager

And here is the Music Mod log : ambient_music_mod_log_dump_2021-04-22T05:57:29.814.zip

scientiac commented 3 years ago

EdExposed Log didn't upload , Here's the link to both logs:

https://drive.google.com/folderview?id=1WmhBn4_Dzx3wy2Wd_2KaK9bQ9xP6Mf1-

KieronQuinn commented 3 years ago

How about this one: https://drive.google.com/file/d/1UoQuiwl789yA8_-e7FsWCzAB5MNg4dAt/view?usp=sharing

scientiac commented 3 years ago

There is still an error in the Edexposed log.

The log files are on the same link In the 'log 2' folder.

https://drive.google.com/folderview?id=1WmhBn4_Dzx3wy2Wd_2KaK9bQ9xP6Mf1-

KieronQuinn commented 3 years ago

Progress though. Here's another: https://drive.google.com/file/d/1UolvtWRUCV8lfWXZt96ROvqS_FHQsmTv/view?usp=sharing

malmeloo commented 3 years ago

I'm having the same issue, running an OG Pixel with Lineage 17.1. The apk you just posted fixed the errors in LSPosed, but ambient music still failed to start.

Here's a zip of my framework files: https://drive.google.com/file/d/1-YYvHSRCuKC3PDVxIOEG3ljqK2i3tfWQ/view?usp=drivesdk

And here's a logdump from the app: https://drive.google.com/file/d/1-WgN7l8c8DUZ3bsN5MErALBYLzcdfEDs/view?usp=drivesdk

Hopefully this helps to fix the problem.

KieronQuinn commented 3 years ago

That's got a very interesting error:

exf: startRecognition failed, error=-1

Which is permission denied. One of the hooks I wrapped in a catch in the previous build (so it doesn't break the module if it doesn't exist) is responsible for disabling the permission check, so let me look again to see if there's an equivalent that needs disabling.

KieronQuinn commented 3 years ago

Actually looking further into it the permission denial is lower level, possibly caused by something else. Can you give a full log (as in a logcat) of it failing so I can see if there's any other info outside soundtrigger (might be SELinux potentially)

scientiac commented 3 years ago

I couldn't find the same error in EdExposed but it still says that it failed to start. The logs are in 'Log 3' in the same link.

https://drive.google.com/folderview?id=1WmhBn4_Dzx3wy2Wd_2KaK9bQ9xP6Mf1-

malmeloo commented 3 years ago

Here's a logcat taken after a reboot + attempted test recognition: https://drive.google.com/file/d/1-hTp54OojHV19FSr6oDNbKLsS4OR4yj6/view?usp=drivesdk

I can already see some interesting lines near the end, hopefully it's of any use.

KieronQuinn commented 3 years ago

Unfortunately it reveals this:

E ACDB-LOADER: Error: ACDB LSM returned = -19

The permission denied error is just masking the well known -19 error, which has no solution, sorry.

malmeloo commented 3 years ago

Ah, well, that's unfortunate. Thanks for the help anyway.

scientiac commented 3 years ago

What about mine ? What's in my dump?

KieronQuinn commented 3 years ago

Just the -1 error, which is coming from the driver. It's native code, can't do anything about it, sorry.

scientiac commented 3 years ago

Will it still be there if I use different custom rom?

KieronQuinn commented 3 years ago

No, the files that control this are in the vendor partition, which is only normally updated by the OEM. This is explained on the compatibility page.

AvgZing commented 3 years ago

Essentially, it's impossible to resolve the issue on MIUI (and ASUS?)

ch0rus commented 3 years ago

I don't know if it helps, but -19 is ACDB_INPUT_PARAMS_NOT_FOUND

Looks like it should be preceded by a logged error similar to "Failed to fetch the lookup information of the device %08X"

AgentHV commented 2 years ago

Device - OnePlus 8 Pro Android version - 12 Rom - "Nameless"-AOSP Xposed Setup - LSPosed Zygisk

Log: ambient_music_mod_log_dump_2021-04-20T19_22_39.353.zip

I have a pretty similar but slightly different issue in terms of the error. LSPosed log tells me:

----part 1 start----
[ 2022-03-02T17:53:51.411     1000:  1130:  1130 I/LSPosed-Bridge  ] Loading module ru.sswuvhqs.bcznmoxjy from /data/app/~~UfTf0XzpzPNilXoGCqiD8Q==/ru.sswuvhqs.bcznmoxjy-7ddL3NWAjdHjCQxVNbB_sw==/base.apk
[ 2022-03-02T17:53:51.439     1000:  1130:  1130 I/LSPosed-Bridge  ]   Loading class com.xposed.XSupport
[ 2022-03-02T17:53:51.452     1000:  1130:  1130 I/LSPosed-Bridge  ] Loading module com.kieronquinn.app.ambientmusicmod from /data/app/~~97wdosCnThM0tC1Z3tVCIw==/com.kieronquinn.app.ambientmusicmod-_tHtHoxEQ2uBvRiazEf0Og==/base.apk
[ 2022-03-02T17:53:51.557     1000:  1130:  1130 I/LSPosed-Bridge  ]   Loading class com.kieronquinn.app.ambientmusicmod.xposed.Xposed
[ 2022-03-02T17:53:52.201     1000:  1130:  1130 E/LSPosed-Bridge  ] java.lang.NoSuchMethodError: android.hardware.soundtrigger.SoundTriggerModule(int,android.hardware.soundtrigger.SoundTrigger.StatusListener,android.os.Handler)#exact
    at de.robv.android.xposed.XposedHelpers.findConstructorExact(Unknown Source:71)
    at de.robv.android.xposed.XposedHelpers.findAndHookConstructor(Unknown Source:27)
    at com.kieronquinn.app.ambientmusicmod.xposed.apps.Android.setupSoundTriggerHooks(Android.kt:80)
    at com.kieronquinn.app.ambientmusicmod.xposed.apps.Android.onAppHooked(Android.kt:42)
    at com.kieronquinn.app.ambientmusicmod.xposed.Xposed.handleLoadPackage(Xposed.kt:25)
    at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(Unknown Source:2)
    at de.robv.android.xposed.callbacks.XC_LoadPackage.call(Unknown Source:6)
    at de.robv.android.xposed.callbacks.XCallback.callAll(Unknown Source:28)
    at p.beforeHookedMethod(Unknown Source:3)
    at de.robv.android.xposed.LspHooker.handleHookedMethod(Unknown Source:75)
    at LspHooker_.startBootstrapServices(Unknown Source:11)
    at com.android.server.SystemServer.run(SystemServer.java:884)
    at com.android.server.SystemServer.main(SystemServer.java:617)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)

I also could find SoundTriggerService: 9f6ad62a-1f0b-11e7-87c5-40a8f03d3f15 is not loaded in the log but I'm not sure what it means. I have some lines in my logcat that tell me that there are some SELinux problems with LSPosed/Xposed: type=1400 audit(0.0:75429): avc: denied { read } for name="exposed" [...].

Still, this is quite unusual as I found reports of Ambient Music Mod working on the OnePlus 8 Pro, and afaik my ROM doesn't change much in terms of drivers. Can you make any rhyme of what's happening here?

KieronQuinn commented 2 years ago

I would guess it's broken with Android 12. My 7T Pro still doesn't have 12 (thanks OnePlus), so I don't have a device to test on to make sure, but it looks like the method signature has changed.

AgentHV commented 2 years ago

Oof... Anything I can do to fix it/help fix it? I also know people with Pixel 6 if that helps (if this needs files from an actual supported phone running on Android 12 for some reason).

KieronQuinn commented 2 years ago

I have a Pixel 6 Pro, it's not so much the files that are needed but being able to test changes on the fly. It might be as simple as the method signature changing or there could be loads of changes, I don't know.

langaliya-hitarth commented 2 years ago

Hello I'm having the same issue I don't know whats the reason i have whitelisted these apps still the issue persists. I am using a Oneplus 9R with Nameless CustomROM (A12) and Lsposed. Screenshot_20220420-163922_LSPosed And here is the log dump https://drive.google.com/file/d/150m6R5HzJ-rUON3C2KG4C0EyyhzRTRar/view?usp=drivesdk

AgentHV commented 2 years ago

Hey, Nameless gang :)

This is a known bug, Ambient Music Mod currently doesn't work on Android 12.