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

Search This thread

autobulb

Member
Dec 27, 2013
42
8
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.
 
  • Like
Reactions: JudgeDread11

NateDev

Senior Member
  • 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.
     

    autobulb

    Member
    Dec 27, 2013
    42
    8
    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.
    Thanks for the help. Unfortunately it doesn't seem to be working on OnePlus 5T. The Compatibility check failed one item but I decided to try anyway, and the test recognition doesn't start. Just posting for any other other possible 5T users here.
     

    shadowstep

    Forum Moderator
    Staff member
  • Jun 6, 2014
    5,203
    10,563
    30
    Ambala
    OnePlus 5
    @Quinny899 Everything checked out when it came to compatibility and the installation went on smoothly, but unfortunately I got hit by "exf: startRecognition failed, error=-61" (on my OnePlus 5, running OxygenOS 9.0.11 Pie), for which there doesn't seem to be a workaround yet (judging from having read the thread). Nonetheless, thanks for your hardwork and all that you do for the community!
     
    • Like
    Reactions: Quinny899

    hotelmariofan

    Member
    Aug 20, 2010
    25
    6
    Running on a Oneplus 8 Pro. Everything installed without any issue. I'm able to run a test, but it didn't seem to recognize any songs. I listened to the audio, and it sounded like what you'd imagine audio that has been heavily noise filtered would sound like. i.e. The music is very faint and cuts in and out. I tested again just with my own speech. Listened back, heard it all very clearly. Turned the music on full blast with the phone right next to it. That made the song recording actually audible, but still distorted enough (i.e. noise canceled enough) to not be able to clearly make out the song.

    I'm guessing this is some sort of noise canceling enforced by Oneplus? Not sure. Attached the log in case it's of any use.
     

    Attachments

    • ambient_music_mod_log_dump_2021-04-20T01_27_16.569.zip
      23.5 KB · Views: 14

    nicesoni_ash

    Senior Member
    May 26, 2012
    6,090
    10,950
    127.0.0.1
    This is really stupid to ask but I am unable to find the xposed module on either xposed repository or through edxposed app. Can anyone link me to it? Thanks.

    Edit:
    Ignore it pls. Module was installed and available after the reboot.
     
    Last edited:

    Karolpeszek

    Member
    Jul 1, 2020
    5
    1
    I can't get it to work on my OnePlus 7 Pro running Pixel Experience 11. 'Hey Google's works just fine tho. I can send you all the logs if you want. Cheers,
    Karol

    Update: it works, but my phone has to be plugged. As soon as you unplug it it stops listening. I disabled all battery optimizations and adaptive battery.
     
    Last edited:

    nicesoni_ash

    Senior Member
    May 26, 2012
    6,090
    10,950
    127.0.0.1
    Everything setup fine, sound model compatibility had some error but I override it as suggested and enabled everything else.

    Magisk module/xposed module enabled. All required apps enabled in edxposed White listed.

    But the mod failed to start recognition and presented with "Ambient music failed to start.".

    I collected logs just after that and attached here. Would be great if that's of any help to a positive outcome.

    I have a k20 pro with android 10 running RR custom rom.
     

    Attachments

    • ambient_music_mod_log_dump_2021-04-20T13_42_06.541.zip
      9 KB · Views: 5

    ock

    Senior Member
    Mar 9, 2010
    1,007
    1,382
    Running on a Oneplus 8 Pro. Everything installed without any issue. I'm able to run a test, but it didn't seem to recognize any songs. I listened to the audio, and it sounded like what you'd imagine audio that has been heavily noise filtered would sound like. i.e. The music is very faint and cuts in and out. I tested again just with my own speech. Listened back, heard it all very clearly. Turned the music on full blast with the phone right next to it. That made the song recording actually audible, but still distorted enough (i.e. noise canceled enough) to not be able to clearly make out the song.

    I'm guessing this is some sort of noise canceling enforced by Oneplus? Not sure. Attached the log in case it's of any use.
    Are you using OOS or a custom rom? I tried a recorder app and it seems there is some kind of noise cancelling ongoing, where the music picked up by one mic may be cancelled by another. Not sure if Google suppressed this noise cancellation in ambient services/ Now Playing, or if the Pixel phones only had one mic - sounds unlikely (pun unintended)
     

    Peketr

    Senior Member
    Jul 3, 2013
    153
    63
    OnePlus 7T
    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?
     
    • Like
    Reactions: JudgeDread11

    Tathagata Nandi

    Senior Member
    Oct 27, 2016
    117
    20
    Screenshot_2021-04-20-16-38-32-171_org.meowcat.edxposed.manager.jpg


    Screenshot_2021-04-20-16-38-14-958_com.kieronquinn.app.ambientmusicmod.jpg


    The module is active on xposed, i don't know what's the issue here. I'm running miui 12.5 android 10
     

    Quinny899

    Recognized Developer / Recognized Contributor
    Jan 26, 2011
    8,507
    7,747
    23
    Salford, Greater Manchester, UK
    quinny898.co.uk
    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?
    That's odd, is your Magisk up to date? For a while there was a bug with Magisk and OP devices where product modules didn't work, you may also want to try moving the APK & lib in the module to /system/priv-app rather than /system/product/priv-app.
     
    • Like
    Reactions: JudgeDread11

    Quinny899

    Recognized Developer / Recognized Contributor
    Jan 26, 2011
    8,507
    7,747
    23
    Salford, Greater Manchester, UK
    quinny898.co.uk
    Everything setup fine, sound model compatibility had some error but I override it as suggested and enabled everything else.

    Magisk module/xposed module enabled. All required apps enabled in edxposed White listed.

    But the mod failed to start recognition and presented with "Ambient music failed to start.".

    I collected logs just after that and attached here. Would be great if that's of any help to a positive outcome.

    I have a k20 pro with android 10 running RR custom rom.
    There's nothing in the Pixel Ambient Services logs in your dump (like nothing at all, not "nothing useful"), so it looks like you've not launched the Ambient Music app which you need to do before it works. If that doesn't work, make sure you've whitelisted the required apps in EdXposed/lsposed if you are using the whitelist mode.
     

    Quinny899

    Recognized Developer / Recognized Contributor
    Jan 26, 2011
    8,507
    7,747
    23
    Salford, Greater Manchester, UK
    quinny898.co.uk
    Running on a Oneplus 8 Pro. Everything installed without any issue. I'm able to run a test, but it didn't seem to recognize any songs. I listened to the audio, and it sounded like what you'd imagine audio that has been heavily noise filtered would sound like. i.e. The music is very faint and cuts in and out. I tested again just with my own speech. Listened back, heard it all very clearly. Turned the music on full blast with the phone right next to it. That made the song recording actually audible, but still distorted enough (i.e. noise canceled enough) to not be able to clearly make out the song.

    I'm guessing this is some sort of noise canceling enforced by Oneplus? Not sure. Attached the log in case it's of any use.
    That's pretty normal, it does that on mine and yet works fine. You may want to whack the amplification up even more (you can set a custom value in the advanced settings if the slider isn't enough)
     

    Quinny899

    Recognized Developer / Recognized Contributor
    Jan 26, 2011
    8,507
    7,747
    23
    Salford, Greater Manchester, UK
    quinny898.co.uk
    Ok so now I'm facing an issue as well. (I did switch from Edxposed to LSposed, not sure if that can cause any issues). Here's what happens.

    I play a song for 45s, turn on the screen, nothing. I leave the screen on, play another 45s, nothing. I turn the screen on, login, and then turn the screen off. Pretty quickly (5,10s) the song will update on the lock screen. If I listen manually, it will also listen.

    However, sometimes it will say "Failed to start" when doing it manually. Opening the app, waiting a bit, and just randomly it will start listening again. But I feel like its getting stopped a lot because half the time manually it says failed to start it feels like

    So it seems kinda hit or miss, like it gets killed sometimes (or maybe it just isn't waking up, I have it on automatic?, but that wouldn't affect the manual listening, which is also affected occasionally - AND I have it on listen when screen on). I have all the battery optimizations off for the apps and also sleep standby disabled. I will get logs tomorrow and reattach them.

    edit: Seems better on 1m interval but even still didn't detect a song 2mins in but showed up immediately once I hit the fp sensor and then locked the device again).

    I wonder what the frequency of automatic is


    EDIT: well after just leaving it on my desk screen off and playing 5 songs straight it got all of them, so seems to be working fine I guess for now? :p ill continue to see how it is, thanks this is a great mod, been waiting on a port since the pixel 2 release day haha
    Don't spam it, basically.

    It will 'fail to start' if it's already running a recognition (there's no way to cancel it, the cancel button really just dismisses the dialog and clears the memory of the recognition stuff in the app, Ambient Music is still recognising in the background regardless). So you need to wait the 8 - 10 seconds for it to run a recognition before trying again. This also includes automatic recognitions, be it from the device waking up or the periodic ones.

    To answer your question on how long 'automatic' is, it depends. The recognition engine gives a 'next check' time that can be anything from 30 seconds to 5 minutes as far as I've seen.
     
    • Like
    Reactions: NateDev

    TJS000

    New member
    Feb 6, 2013
    4
    0
    Hi all,

    I installed the mod on my Oneplus 9 Pro, ignoring the warnings that it was unsupported to get the installer. Using LSPosed and the v1.1.1 apk. I have System Framework, Android System, Ambient Services, and Device Personalization Services and all of the others mentioned in this thread enabled for the mod using LSPosed with battery optimisation disabled.

    On a restart, after starting the app, the first "test recognition" listens for a while, awaits a response, then I get "No response from Ambient Music" error. I have uploaded a log dump of this failure.

    Any subsequent "test recognition"s before I next restart result in the "recognition failed to start" error that other posters have. I've also attached a log dump of one of these failures.

    Let me know if there's anything else I can do to troubleshoot or help work out what's going on because this looks really cool!

    Thanks
     

    Attachments

    • ambient_music_mod_log_dump_2021-04-20T12_56_51.425[1].zip
      19.3 KB · Views: 4
    • ambient_music_mod_log_dump_2021-04-20T12_57_37.252[1].zip
      24.2 KB · Views: 3

    Top Liked Posts

    • There are no posts matching your filters.
    • 13
      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
      My bad, forgot to knock the internal version back down after testing the update dialog. I've "updated" the APK on GitHub, it's exactly the same build with the correct internal version, and will install on top :)
      1
      The font works fine (just using Magisk to place the fonts in the system). Making it be used on the system elements on the other hand was difficult, as overlays are partially broken on Oxygen OS 11. I made a custom Xposed module do it instead, which I won't be releasing as I don't want another thing to have to maintain.

      different person, same topic. just adding that another person would appreciate having this module lol, even if it was just a post and forget type thing with no support/updates. greatly appreciate all the work you do.