legendsayantan / ShizuTools

Contains many tools to control android system via shizuku.
GNU General Public License v3.0
711 stars 20 forks source link

MixedAudio issue #4

Closed dmytrobaiev closed 4 months ago

dmytrobaiev commented 5 months ago

After updating ShizuTools, the "MixedAudio" tab worked, but whatever app I'm adding to the "Enabled Apps" category it crashes whenever I try to play video/music.

Phone specs: Xiaomi device Android 14 HyperOS 1.0.3.0

I'm not sure if this issue is only for HyperOS or if this error can be reproduced on any device. I've attached logs from Twitch and Spotify if needed. The combination of YouTube (Premium) + TikTok works fine, but on my device I can play audio in these apps at the same time without MixedAudio. twitch.log spotify.log

legendsayantan commented 5 months ago

As mentioned in README, some apps are built in a way to crash, if they cannot take audio focus before playing media. I do not think there is any workaround to this, other than patching the installed apps one by one so they don't crash, and that has its own caveats as well. If I ever come across a better solution, I'll make sure to include it in the app.

Until then, there will be some apps that don't support enabling this feature. The two apps you want to play together, you could try enabling mixedaudio for any one of them though, as either app supporting it should be enough...

Mujtaba0150 commented 5 months ago

As mentioned in README, some apps are built in a way to crash, if they cannot take audio focus before playing media. I do not think there is any workaround to this, other than patching the installed apps one by one so they don't crash, and that has its own caveats as well. If I ever come across a better solution, I'll make sure to include it in the app.

Until then, there will be some apps that don't support enabling this feature. The two apps you want to play together, you could try enabling mixedaudio for any one of them though, as either app supporting it should be enough...

You could try looking into Samsung's "Individual app volumes" in the sound assistant module of the Goodlock app... It seems to work seamlessly for every app, though I'm not sure if it uses Samsung specific settings and features but I guess it's worth a look

hikosaa commented 5 months ago

I also have this issue with my oneplus phone, after enabling the feature for instagram and phone calls i tried opening instagram but as soon as any sound starts playing it crashes, I was able to fix that by uninstalling the app and reinstalling it , but I cant uninstall my phone dialer app and it crashes the phone to restart when i receive a phone call or try to make a call, i think you should add an option to revert back apps or to disable this feature because I didn't find any way to do it . and sorry for bad english

hikosaa commented 5 months ago

i was able to fix it by holding on the app and then once i got the dialog box i clicked yes and it was removed, I'am really sure that i tried this before but maybe shuzuku was not running that time, but now everything is running fine with my device

legendsayantan commented 5 months ago

In case someone is not able to disable mixedaudio for an app, here's an alternate method using regular adb command -

appops set <package_name> TAKE_AUDIO_FOCUS allow

Replace <package_name> with actual package name of the app you want to apply the change on.

e-t-l commented 5 months ago

I had this issue too on GrapheneOS. Enabling MixedAudio for the Google Phone app crashes the entire OS. You might want to put a big in-app warning on this tab saying that it may cause app or system crashes.

shosho-source commented 5 months ago

After updating ShizuTools, the "MixedAudio" tab worked, but whatever app I'm adding to the "Enabled Apps" category it crashes whenever I try to play video/music.

Phone specs: Xiaomi device Android 14 HyperOS 1.0.3.0

I'm not sure if this issue is only for HyperOS or if this error can be reproduced on any device. I've attached logs from Twitch and Spotify if needed. The combination of YouTube (Premium) + TikTok works fine, but on my device I can play audio in these apps at the same time without MixedAudio. twitch.log spotify.log

Bro Xiaomi has built in multiple Audio source

legendsayantan commented 5 months ago

Good news...! Starting from ShizuTools v1.2.0, MixedAudio now works on some more apps, without crashing them. You are encouraged to update, and as always, provide feedback about the changes.

e-t-l commented 5 months ago

Good news...! Starting from ShizuTools v1.2.0, MixedAudio now works on some more apps

Great to hear! By the way, why do you upload the APK in the code section of the repo instead of at https://github.com/legendsayantan/ShizuTools/releases? You can create a Github Workflow to generate and publish the APKs automatically; you should check it out if you haven't used Workflows before!

legendsayantan commented 5 months ago

I have done things like that before, I even currently have workflows running for other projects, I don't have the time to invest atm so I'm just pushing the apk as well with code commit.

legendsayantan commented 4 months ago

Closing due to inactivity.