Jump to content

Allow recording on Android 10+


airmusic
 Share

Recommended Posts

Hey Max,

 
I am the developer of "AirMusic" (aka AirAudio, https://play.google.com/store/apps/details?id=app.airmusic.trial).
This app allows Android-users to stream any app's audio to almost all audio-protocols.
 
Since Android 10+, AirMusic can record the submix of other apps without having to "root" the device.
 
Sadly it seems like Poweramp explicitly disallows that their app gets recorded by 3rd-party-apps or something else is causing this issue.
Can you please have a look at this page?

https://developer.android.com/guide/topics/media/playback-capture#allowing_playback_capture
 
Maybe you can give me some feedback about the reasons or with some luck this is something you could change in near future?
Several users have contacted me because they cannot stream your music and I am a paid user of Poweramp since 2012 too.
 
Would be great if we can get this working so users can stream their beloved Poweramp-player to their remote speaker :)
 
Best regards from Germany,
Martin
Link to comment
Share on other sites

@airmusic thanks for the request. Poweramp actually doesn't forbid recording (and docs state that this should allow recording). Still I can see from dumpsys media.audio_policy that it's not allowed for some reason - I will investigate why (most probably docs are wrong). Actually capture is allowed, and it's allowed for many builds already (it was implemented as soon as capture was implemented back in Q beta days). From my investigation there is a bug/oversight in the framework for the apps with android:sharedUserId.

Link to comment
Share on other sites

Hey @maxmp,

many thanks for the investigations.

Maybe setting the recording-permissions directly on the player-instances might do the trick? 

https://developer.android.com/guide/topics/media/playback-capture#capture_policy

 

Would be great if we could figure this out. There are as mentioned several users that asked me already about this :)

Link to comment
Share on other sites

@airmusic unfortunately, nothing helps as there is an issue with the audio policy permission code not being aware of shared user id Android feature (exists from Android 1.0). And we can't drop that share id feature as Android doesn't support upgrading from/to shared user id.

Link to comment
Share on other sites

You are right, hmm that's really bad. I was able to reproduce/confirm this issue with a simple mediaplayer-app where I added/removed the sharedUserId.

I am aware of the restrictions with the id and that you cannot remove it.

Maybe we can find a workaround, otherwise we might open an issue at Android's bug reporting :)

Link to comment
Share on other sites

  • 5 months later...

Hey there, sadly not, no. I was able to reproduce this issue with a simple test-application and yes it's a bug inside Android's security-mechanism.

I had no idea yet how to get around this beside of implementing major changes inside AirMusic & PA.

 

Link to comment
Share on other sites

8 hours ago, airmusic said:

Hey there, sadly not, no. I was able to reproduce this issue with a simple test-application and yes it's a bug inside Android's security-mechanism.

I had no idea yet how to get around this beside of implementing major changes inside AirMusic & PA.

 

Ah, that's a shame. Maybe one could try to get the Android devs attention towards this, e.g. tagging them in a tweet with a link to this thread? 
Anyways, is there another played that you could recommend that works with AirMusic for streaming local files to the receivers? Or does it only work with online services?

Link to comment
Share on other sites

It seems that Android 12 beta fully fixes that. Also, some Android 11 variants get the patched code as well (or OEM patched that code specifically) - e.g. MIUI 12.5+, OneUI 3.1, etc. (works only for the built-in screen recorder).

Link to comment
Share on other sites

  • 2 weeks later...
On 8/12/2021 at 8:53 PM, airmusic said:

Nice! Also good news if this is fixed in Android 12 as @maxmpmentions. Would have been great if Google could have fixed it for Android 10 and 11 as well. Although I'm planning to get a new phone I'm not sure if it will that soon, haha.

@airmusicas for the issue, seems like the Google team asks for some details about this, ref the last comment on the link.

Link to comment
Share on other sites

Yes this would be good news.

But I bet this won't happen for the previous versions.

I have sadly no time to provide them more information (children, jobs, development, constructions...☹️), but as it seems to be fixed with Android 12 I think they won't even do anything to provide this fix earlier.

 

If you like to, you might 'root' your phone and use AirMusic in root-mode to get around this issue earlier 😀

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...