• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[MODULE][Magisk & Xposed][19/04] Ambient Music Mod - Pixel Ambient Music port for other, compatible devices

Search This thread

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,675
7,968
24
Salford, Greater Manchester, UK
quinny898.co.uk
Sure. As I wrote I get two error messages, it seems a little random which I get. Now I get "listening" first, then no response from service. Log attached.
This one has an error:

Code:
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation: com.android.server.soundtrigger_middleware.HalException: loadSoundModel_2_1 (code -1)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerHw2Compat.handleHalStatus(SoundTriggerHw2Compat.java:110)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerHw2Compat.loadSoundModel(SoundTriggerHw2Compat.java:155)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerHw2Enforcer.loadSoundModel(SoundTriggerHw2Enforcer.java:63)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerModule$Session$Model.load(SoundTriggerModule.java:470)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerModule$Session$Model.access$900(SoundTriggerModule.java:448)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerModule$Session.loadModel(SoundTriggerModule.java:287)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareValidation$ModuleService.loadModel(SoundTriggerMiddlewareValidation.java:447)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareLogging$ModuleLogging.loadModel(SoundTriggerMiddlewareLogging.java:214)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareService$ModuleService.loadModel(SoundTriggerMiddlewareService.java:111)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at android.hardware.soundtrigger.SoundTriggerModule.loadSoundModel(SoundTriggerModule.java:107)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger.SoundTriggerHelper.prepareForRecognition(SoundTriggerHelper.java:295)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger.SoundTriggerHelper.startRecognition(SoundTriggerHelper.java:385)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger.SoundTriggerHelper.startGenericRecognition(SoundTriggerHelper.java:210)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.startRecognitionForService(SoundTriggerService.java:489)
08-23 21:28:16.409  2007  3298 E SoundTriggerMiddlewareValidation:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.onTransact(SoundTriggerService.java:251)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging: loadModel[this=com.an[email protected]94b5f64, caller=10313/2641]({ data: {  }, dataSize: 34432, type: 1, uuid: "9f6ad62a-1f0b-11e7-87c5-40a8f03d3f15", vendorUuid: "9f6ad62a-1f0b-11e7-87c5-40a8f03d3f15" }) threw
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareValidation.handleException(SoundTriggerMiddlewareValidation.java:166)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareValidation$ModuleService.loadModel(SoundTriggerMiddlewareValidation.java:451)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareLogging$ModuleLogging.loadModel(SoundTriggerMiddlewareLogging.java:214)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareService$ModuleService.loadModel(SoundTriggerMiddlewareService.java:111)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at android.hardware.soundtrigger.SoundTriggerModule.loadSoundModel(SoundTriggerModule.java:107)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger.SoundTriggerHelper.prepareForRecognition(SoundTriggerHelper.java:295)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger.SoundTriggerHelper.startRecognition(SoundTriggerHelper.java:385)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger.SoundTriggerHelper.startGenericRecognition(SoundTriggerHelper.java:210)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.startRecognitionForService(SoundTriggerService.java:489)
08-23 21:28:16.410  2007  3298 E SoundTriggerMiddlewareLogging:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.onTransact(SoundTriggerService.java:251)

There's no known solution to this, sorry.
 

Legion303

Member
Sep 4, 2011
5
0
Denver
Any one get this working on a one plus 9 pro running stock rom
I expect that's similar enough to my OP9 with stock that the answer is currently "no." I also have the incompatible sound model and Java errors in my log which Quinny already said there's no known solution for. And on mine, either the app or Pixel Ambient Services cranks up the heat to the point of the phone throttling and popping an overheat error while it's processing.

This still looks promising. I'll keep checking for updates.
 

Sahacohn

New member
May 12, 2015
4
1
Sounds model incompatible, OnePlus 8T.
Screenshot_20210905-102110_Ambient_Music_Mod.png
 

Harkness

New member
Jun 30, 2017
2
0
Hi, I have a OnePlus 7 (Oxygen OS 11.0.3.1).
I have installed "Pixel Ambient Service (version 1.0.279736494)" and "Android System Intelligence (version R.26.playstore.pixel2.398031113)"
Opening LSposed and going on "modules" I have activated:
Framework System;
Android Accessibility;
Ambient Display;
Android System Intelligence;
Magisk;
OnePlus system Service;
Pixel Ambient Service;
System UI.

But on the lock screen, the app, doesn't appear and clicking on "Test recognition" appears "Ambient Music falied to start"
How I can do?

Here there is a dump file after a recognition failed:
 

