[APP][SHIZUKU][01/03] Ambient Music Mod - Pixel Now Playing port

Search This thread

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
Ambient Music Mod Banner

Ambient Music Mod is a Shizuku or root app that ports Now Playing from Pixels to other Android devices.

Requirements​

  • Android device running Android 9.0 or above (11+ recommended).
  • Shizuku (Android 12+) or root access (Android 9+).
    • Shizuku does not require root, instead needing an ADB command to be run every reboot.

Features​

  • Full Now Playing support, based on the latest version from Pixel devices and the latest music databases
  • Automatic Ambient Music recognition, with settings to control how often recognition runs - finding the right balance between battery usage and convenience
  • Now Playing History and Favourites support
  • Support to trigger recognitions manually, including a homescreen widget
  • On Demand recognition on supported devices, using the Google Assistant-backed recognition engine for songs that are not in the local database (must be triggered manually)
  • Show Now Playing songs on the lock screen (accessibility service required)
  • View the full track list of recognisable songs, and change the database location if your taste does not match your device's locale

Screenshots​

Screenshots

Changelog​

2.1.2
- Fixed Restore option not showing any options of files to restore

2.1.1
- Improved adaptive lock screen overlay
- Fixed insets on 3 button devices
- Allow install on x86_64 devices without libhoudini or libndk

2.1
- Added x86_64 support
- Fixed Android 13 Shizuku issue
- Updated switch style
- Removed "run when battery saver enabled" as it was not functioning and cannot be fixed
- Fixed overlay continuing to appear when bedtime mode is enabled
- Added message about static noise to playback screen

2.0.5
- Fixed an issue where on device recognition would not work on some devices using Shizuku

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

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

2.0.2:
- Added alternative encoding option, fixing distortion/crackling on some devices when enabled
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)

Installation​

Download the latest APK from the GitHub Releases page and install it. Ambient Music Mod will download and install the latest Now Playing APK for you as part of the setup process.

If you have any questions, please read the FAQ before opening a GitHub issue or replying to the thread.
 
Last edited:

SkylinesHD

Senior Member
Sep 27, 2016
168
64
Google Pixel 7
Awesome module! Unfortunately, I couldn't get it working. (SM-A725F - Galaxy A72, Android 11)
When doing the test recognition, it says "Ambient Music failed to start". When I try multiple times, it does actually listen, but when it's done listening, it gives me "No response from Ambient Music".

I paid attention to all the steps and fixes, but none of them worked. Tried with LSPosed and Edxposed. Also tried without whitelist and checked, that ambient services has mic permissions.
 
Last edited:

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
Awesome module! Unfortunately, I couldn't get it working. (SM-A725F - Galaxy A72, Android 11)
When doing the test recognition, it says "Ambient Music failed to start". When I try multiple times, it does actually listen, but when it's done listening, it gives me "No response from Ambient Music".

I paid attention to all the steps and fixes, but none of them worked. Tried with LSPosed and Edxposed. Also tried without whitelist and checked, that ambient services has mic permissions.

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
 

SkylinesHD

Senior Member
Sep 27, 2016
168
64
Google Pixel 7
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
Tried that, didn't work. Couldn't see any addition on my lockscreen, when playing music. My phone starts lagging when turning off or on, as soon as I enabled the recognition on lockscreen.
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
This is the dump I got
Thanks, that's very useful:

Code:
sound_trigger_platform: platform_get_lsm_usecase: No lsm usecase found for exec_mode 0

is in the logs, suggesting it doesn't like the sound_trigger_platform.xml file, specifically the lsm_usecase bit. Unfortunately the current version of the app fails to zip that right when dumping, so could you do the following please:

- Send the current file in /system/vendor/etc/sound_trigger_platform_info.xml
- Disable the Magisk module in the Magisk app, and reboot
- Send the new file in /system/vendor/etc/sound_trigger_platform_info.xml (this should be different to the first, and be original to your device)

I'll then try to figure out if something else may be required to be added on some devices, or if there's a limitation of the 'magic numbers' in the file I took from the Pixels (in which case it will likely sadly never work).

I'll also fix the dump thing so it zips the xml correctly for the next build.

Cheers!
 

SkylinesHD

Senior Member
Sep 27, 2016
168
64
Google Pixel 7
Thanks, that's very useful:

Code:
sound_trigger_platform: platform_get_lsm_usecase: No lsm usecase found for exec_mode 0

