lundi 19 avril 2021

Google Pixel’s Now Playing feature has been ported to other Android devices

Google debuted the Now Playing feature with the Pixel 2 series back in 2018, and it has remained an integral part of the Pixel lineup ever since. The feature employs a combination of onboard hardware, software, and Google’s machine learning magic to identify songs playing in the background. Now Playing was intended to be a Pixel-exclusive feature, but it was only a matter of time before custom ROM developers managed to make it work on top of an AOSP codebase and come up with their own take on the feature.

Now, XDA Recognized Developer/Recognized Contributor Quinny899 has taken things a step further. He’s come up with a hybrid Xposed and Magisk mod called “Ambient Music Mod” that fully ports Google’s original Now Playing feature to other Android smartphones. It’s free and open-source and has been confirmed to work on some OnePlus devices like the OnePlus 7T Pro.

Just like on Google Pixel phones, the Ambient Music Mod lets your phone automatically recognize music playing in your surroundings and display the name of the currently playing song and artist on the lockscreen. The feature also keeps a historical list of every identified song so that you can go back to view them whenever you want. While some of the earlier re-implementations of Now Playing relied on an active Internet connection to do their job, Ambient Music Mod processes everything locally, on-device, and thus doesn’t require Internet or much battery use. After all, it’s a full port of the feature from Google Pixel phones, so it works basically identically to how it does on those devices.

Ambient Music Mod installation and setup

Ambient Music Mod 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 recognizable track in your locally downloaded database via the Track List option

As previously mentioned, Ambient Music Mod is a hybrid Xposed and Magisk mod, which means you’ll need both frameworks installed on your phone. Magisk is necessary for gaining root access on your device, while the Xposed framework allows the mod to hook into the Sound Trigger driver of Qualcomm Snapdragon devices.

Your phone also must have a Snapdragon processor with support for Sound Trigger 2.1 platform or above. The mod relies on the Sound Trigger service (the same service used by voice assistants for voice activation) to listen to music playing in your surroundings and captures an 8-second audio recording. The app then runs a K-Nearest Neighbor (KNN) machine-learning model on this small audio clip to find the exact matches in a locally stored track database.

How to download Ambient Music Mod on your device:

  1. Make sure your device has an unlocked bootloader with Magisk and the Xposed* frameworks installed. (Check out our guides for installing Magisk and Xposed)
  2. Download the latest APK of Ambient Music Mod from the developer’s GitHub page.
  3. The app will run some tests to check whether or not your device is compatible.
  4. If your device meets the requirements, click on the “Build Installer” button at the bottom.
  5. Once built, open the Magisk Manager app and install the module.
  6. Open the Xposed app, search for the Ambient Music Mod module, and enable it.
  7. Reboot your device. You should see track info on your lock screen the next time there’s music playing in the background.
OnePlus 7T displaying currently playing track on the lock screen using Ambient Music mod

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

The developer has done a lot of testing on this mod and has come up with a list of frequently asked questions (FAQs) that you should check out here if you have any questions or you’re having any issues. The FAQ answers questions such as how to test if Now Playing is working, how many songs does it recognize, what to do when you see a “Pixel Ambient Services” update on Google Play (spoiler: don’t update), what amplification level to use, and more.

While the developer can confirm the feature works on a rooted OnePlus 7T Pro running OxygenOS 11, a tester reports that it failed to run on the ASUS ROG Phone 3 running ZenUI. Thus, your mileage may vary. To give feedback to the developers, check out the XDA forum thread for Ambient Music Mod at the link below.

Ambient Music Mod — Pixel Ambient Music Port XDA Thread

*It’s important to note that the original developer of the Xposed Framework hasn’t supported the project since its Android 8.1 Oreo-compatible release. When the developer (and other people on our forums) mention Xposed, they’re referring to the unofficial successors to the Xposed Framework that are compatible with Android versions from 9 through 12. These successors include “EdXposed” and more recently “LSPosed”, both of which provide an ART hooking framework. These frameworks also require that “Riru” be installed, which modifies Android’s zygote process to allow modules to run their own code. You don’t need to know how these work, but you do need at least one combination of Magisk + Riru + EdXposed or Magisk + Riru + LSPosed installed in order to get Ambient Music Mod up and running.

The post Google Pixel’s Now Playing feature has been ported to other Android devices appeared first on xda-developers.



from xda-developers https://ift.tt/32pSg13
via IFTTT

Aucun commentaire:

Enregistrer un commentaire