What is split sound service Android?

What is split sound service in Android?

Split sound service is a feature introduced in Android 10 that allows apps to play their audio on separate audio devices simultaneously. It enables users to play audio from one app, like a music player, through headphones while routing notification sounds or voice calls through the phone’s speaker.

The split sound service works by creating two separate audio “streams” that apps can output audio to. The “media” stream is typically for music, videos, games etc. while the “call” stream is for notifications, ringtones, phone calls. The user can then select which audio devices each stream plays through, allowing them to consume media privately while remaining alerted of calls and notifications.

Prior to split sound service, the audio system in Android was more limited. Apps could only output audio to one device at a time, which made it difficult to listen to music in headphones but still hear notifications come through the phone speaker. The introduction of split sound gave users more granular control and personalization of how audio works on their device.[1]

Why was split sound service introduced?

Split sound service was introduced in Android to allow multiple audio streams to play simultaneously. This feature allows certain apps to output audio to a separate output device like Bluetooth headphones or speakers, while other apps continue using the phone’s main speaker or default output.

For example, previously if you were playing music on your phone and then decided to watch a video, the video audio would cut out the music audio. With split sound service, the music can keep playing through Bluetooth headphones while the video plays through the phone’s main speaker. This improves the overall audio experience by avoiding interruptions.

According to this XDA article, split sound service was first introduced in Android 10. It allows “two or more apps to output sound to two or more audio devices simultaneously.” The feature helps enable a more seamless and customizable audio experience on Android devices.

How does split sound service work?

Split sound service works by using separate audio HALs (Hardware Abstraction Layers). This allows the Android system to have independent volume and audio effects controls per audio stream.

Specifically, when split sound service is enabled, the main Android system audio HAL handles the default audio routing and mixing. This includes sounds from notifications, ringtones, alarms, and so on. Meanwhile, a separate audio HAL is created dynamically for the selected app’s audio stream. This secondary HAL interfaces directly with the Bluetooth headset or other external audio device.

As a result, the selected app’s audio can be controlled and modified independently without affecting the main system audio. For example, the app audio could be set to a different volume level or have a custom equalizer applied. The main Android audio mixer is unaware of these changes since the streams are handled separately.

This separation of audio streams allows more fine-grained control and customization for per-app audio. Apps can output high-quality audio through headphones while notifications and alerts continue to play through the phone’s speakers without interruption.

Overall, the split audio architecture gives apps flexibility in audio routing while maintaining full control of system sounds (Samsung).

What are the benefits of split sound service?

One of the key benefits of split sound service is the ability to play music or audio from one app while on a call through your phone’s speaker. Without split sound, the music would be interrupted when a call comes in. With this feature, you can designate the music app to keep playing over Bluetooth speakers or headphones, while the call audio plays through the phone.

Another major advantage is being able to control the volume of each audio stream separately. For example, you could have a video playing in the background at a low volume through the phone speaker, while music is streaming loudly over Bluetooth headphones. You can adjust the volumes individually without affecting each other.

According to this Reddit thread, split sound is also useful for playing games while listening to music or podcasts. The game audio can go through the phone, while the other audio continues uninterrupted.

Overall, the ability to separate app audio provides more flexibility and control over sound on your device. Key use cases are minimizing interruptions between apps and customizing volume levels for each app as needed.

What are some use cases for split sound service?

One of the most common use cases for split sound service is playing music during navigation. For example, you can play music through your car’s Bluetooth stereo while Google Maps voice navigation comes through the phone’s speaker. This allows you to follow turn-by-turn directions without interrupting your music.

Gaming while on a call is another popular use case. You can have your game audio play through headphones while the phone call comes through the speaker. This makes it easy to play mobile games and chat with friends at the same time.

Other examples include:

  • Listening to a podcast through headphones while receiving notification sounds through the phone speaker.
  • Playing a video with audio through an external speaker while game sound effects come through the phone.
  • Streaming music to a Bluetooth speaker while watching social media videos on the phone speaker.

Overall, split sound allows you to consume media from different apps through different audio sources simultaneously. This creates a more seamless experience without having to manually change output devices.