is in the logs, suggesting it doesn't like the sound_trigger_platform.xml file, specifically the lsm_usecase bit. Unfortunately the current version of the app fails to zip that right when dumping, so could you do the following please:

- Send the current file in /system/vendor/etc/sound_trigger_platform_info.xml
- Disable the Magisk module in the Magisk app, and reboot
- Send the new file in /system/vendor/etc/sound_trigger_platform_info.xml (this should be different to the first, and be original to your device)

I'll then try to figure out if something else may be required to be added on some devices, or if there's a limitation of the 'magic numbers' in the file I took from the Pixels (in which case it will likely sadly never work).

I'll also fix the dump thing so it zips the xml correctly for the next build.

Cheers!
Got the files, I hope the issue will be fixable. Good luck!
 

Attachments

  • sound trigger files.zip
    6.3 KB · Views: 192

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
Got the files, I hope the issue will be fixable. Good luck!
Re-enable the module, extract and drop the attached file in /data/adb/modules/AmbientMusicTest/system/vendor/etc/ and reboot, see if that helps

Side note, I really need to change that AmbientMusicTest name
 

Attachments

  • sound_trigger_platform_info.zip
    3.3 KB · Views: 194

SkylinesHD

Senior Member
Sep 27, 2016
168
64
Google Pixel 7
Re-enable the module, extract and drop the attached file in /data/adb/modules/AmbientMusicTest/system/vendor/etc/ and reboot, see if that helps

Side note, I really need to change that AmbientMusicTest name
Great, this really works! But now I noticed another problem..
The database is loading for ever when I go on Track list, it also cannot recognize any song.
 
Last edited:

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
Great, this really works! But now I noticed another problem..
The database is loading for ever when I go on Track list, it also cannot recognize any song.

It's unlikely to be loading forever, it just takes a long time to load. Leave it for a few minutes and it should load.

Meanwhile, if the module is working now you'll probably want to play with the amplification a bit, test the output with the test playback and fingers crossed it'll start recognising things then.
 

SkylinesHD

Senior Member
Sep 27, 2016
168
64
Google Pixel 7
It's unlikely to be loading forever, it just takes a long time to load. Leave it for a few minutes and it should load.

Meanwhile, if the module is working now you'll probably want to play with the amplification a bit, test the output with the test playback and fingers crossed it'll start recognising things then.
The output is perfect, I left it loading for about ~2-3 mins., I'll try again. Hopefully it'll work.
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
The output is perfect, I left it loading for about ~2-3 mins., I'll try again. Hopefully it'll work.
If it still doesn't load after like 5 minutes (there's also a progress bar that should show progress) after restarting the app, what region are you in? I've previously tested the database parsing with en_GB and en_US and it was working fine but maybe it's broken for another one
 

SkylinesHD

Senior Member
Sep 27, 2016
168
64
Google Pixel 7
If it still doesn't load after like 5 minutes (there's also a progress bar that should show progress) after restarting the app, what region are you in? I've previously tested the database parsing with en_GB and en_US and it was working fine but maybe it's broken for another one
I'm located in germany (probably something like de_DE)
There is a progress bar, but it doesn't show me a progess. It's just like.. loading
 

McFlypants

Senior Member
Mar 22, 2013
386
150
Xiaomi 12
On miui 12.5 I think my Problem is that I can't grant the App access to the microphone.
 

Attachments

  • IMG_20210414_233430.jpg
    IMG_20210414_233430.jpg
    202.5 KB · Views: 756
  • IMG_20210414_233447.jpg
    IMG_20210414_233447.jpg
    193.1 KB · Views: 755
  • IMG_20210414_233455.jpg
    IMG_20210414_233455.jpg
    203.9 KB · Views: 757

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
9,107
8,560
25
Salford, Greater Manchester, UK
quinny898.co.uk
On miui 12.5 I think my Problem is that I can't grant the App access to the microphone.