Attachments

  • ambient_music_mod_log_dump_2021-10-17T19_32_34.244.zip
    12.6 KB · Views: 12
  • Screenshot_20211017-193228.jpg
    Screenshot_20211017-193228.jpg
    235.5 KB · Views: 29

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,675
7,968
24
Salford, Greater Manchester, UK
quinny898.co.uk
Hi, I have a OnePlus 7 (Oxygen OS 11.0.3.1).
I have installed "Pixel Ambient Service (version 1.0.279736494)" and "Android System Intelligence (version R.26.playstore.pixel2.398031113)"
Opening LSposed and going on "modules" I have activated:
Framework System;
Android Accessibility;
Ambient Display;
Android System Intelligence;
Magisk;
OnePlus system Service;
Pixel Ambient Service;
System UI.

But on the lock screen, the app, doesn't appear and clicking on "Test recognition" appears "Ambient Music falied to start"
How I can do?

Here there is a dump file after a recognition failed:
Something is wrong with the Magisk module install:

Code:
10-17 19:24:02.707  9888  9888 E AndroidRuntime: Caused by: java.lang.SecurityException: Caller does not hold the permission android.permission.MANAGE_SOUND_TRIGGER
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at android.media.soundtrigger.SoundTriggerManager.getModelState(SoundTriggerManager.java:442)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService.enforceCallingPermission(SoundTriggerService.java:1536)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService.access$000(SoundTriggerService.java:98)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.getModelState(SoundTriggerService.java:651)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.onTransact(SoundTriggerService.java:251)

Reinstall the module, and if that doesn't fix it there's nothing that can be done, sorry
 

Harkness

New member
Jun 30, 2017
2
0
Something is wrong with the Magisk module install:

Code:
10-17 19:24:02.707  9888  9888 E AndroidRuntime: Caused by: java.lang.SecurityException: Caller does not hold the permission android.permission.MANAGE_SOUND_TRIGGER
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at android.media.soundtrigger.SoundTriggerManager.getModelState(SoundTriggerManager.java:442)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService.enforceCallingPermission(SoundTriggerService.java:1536)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService.access$000(SoundTriggerService.java:98)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.getModelState(SoundTriggerService.java:651)
10-17 19:24:02.707  9888  9888 E AndroidRuntime:     at com.android.server.soundtrigger.SoundTriggerService$SoundTriggerServiceStub.onTransact(SoundTriggerService.java:251)

Reinstall the module, and if that doesn't fix it there's nothing that can be done, sorry
I tried but nothing to do. Can it be because the permission for "Pixel Ambient Service" must have the permission in "Always all the time"?. Because if it were to be so to me only marks the possibility of enabling "Allow only while using the app
 

Attachments

  • Screenshot_20211018-000652.jpg
    Screenshot_20211018-000652.jpg
    193.5 KB · Views: 18

appy123droid

Member
Oct 15, 2016
13
1
Interesting that it's started listening fine but didn't respond at the end, that suggests that maybe the delay time isn't long enough. Try using it as if it were working, see if it picks up music playing as that doesn't have the same delay limit
I'm having the same issue, that is, no respose after listening..... I followed and extracted the zip u provided still shows the same issue
 

Attachments

  • ambient_music_mod_log_dump_2021-11-10T11_01_47.516.zip
    17.2 KB · Views: 4
  • Screenshot_20211110-110106_Ambient Music Mod.png
    Screenshot_20211110-110106_Ambient Music Mod.png
    138.3 KB · Views: 19

Rand0mGuyy

Member
Apr 30, 2020
21
4
Installed it on a Oneplus 7 pro with andorid 12 custom ROM.
It seems to be installed ok but when I try the test recognition it doesn't work.
"Ambient Music failed to start".
Already tried rebooting and all the battery optimization is off.
 

Christos_A

Member
Oct 18, 2017
36
9
Sony Xperia V
Sony Xperia XA
Hey guys, for anyone who's been getting a sound model incompatible error, u need to disable the "Hey google" detection on Google Assistant. Also u need to tick those on LSPosed. That's how i got mine working on the latest OOS11 on an 8T. My problem now is that its using the noise cancelling mic, which kills audio quality and probably slows down detection as well.
 

Attachments

  • Screenshot_20211118-011411.jpg
    Screenshot_20211118-011411.jpg
    149.5 KB · Views: 53
  • Screenshot_20211118-011418.jpg
    Screenshot_20211118-011418.jpg
    349.9 KB · Views: 50
  • Screenshot_20211118-011420.jpg
    Screenshot_20211118-011420.jpg
    394.7 KB · Views: 59
  • Screenshot_20211118-011353.jpg
    Screenshot_20211118-011353.jpg
    411.6 KB · Views: 61
  • Screenshot_20211117-163631.jpg
    Screenshot_20211117-163631.jpg
    683.5 KB · Views: 63

Chiranz

Member
Sep 22, 2018
12
0
Xiaomi Mi A3
Hey,
iVe installed this module and everything is checked under compatibility.
Im still an error, the recognition wont start.

Ambient music failed to start!
 

Attachments

  • ambient_music_mod_log_dump_2021-11-26T20_06_52.521.zip
    20.4 KB · Views: 3