What are the requirements for split sound service?

For an Android device to support split sound service, there are some specific hardware and software requirements:

First, the device needs to be running Android 10 or higher. Split sound service was introduced in Android 10, so devices running older versions of Android do not support it.

Additionally, there needs to be support in the audio driver and HAL (Hardware Abstraction Layer). The audio stack needs to be able to route audio from different apps to separate outputs. Not all audio chipsets or drivers have full support yet.

Specifically, the audio HAL needs to implement the IAudioPolicyService interface from the Android frameworks. This allows apps to specify audio attributes like usage, content type, flags, etc. The audio policy manager can then use this information to intelligently route each audio stream.

Without support in the driver and HAL, the platform-level split sound service feature cannot work properly. So this driver-level support is a key requirement.

In summary, split sound service requires:
– Android 10 or higher

– Audio driver/HAL support for intelligent policy-based routing
With both of those present, the split audio streams functionality can work on a device.

How to enable split sound service

The split sound service can be enabled programmatically in Android via the AudioManager API. Here are the key steps:

1. Request audio focus separately for each audio stream using AudioManager.requestAudioFocus(). For example, request focus for the music stream to play music through headphones and request focus for the notification stream to play alerts through the phone speaker.

2. When requesting focus, specify the audio attributes for the stream such as stream type, usage, and content type. This allows the system to determine the best audio routing.

3. Handle the AudioFocusRequest callbacks to start/stop each stream accordingly when focus is gained or lost.

4. Use the output flags in AudioFocusRequest to indicate if the stream should be routed to the speaker, headphones, or a specific output.

5. To stop split audio routing, abandon focus for each stream via AudioManager.abandonAudioFocus().

This allows precise control over routing each stream independently. Tuning the audio attributes and focus requests is important to achieve optimal quality for both streams.

Limitations of split sound service

While split sound service offers useful functionality, it also comes with some limitations. Two key limitations are increased battery/CPU usage and added audio complexity.

Splitting audio streams between different outputs takes additional processing power from the device’s CPU and audio systems. This can result in higher battery drain compared to routing all audio through a single output.[1] The extra battery impact may be noticeable, especially on devices with less powerful processors.

Managing separate audio streams also adds complexity that can lead to sync issues or degraded audio quality in some cases. If the device struggles to process and sync the separate streams smoothly, it can cause distortions, lag, or echoing.[2]

Developers have to optimize their apps carefully to work well with split audio output. Not all apps are designed for it, so compatibility can be hit or miss depending on the app.

While split sound has advantages, users should weigh the potential downsides of increased battery drain and audio complexity. It works best for occasional targeted usage, not continuous all-day playback.

[1] https://www.samsung.com/latin_en/support/mobile-devices/useful-audio-settings-on-the-galaxy-phone-including-separate-app-sound/
[2] https://android.stackexchange.com/questions/252462/how-do-i-have-different-sound-output-for-different-apps

Apps that use split sound service

Some popular apps that utilize split sound service in Android include:

These streaming entertainment apps benefit by allowing users to consume media privately while still being aware of notifications. Split sound enables seamless multitasking without missing important alerts.

The future of split sound service

Split sound service on Android is expected to improve in the future with additional features and capabilities. Google may expand support to more devices as it continues developing the Android platform.

One expected improvement is more granular audio routing options. Currently split sound service allows per-app audio output selection, but future versions may allow selecting specific audio streams within an app. For example, routing music to a Bluetooth speaker while game sound effects play through the phone speaker.

Split sound service could also be integrated into Android Auto, allowing separate app audio when connected to a car’s infotainment system. This would enable listening to a podcast through the car while navigating with Google Maps audio on your phone.

New use cases may emerge as well. Split sound service could integrate with hearing aid apps to optimize audio for accessibility. It may also facilitate new multi-player local gaming experiences by routing each player’s audio separately.

Overall, split sound service will likely continue evolving along with Android, unlocking new capabilities and use cases. But the core goal remains streaming separate app audio feeds to different outputs for a customized and optimized listening experience.

Leave a Reply

Your email address will not be published. Required fields are marked *