Tap the microphone prompt in Ambient Music, you have to grant it manually via the app info (not sure why Google didn't just implement a prompt like everyone else does). I have also found that sometimes when you've just granted it access it doesn't immediately respond to test recognition, if you find it still sits loading after that then kill Ambient Music via the recents, reopen it via Ambient Music Mod, return to Ambient Music Mod and try running the recognition again.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    It would be really helpful if you would just remove it, or provide some information there stating how much average time it takes to update.
    The problem with removing it is people would then complain that it's not picking up all the tracks it should be, because they don't know the database hasn't fully loaded yet. There is no average time.

    As I've said, this is exactly the same on Pixels. When you set up a Pixel, it shows a message saying the database is downloading, but you don't get people complaining about that.
    2
    The music database is not downloading/updating. Re-Installed the app 4 times. Rebooted the device 10 times. Still, the music database is stuck and doesn't show any progress bar.

    Plus how much time does it take on average to download the music db. I initiated this re-install and rebooting steps after a day and a half of it being stuck on updating the music db.

    How do I make the music database download. The region I selected was India.

    The image shows the bar. But it isn't showing any progress as to how much mb is downloaded out of the 400mb music db. It's just going on endlessly without showing anything.
    Let it sit, it will download eventually. As has been stated many, many, many times now. It's even been answered on this page already.
    1
    Just noticed a bit of a regression. In 2.1.1 trying to restore a settings backup only shows the Recent page in the files picker and is stuck there with no hamburger menu to get to anything else. Downgrading to 2.0.5 shows the expected full file picker dialog again.
    So it does, good spot.
    1
    New version, 2.1.2
    Fixed Restore option not showing any options of files to restore
    Download from GitHub releases as usual

    Thanks @osm0sis for finding this one
    1
    Although the database has finished downloading. On the home screen it is showing that database is downloading. Is this a glitch or normal behaviour(as in it is downloading every other song from the server after downloading these main 16k tracks)? Plus, does now playing also recognises the regional songs, example Hindi/Punjabi songs in India.
    It's not downloaded, 16k songs is the base database included in the APK. If it doesn't download in the next day or so, clear the data of Now Playing and let it download again.
  • 24
    Ambient Music Mod Banner

    Ambient Music Mod is a Shizuku or root app that ports Now Playing from Pixels to other Android devices.

    Requirements​

    • Android device running Android 9.0 or above (11+ recommended).
    • Shizuku (Android 12+) or root access (Android 9+).
      • Shizuku does not require root, instead needing an ADB command to be run every reboot.

    Features​

    • Full Now Playing support, based on the latest version from Pixel devices and the latest music databases
    • Automatic Ambient Music recognition, with settings to control how often recognition runs - finding the right balance between battery usage and convenience
    • Now Playing History and Favourites support
    • Support to trigger recognitions manually, including a homescreen widget
    • On Demand recognition on supported devices, using the Google Assistant-backed recognition engine for songs that are not in the local database (must be triggered manually)
    • Show Now Playing songs on the lock screen (accessibility service required)
    • View the full track list of recognisable songs, and change the database location if your taste does not match your device's locale

    Screenshots​

    Screenshots

    Changelog​

    2.1.2
    - Fixed Restore option not showing any options of files to restore

    2.1.1
    - Improved adaptive lock screen overlay
    - Fixed insets on 3 button devices
    - Allow install on x86_64 devices without libhoudini or libndk

    2.1
    - Added x86_64 support
    - Fixed Android 13 Shizuku issue
    - Updated switch style
    - Removed "run when battery saver enabled" as it was not functioning and cannot be fixed
    - Fixed overlay continuing to appear when bedtime mode is enabled
    - Added message about static noise to playback screen

    2.0.5
    - Fixed an issue where on device recognition would not work on some devices using Shizuku

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

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

    2.0.2:
    - Added alternative encoding option, fixing distortion/crackling on some devices when enabled
    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)

    Installation​

    Download the latest APK from the GitHub Releases page and install it. Ambient Music Mod will download and install the latest Now Playing APK for you as part of the setup process.

    If you have any questions, please read the FAQ before opening a GitHub issue or replying to the thread.
    5
    Isn't android 12 OOS update been out for some time now? Which device the dev is using?
    7T Pro. It's in closed beta.

    I gave up waiting because it's ridiculous how long it's taken and am working on 12 support using an AOSP ROM.
    5
    Ambient Music Mod v2.0.4 & Now Playing v1.0.3 released:

    • 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
    Download from GitHub releases as usual
    4
    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

    Download the latest release from GitHub releases

    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.

    -

    I've also asked this thread to be moved since it's no longer a Magisk module
    Moved, thanks Badger50!
    3
    Is it possible, to have multiple databases installed?
    Like Germany + US ?
    Not currently, although it might be in the future.