Despite the sound model check being passed, the service will not start (rog 2 running A12 Ponce's pixel experience gsi), any ideas why? I have disabled battery saver and battery optimisation for the apps it says but still didn't work ...
 

Attachments

  • screen-20211128-141824.mp4
    67.3 MB · Views: 0
There's no logs at all for Pixel Ambient Services in there. Have you started Pixel Ambient Services since the last reboot? There's at least one notification I can see in your video that suggests you haven't.
Since then I've realised it's due to having battery saver enabled. I have disabled it and it works but now it comes up saying no response back.
 

Attachments

  • Screenshot_20211129-081752.png
    Screenshot_20211129-081752.png
    132.6 KB · Views: 6
  • ambient_music_mod_log_dump_2021-11-29T08_20_25.7.zip
    17.4 KB · Views: 1

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Important: YOU MUST HAVE BOTH XPOSED AND MAGISK INSTALLED TO USE THIS MODULE. READ THE FAQ FOR MORE INFO.

    Ambient Music Mod​

    A hybrid Xposed & Magisk module that ports Pixel Ambient Music to other, compatible devices. If you don't know what Pixel Ambient Music is, it's the feature that recognises music that's playing in the background (ie. not from your phone) automatically. It does this locally, without a connection, and doesn't send any data to Google servers for recognition.

    The aim of this feature is simple - you'll never wonder "what's that song" again when around the house or out and about - as your phone will tell you without you even having to ask.

    Please read the FAQ before asking questions or reporting issues

    Features​

    • Full Ambient Music support, including downloading the latest databases from Google
    • Music recognition when the device is idle or in use (exclusions apply, see the FAQ for more details)
    • Now Playing History built in, and support for third party history apps
    • The ability to display the current now playing track on the lock screen using an Accessibility overlay service
    • Manual recognition on demand in the Ambient Music Mod app
    • Settings to control the amplification, how often recognition should be triggered, whether to run on the small CPU cores and what to do when a song recognition notification is tapped
    • View all the recognisable track in your locally downloaded database via the Track List option

    Requirements​

    • Magisk
    • Xposed
    • A device with a Snapdragon processor that supports Sound Trigger 2.1 or above (the app will tell you if it's compatible)

    Installation Instructions​

    • Install the latest release APK from the GitHub releases page
    • Open the app, check your device is compatible and build the module using the Build Installer option
    • Install the built Magisk module using the Magisk app
    • Enable the Xposed module in Xposed Manager
    • Reboot

    Changelog​

    1.1.1
    Fixed an issue where the Xposed warning dialog continue button did not work

    1.1
    • Added a new compatibility checker that checks if getModelState() [and therefore hopefully the module] is supported. This isn't 100% perfect so a bypass is also available
    • Tweaked sound trigger injection to include an XML line that's required for some devices
    • Fixed track list not loading for some people
    • Hopefully fixed log dump zips
    • Newly built modules will now also keep a copy of your original sound trigger XML. This change allows for comparison in the log dumps, and may help updates in the future.
    IMPORTANT: When updating the module (which will force you to uninstall/disable the current module and reboot), the module name will change. Therefore, you are advised to uninstall the previous module as part of this process.

    Screenshots​

    Ambient Music Mod displaying the currently playing track on the lock screen of a OnePlus 7T Pro running Oxygen OS 11:



    Settings, Installer, standard Ambient Music settings & Now Playing history



    You can verify that the songs displayed in these screenshots were being played at the time by viewing a screenshot of the playlist from the radio station being listened to at the time here

    1,270 days, stop the clock.
    2
    So this is a weird one. Installed on 7t OOS 11.0.0.2, but doesn't work.
    After some digging I realized that Magisk doesn't mount the pixel ambient services app into /system/product/priv-app, as in the folder gets created, but the apk and lib folder inside isn't there. They are there though under the /data/adb/modules/AmbientMusicMod folder. Tried installing manually, but I guess it needs to be a system app to function. What kind of logs should I even send for this one?
    Initially had this issue, but solved it by installing Zackptg5's Overlay Mount Fix. You can find it in Magisk Manager module downloads.
    2
    Sorry for the second question: when I try to enable the mod in LSPosed manager, it asks to me to select an app. I don't know which app to select and the Ambient Music apps don't appear on the list. If I don't select an app the mod doesn't get enabled. Not sure what to do about that.
    I selected System Framework, Android System, Ambient Services, and Device Personalization Services.

    For some reason this mods own app doesn't show up tho, otherwise I would've enabled it as well like mentioned.
    1
    App keeps asking to update and there is no update
    1
    It would be nice to have a list of compatible devices. I have a Poco F1 and it doesn't work because of drivers incompatibility issues
    It would have to be crowd sourced because there is no list of which devices have which sound trigger HALs. And crowd sourced incurs maintenance, checking for conflicts, figuring out why it works for someone but not someone else on the same device (instructions not followed correctly, system updates, etc.). It would basically become the same as this thread.