A hybrid Xposed & Magisk module that ports Pixel Ambient Music to other, compatible devices

Overview

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 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

Screenshots

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

Ambient Music Mod on lock screen

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

Ambient Music Mod

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

Comments
  • Overlay causing bootloop with some OEMs (Samsung, OnePlus)

    Overlay causing bootloop with some OEMs (Samsung, OnePlus)

    • Oneplus 8
    • Android 12
    • Version 2.0.1

    When installing the overlay a round hole near the supposed camera location appears and the clock disappears from the statusbar. The power button seems to be remapped from opening the power menu, to opening the Google Assistant. To open the power menu I need to do Power+Vol Up.

    See attached image:

    image

    Any other info needed let me know.

    bug 
    opened by duramato 37
  • [Bug] Ambient music failed to start.

    [Bug] Ambient music failed to start.

    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

    Resolved in 2.0 
    opened by kriticalflare 33
  • Issue when cloning the project.

    Issue when cloning the project.

    I cloned the project but was faced with a security exception after installing the app on my phone.

    FATAL EXCEPTION: DefaultDispatcher-worker-2
                                                                                                        Process: com.kieronquinn.app.ambientmusicmod, PID: 17412
                                                                                                        java.lang.SecurityException: Not allowed to bind to service Intent { act=com.kieronquinn.app.pixelambientmusic.RECOGNITION_SERVICE pkg=com.kieronquinn.app.pixelambientmusic }
                                                                                                        	at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2064)
                                                                                                        	at android.app.ContextImpl.bindService(ContextImpl.java:1976)
                                                                                                        	at com.kieronquinn.app.ambientmusicmod.repositories.AmbientServiceRepositoryImpl.getService(AmbientServiceRepository.kt:60)
                                                                                                        	at com.kieronquinn.app.ambientmusicmod.repositories.DeviceConfigRepositoryImpl.sendValues(DeviceConfigRepository.kt:201)
                                                                                                        	at com.kieronquinn.app.ambientmusicmod.repositories.DeviceConfigRepositoryImpl$sendInitial$1.invokeSuspend(DeviceConfigRepository.kt:191)
                                                                                                        	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                        	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
                                                                                                        	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
                                                                                                        	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
                                                                                                        	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
    

    Can you please let me know what is going wrong and provide a fix? thanks!

    duplicate 
    opened by githubashutoshsoni 14
  • Didn't Install Pixel Ambient Services and causes Play Services to crash

    Didn't Install Pixel Ambient Services and causes Play Services to crash

    So I tried to follow the instructions just like you mentioned, Installed the Magisk module, enabled the XPosed module and whitelisted the apps, but at that point I realized that I don't have the Pixel Ambient Services (I assume the module is supposed to install it themselves because you no where mention which version is even supported). It also made my play services continuously crash. I don't know if this is because my Phone (OnePlus 7 Pro) was listed as incompatible but I don't think that's the cause. Please let me know if this is my fault or if there's something I can do to fix it, thank you

    Screenshot_20211205-203406 Screenshot_20211205-204053

    opened by MKCOOL142 13
  • Ask Google after song recognition not working

    Ask Google after song recognition not working

    When the song is recognised, I select "Ask Google" nothing happens. Is this not working (known bug)? Anyways now playing working very good on my device, very much thanks for such a mod. Screenshot_20220620-201842_Ambient Music Mod

    opened by tejas2004 12
  • Ambient Mod not showing on Lockscreen

    Ambient Mod not showing on Lockscreen

    Hi there I just recently updated your Ambient music mod and found some of the features is not working for me.

    1. Now playing is not showing up on Lockscreen
    2. Offline recognition not working

    Android version - Android 12 Device - Realme 2 Pro ROM - Derpfest Magisk - magisk v23.0

    opened by mjain234 11
  • Xposed Module not enabled You must enable the Xposed module for Ambient Music to work

    Xposed Module not enabled You must enable the Xposed module for Ambient Music to work

    My device is Redmi 4X, LianageOS 18.1. I have installed Edxposed, but it still shows "Xposed Module not enabled You must enable the Xposed module for Ambient Music to work"

    Resolved in 2.0 
    opened by hehedemuse 11
  • Doesn't Recognise Songs - Noise during playback

    Doesn't Recognise Songs - Noise during playback

    I have tried recognising songs manually from the Ambient Music Mod App. I played a song, the app showed no results found. Tried playing the playback and it was full of noise. Tried lowering the gain upto 0.1x and still the noise was there.

    I am using Galaxy S20 FE 5G, not rooted. Can give logs if needed.

    Thanks for your Awesome work!

    opened by mdcc22 10
  • can't get the right pixel ambient services app

    can't get the right pixel ambient services app

    So my phone is oneplus 7t pro, and I don't have pixel ambient services app in stock. So I tried different version of this from apkmirror, but still cannot get the right one. I tried the oldest version which is 1.0.17, but still when I click "lauch ambient music app" button I got the mod app shut down immediatly, and it says that pixel ambient services version is not right. I try click "test recognition" and it fail to start.

    Resolved in 2.0 
    opened by fenglipop29 10
  • Lockscreen overlay not working

    Lockscreen overlay not working

    This on an OnePlus 8 on Oxygen OS 11 App version 1.1.1

    It shows the notification from the correct guess, but doesn't show the overlay on the lockscreen.

    Here's the log dump: ambient_music_mod_log_dump_2021-04-20T13_58_01.967.zip

    If any other info is needed let me know.

    opened by duramato 9
  • Crashes after Restarting

    Crashes after Restarting

    Recently for apparently no reason when I restart my phone (OnePlus N10, Oxygen OS 11) with SUI, LSposed, and AmbientMusicMod enabled everything seems to work fine, but then crashes shortly after. I was able to work around this by disabling AMM via App Manager and restarting, then enabling AMM again, but this is very annoying to do every time the device restarts.

    wontfix 
    opened by Delamcode 8
  • Cannot replay from history

    Cannot replay from history

    Device: Xiaomi Mi 9T Pro running LineageOS based on android 12 without google play services.

    I was able to listen once when I first installed ambient music mod, but after that it crashes every time. See video below:

    https://user-images.githubusercontent.com/50382414/210181412-12321214-de9a-4807-a499-5e4079f8dca9.mp4

    opened by Donkey-Doug 1
  • The mod works with battery saver disabled but not with saver enabled

    The mod works with battery saver disabled but not with saver enabled

    I have run on battery saver option enabled from the app's settings but it doesn't seem to work.

    On demand and offline works perfectly fine, so does the lockscreen mode with battery saver off but I usually have battery saver enabled so it would be so helpful.

    I also have the app set to "unrestricted" in battery option

    Device: Poco F3 (alioth) Rom: Ancient OS 12.1 App version: all latest. Google: 13.44.9.29 Ambient music mod: 2.0.5 Now playing: 1.0.3

    opened by Kronodile 0
  • Manually detected songs keeps being shown in Lockscreen when disabled recognition (Bed time mode)

    Manually detected songs keeps being shown in Lockscreen when disabled recognition (Bed time mode)

    Steps to reproduce:

    1. Activate bedtime mode schedule and proceed when that is active.
    2. Manually recognize a song from inside app.
    3. Music name is kept showing in Lockscreen even after long time. (Assumption: Probably until new song isn't recognized or bed time mode is disabled)

    Expected result: Music name is Shown until the song is finished. Then cleared. Based on recognizing how long it needs to end.

    Device: K20 Pro Android 13 AOSP rom

    opened by FuSan21 0
  • Download multiple countries' databases

    Download multiple countries' databases

    Is it possible to add a feature where we can download many countries' databases? Maybe that way it could recognize more tracks (in other languages too)

    opened by harshil21 1
  • Unable to access Now Playing history

    Unable to access Now Playing history

    I'm on the latest versions of both the mod and Now Playing. Clicking on Now Playing history goes to its separate app which crashes immediately without showing anything. Screenshot attached showing the same in the recent tasks menu. Screenshot_2022-07-04-19-55-43-08_b783bf344239542886fee7b48fa4b892

    opened by sherloked 13
Releases(2.0.5)
  • 2.0.5(Jun 30, 2022)

  • 2.0.4(Jun 29, 2022)

    • Added the ability for On Demand recognitions to run without the Magisk overlay module, so long as the device is rooted. You must start Shizuku as root or use Sui to make use of this method, and the overlay is still preferred if it works on your device. Please read the Wiki page for more information.
    • Further improvements to the On Demand overlay, fixing issues on OnePlus devices
    • Fixed the Lock Screen overlay not appearing when Smart Lock is enabled
    • Fixed Alternative Encoding and Lock Screen Overlay colour options not being backed up
    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-v2.0.4.apk(21.81 MB)
    OnDemandOverlay-v1.2.zip(6.05 KB)
  • 2.0.3(Jun 27, 2022)

    • Added armv7 support
    • Fixed crashes on Android 10
    • Fixed an issue where some tracks were not showing up in the track list or in the track count (US database is actually 69k tracks, not 53k)
    • Added an option to change the lockscreen overlay text colour
    • The lockscreen overlay text now has a slight shadow, improving visibility
    • Added caching for updates, which should prevent rate-limit issues. You can force an update check (ignoring cache) by swiping to refresh.
    • Enabled landscape orientation
    • Fixed background crashes in Now Playing, which may help download issues.
    • Improved Magisk On Demand module overlay installing, which may fix bootloops on some devices

    Note: Due to issues with the backend database update system, there have been two database updates in the last two days. This is now fixed, and future updates will be timely rather than all at once. Apologies for any inconvenience.

    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-v2.0.3.apk(21.78 MB)
    OnDemandOverlay-v1.1.zip(6.50 KB)
  • 2.0.2(Jun 20, 2022)

    • Added alternative encoding option, fixing distortion/crackling on some devices when enabled. Enable with Settings > Advanced > Use Alternative Encoding. IMPORTANT: You must also update Now Playing to 1.0.1 for the alternative encoding option to work. Use the Updates page in the app to update Now Playing.
    • Increased max gain to 3.0 to cope with new encoding which requires a higher gain on some devices
    • Reduced the chance of audio recording errors
    • Removed "Timeout" notification as it was more useless than it was useful
    • Fixed unclickable Chips on Recognition Success page (eg. Ask Google)
    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-v2.0.2.apk(21.57 MB)
  • 2.0.1(Jun 19, 2022)

    2.0.1 is a bugfix release, allowing "gain" values down to 0.1x, for devices where the default with no gain (1.0x) has distortion

    2.0 changes:

    Ambient Music Mod 2.0 is here, with a complete overhaul including dropping the need for an Xposed module, and even root.

    Read more: https://medium.com/@KieronQuinn/now-playing-ambient-music-mod-v2-93cd4042cc11

    Important: If you are upgrading from Ambient Music Mod 1.x, please uninstall the old version completely including the Xposed module and Pixel Ambient Services and reboot before installing this new version.

    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-v2.0.1.apk(21.57 MB)
  • 2.0(Jun 19, 2022)

    Ambient Music Mod 2.0 is here, with a complete overhaul including dropping the need for an Xposed module, and even root.

    Read more: https://medium.com/@KieronQuinn/now-playing-ambient-music-mod-v2-93cd4042cc11

    Important: If you are upgrading from Ambient Music Mod 1.x, please uninstall the old version completely including the Xposed module and Pixel Ambient Services and reboot before installing this new version.

    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-v2.0.apk(21.57 MB)
    OnDemandOverlay.zip(5.67 KB)
  • 1.1.1(Apr 19, 2021)

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

    1.1: 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.

    • 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.
    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-1.1.1.apk(65.72 MB)
  • 1.1(Apr 17, 2021)

    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.

    • 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.
    Source code(tar.gz)
    Source code(zip)
    AmbientMusicMod-1.1.apk(65.72 MB)
Owner
Kieron Quinn
Kieron Quinn
Odeon Music Player is a lightweight music player for Android.

Odeon ?? Odeon Music Player is a lightweight music player for Android. Get it on Google Play. We value your privacy, your battery life and your device

Thibault Seisel 63 Dec 20, 2022
Music Player - This is a basic music player built with Android Studio and Kotlin

Music Player Made by Jenny Cárdenas This is a basic music player built with Android Studio and Kotlin, it shows two views in the UI, the user can play

Jenny C 3 Oct 28, 2021
TunePlayer is a basic music player app aimed at showing how MusicServiceCompat and MusicBrowerCompat can be used to build a music playback service

TunePlayer TunePlayer is a basic music player app aimed at showing how MusicServiceCompat and MusicBrowerCompat can be used to build a music playback

Abdulmalik 6 Nov 18, 2022
This is a local music player, imitates the UI of Netease Music client.

Introduce This is a local music player, imitates the UI of Netease Music client. The UI was built on Jetbrains Compose. Screenshot Features Parse and

Konyaco 4 Dec 10, 2022
This is a local music player, imitates the UI of Netease Music client.

Introduce This is a local music player, imitates the UI of Netease Music client. The UI was built on Jetbrains Compose. Screenshots Features Parse and

Konyaco 4 Dec 10, 2022
SocyMusic is an open-source Android music player written in Java with the aim of creating an easy-to-use app for exchanging and listening to top-quality music. Help us create it!

SocyMusic SocyMusic is an open-source Android music player written entirely in Java. It's objectives are to provide top-quality music to everyone for

Benji 23 Dec 26, 2022
Blade is an open source music player for Android, allowing you to play music from multiple services : files on your phone, Spotify, and more.

Blade Player Blade is an open source music player for Android, allowing you to play music from multiple services : files on your phone, Spotify, and m

Valentin HAUDIQUET 72 Jan 5, 2023
A simple library for parsing and playing links from YouTube, YouTube Music, Vimeo and Rutube is WebView without the need to connect api data services. Request caching is available now

Android Oembed Video A simple library for parsing and playing links from YouTube, YouTube Music, Vimeo and Rutube and others in the WebView without th

Alexey Mostovoy 32 Oct 8, 2022
Android music player example.

Android music player example.

Chien 21 Jul 29, 2022
A elegant and light weight music player for android

A elegant and light weight music player for android

Atul Patare 45 Dec 21, 2022
Best material design music player for Android

Metro Material Design music player for Android music lovers Table of contents Downloads Differences between Metro and RetroMusicPlayer Screenshots App

Muntashir Al-Islam 684 Jan 1, 2023
Lightweight and Material designed Music Player

Music Player Lightweight and Material designed Music Player Based on Phonograph Features: Settings: Active tabs management Themes: Light, Dark, Black

Max 273 Dec 11, 2022
🎶🎼 Very slim music player 👨‍🎤 100% made in Italy 🍕🌳🌞🍝🌄

Source code for the Android music player Music Player GO

Enrico D'Ortenzio 1.2k Jan 2, 2023
Odyssey music player

Odyssey This whole project is licensed under the GPLv3 or later license (see LICENSE) Screenshots Please check out the Frequently Asked Questions This

Gateship-One 203 Jan 5, 2023
Shuttle is an open source, local music player for Android.

Shuttle Music Player Shuttle is an open source, local music player for Android. Shuttle comes in two flavours: Shuttle (free) Shuttle+ The free versio

Tim Malseed 2.2k Jan 4, 2023
A material designed music player for Android

Vinyl Music Player A material designed local music player for Android. Forked from Phonograph; makes all Pro features free, as they used to be. Additi

Adrien Poupa 581 Dec 30, 2022
A clean music player with a customizable widget, stylish interface and no ads.

Simple Music Player A clean music player with a customizable widget. A music player easily controllable from the status bar, home screen widget or by

Simple Mobile Tools 965 Jan 4, 2023
Music Player: From UI Proposal to Code

Some developers have difficult to code when the UI proposal is a bit “sophisticated” or “complex”. Many of them strip a lot of significant portion of the UI or even the Motion when they are coding, and the result ends up quite different of the original proposal.

André Mion 3.5k Dec 28, 2022
Auxio - A simple, rational music player for android.

Auxio is a local music player with a fast, reliable UI/UX without the many useless features present in other music players. Built off of Exoplayer, Auxio has a much better listening experience compared to other apps that use the native MediaPlayer API. In short, It plays music.

OxygenCobalt 800 Jan 2, 2023