Android 12 (Viper4Android)

Search This thread

mmarcz

Senior Member
Nov 22, 2006
143
48
I am NOT using A12, but one thing I have used in the past to stop Ansroid from killing apps in the background is by sett9ing the OOM to superman. And the Nice to high, just for good measure. It would be possibly telling to know exactly which process is dying.
Sooo... I reinstalled viper and the selinux switch. I then turned off battery optimization for both apps. Here's where it gets weird.. I have apple music playing, viper is running, tapping the status button shows that it is processing, but as Im making live changes, you cant hear any kind of change whatsoever. If I enable legacy mode, it stops processing, disable, goes back to shows processing, but its not actually working.

Im not a developer, so I can only tell you what I did at the apps level, hopefully that helps the devs out there. I flipped the switch for compatibility mode and restart the phone. Started apple music, status button is greyed out, and its not processing, cannot hear any live sound changes. So I uncheck compatibility mode, and reboot again. Start apple music, open viper, compatibility and legacy are both OFF, and this time, its NOT processing as shown when pressing the status button. I then enable legacy mode, and now it shows processing, and making the settings changes actually works.

I have my pixel A buds in for the past 10min now, and viper has not stopped processing. My only issue is that it seems like the settings dont make as big of a difference as Im used to them making a difference, if that makes sense. At lunch, Ill test in the car with the LDAC BT adapter and see how it sounds.

Hopefully that helps everyone! Really appreciate all the input.

mmarcz

UPDATE: Would not work with the LDAC adapter, but worked fine with stock dash BT, arrgg...
 
Last edited:
I'll post it later when I'm done with work but there's a fix for Android 12 and Viper! I found it by digging around in the official Telegram group last night. It seems to be working fine so far! I'm happy!

It's an updated version of the APK for v4a 2721.

I will say if anyone looks in the Telegram group, look for the "post-fs-data.sh" fix I believe. There's a user who posted a tutorial that's easy to follow on where to put this file.
 
Last edited:
  • Like
Reactions: mmarcz

TheExoduser

Senior Member
Jan 4, 2017
78
22
Stuttgart
Hey guys,

I got it working without using any unofficial apks. You have to edit the file /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh (can only be edited using a root explorer like Solid Explorer).
You have to add the following lines to the bottom of the file
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }' magiskpolicy --live 'allow audioserver system_file file { execmod }' magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }' magiskpolicy --live 'allow mediaserver system_file file { execmod }' magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }' magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }' magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }' magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }' magiskpolicy --live 'allow app app_data_file file { execute_no_trans }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'

Reboot once after saving the file, then open V4A, go to settings and switch on legacy mode.

No idea why it only works using this way, but I don't want to install any unofficial apks so that was my way of choice. Let me know if it works for you too :)
 

DiamondJohn

Recognized Contributor
Aug 31, 2013
6,203
6,110
Sydney
Hey guys,

I got it working without using any unofficial apks. You have to edit the file /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh (can only be edited using a root explorer like Solid Explorer).
You have to add the following lines to the bottom of the file
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }' magiskpolicy --live 'allow audioserver system_file file { execmod }' magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }' magiskpolicy --live 'allow mediaserver system_file file { execmod }' magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }' magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }' magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }' magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }' magiskpolicy --live 'allow app app_data_file file { execute_no_trans }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'

Reboot once after saving the file, then open V4A, go to settings and switch on legacy mode.

No idea why it only works using this way, but I don't want to install any unofficial apks so that was my way of choice. Let me know if it works for you too :)
all your changes are specifically only modifying the SE Policy/Allows. Which would mean that running permissive would of also worked, and hence made it clear that only the change above is required.

Did it work for you under SE Permissive and not under enforcing?
 

TheExoduser

Senior Member
Jan 4, 2017
78
22
Stuttgart
all your changes are specifically only modifying the SE Policy/Allows. Which would mean that running permissive would of also worked, and hence made it clear that only the change above is required.

Did it work for you under SE Permissive and not under enforcing?
I want it to run under enforcing, so I did not try to run it under SE permissive. It propably will work under permissive just like it works with the posted SE policies.
 

DiamondJohn

Recognized Contributor
Aug 31, 2013
6,203
6,110
Sydney
I want it to run under enforcing, so I did not try to run it under SE permissive. It propably will work under permissive just like it works with the posted SE policies.
Totally understand. I was only suggesting TESTING under permissive to see if adjustments to policies would of fixed it. I haven't followed it too closely as I am staying with A11 for now, I am just a little surprised how many hoops people have jumped through to try and get Viper working, and no one had noted that simply switching to permissive would work, especially since there are a few that are already running permissive already in A11.
 

mmarcz

Senior Member
Nov 22, 2006
143
48
Totally understand. I was only suggesting TESTING under permissive to see if adjustments to policies would of fixed it. I haven't followed it too closely as I am staying with A11 for now, I am just a little surprised how many hoops people have jumped through to try and get Viper working, and no one had noted that simply switching to permissive would work, especially since there are a few that are already running permissive already in A11.
I did this running A12, I did have viper running. I rebooted, and it worked fine with an APT-X bluetooth streamer I had sitting my office. I am currently running permissive with the utility to set permissive at startup. I havent tried changing it yet.

Update: Uninstalled seliux app after entering the permissions, and viper works fine!
 
Last edited:

Typhus_

Senior Member
Just bumped into this thread today.

I've created a simple magisk module that all it does is to update the post-fs-data.sh script, included on official installer by @Team_DeWitt.

This "fix module" just replaces the official script, nothing else. It even deletes himself after replacing the script.

That is done after 20 seconds upon the reboot we have to do after installing the fix.

As soon as the script is changed and the fix gets deleted by itself, you may enable Legacy mode, on Viper4Android app, and reboot the device to get this working on Android 12.

Sometimes a second reboot is needed (faced that during my tests).

Hope it helps.


Cheers!
 

Attachments

  • ViperFX_Android12_Fix.zip
    2.5 KB · Views: 1,449
Last edited:

AndrzejDwo

Senior Member
May 26, 2018
1,071
755
Samsung Galaxy Note 3
Samsung Galaxy S5
Hey guys,

I got it working without using any unofficial apks. You have to edit the file /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh (can only be edited using a root explorer like Solid Explorer).
You have to add the following lines to the bottom of the file
magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }' magiskpolicy --live 'allow audioserver system_file file { execmod }' magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }' magiskpolicy --live 'allow mediaserver system_file file { execmod }' magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }' magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }' magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }' magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }' magiskpolicy --live 'allow app app_data_file file { execute_no_trans }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'

Reboot once after saving the file, then open V4A, go to settings and switch on legacy mode.

No idea why it only works using this way, but I don't want to install any unofficial apks so that was my way of choice. Let me know if it works for you too :)

Works fine here on A12 OneUi4.0 Samsung S21 Ultra. Thanks for sharing!

Cheers
 

Avik Sarkar

Member
Aug 3, 2014
39
19
Haringhata
POCO M2 Pro
Just bumped into this thread today.

I've created a simple magisk module that all it does is to update the post-fs-data.sh script, included on official installer by @Team_DeWitt.

This "fix module" just replaces the official script, nothing else. It even deletes himself after replacing the script.

That is done after 20 seconds upon the reboot we have to do after installing the fix.

As soon as the script is changed and the fix gets deleted by itself, you may enable Legacy mode, on Viper4Android app, and reboot the device to get this working on Android 12.

Sometimes a second reboot is needed (faced that during my tests).

Hope it helps.


Cheers!
Thanks. Now it's working on OctaviOS Miatoll A12. 👍👍
Update- Works only once. After Pause or Stop it's not working.
 
Last edited:
  • Like
Reactions: broky

elong7681

Senior Member
May 23, 2015
525
177
40
US
Moto X4
Google Pixel 2 XL
Just bumped into this thread today.

I've created a simple magisk module that all it does is to update the post-fs-data.sh script, included on official installer by @Team_DeWitt.

This "fix module" just replaces the official script, nothing else. It even deletes himself after replacing the script.

That is done after 20 seconds upon the reboot we have to do after installing the fix.

As soon as the script is changed and the fix gets deleted by itself, you may enable Legacy mode, on Viper4Android app, and reboot the device to get this working on Android 12.

Sometimes a second reboot is needed (faced that during my tests).

Hope it helps.


Cheers!
I can confirm that this method works on the P5 stable A12
 
  • Like
Reactions: broky

Zoidiano0

Senior Member
Oct 1, 2014
51
20
Just bumped into this thread today.

I've created a simple magisk module that all it does is to update the post-fs-data.sh script, included on official installer by @Team_DeWitt.

This "fix module" just replaces the official script, nothing else. It even deletes himself after replacing the script.

That is done after 20 seconds upon the reboot we have to do after installing the fix.

As soon as the script is changed and the fix gets deleted by itself, you may enable Legacy mode, on Viper4Android app, and reboot the device to get this working on Android 12.

Sometimes a second reboot is needed (faced that during my tests).

Hope it helps.


Cheers!


It worked With the latest Viper4Android form Magisk repo

Device: Xiaomi Note 8 ginkgo
ROM: PixelOS (Android 12 )
Steps:

install viper4android from magisk app
restart device install driver ( reboot )

install Fix File
Enjoy

in my Case no need of legacy Support..

Thanks
 
  • Like
Reactions: ProjectAlly

SchmilK

Senior Member
Nov 2, 2007
753
516
play.google.com
Google Pixel 6 Pro
Got it to work AFTER my drive to work on my Pixel6Pro.
Selinux remains as Enforcing (Permissing i couldn't get it to process)
Installed APK , launched, clicked ok to install driver.
Installed Magisk fix and rebooted.
I do have to have legacy mode enabled otherwise it's in an error state.

Looking forward to the drive home tonight!
 
  • Like
Reactions: ProjectAlly
Just bumped into this thread today.

I've created a simple magisk module that all it does is to update the post-fs-data.sh script, included on official installer by @Team_DeWitt.

This "fix module" just replaces the official script, nothing else. It even deletes himself after replacing the script.

That is done after 20 seconds upon the reboot we have to do after installing the fix.

As soon as the script is changed and the fix gets deleted by itself, you may enable Legacy mode, on Viper4Android app, and reboot the device to get this working on Android 12.

Sometimes a second reboot is needed (faced that during my tests).

Hope it helps.


Cheers!

Hey just wanted to say, THANK YOU! 😁
This was such a huge help, I just did a fresh install for the latest Android 12 build on my phone, and flashed your files and it worked!

Before that I manually added the post-fs fix (got the name wrong I know 😅) but flashing your files through Magisk worked amazingly!

What you accomplished was what I've been trying to do lately with digging through the Viper files. I'm not really that knowledgeable when it comes to Android apps and their coding, but am interested in learning how to edit things, for the sake of keeping Viper4Android updated for newer Android updates going forward.

Seriously thanks for your effort on this!

Maybe you could help me on this one thing, depending on what vehicle I drive (I do deliveries for a certain auto parts store, so I drive multiple vehicles), sometimes I have to toggle legacy on/off to keep it working, or Android kills the Viper app/process altogether and I have to reopen it. Have you experienced that?

This is specifically tied to these vehicles and their BT. This doesn't happen in my personal vehicle though. Just curious.
 

Morgrain

Senior Member
Aug 4, 2015
902
984
The fix with editing /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh does not work on my Pixel 6 Pro. Anyone here got another idea? It just says "abnormal" when I try to play it on my bluetooth headphones. When I have no bluetooth headphones connected and use the speakers to make sound, a4A works strangely enough.

My most recent attempt was this method

Installed the apk (2.7.2.1) first, opened it, granted root, installed driver, reboot, replace that post-fs-data file with the custom one (yes, I added the stuff correctly at the bottom of the row), reboot and turn on Legacy Mode. Reboot again.
 

Typhus_

Senior Member
Hey just wanted to say, THANK YOU! 😁
This was such a huge help, I just did a fresh install for the latest Android 12 build on my phone, and flashed your files and it worked!

Before that I manually added the post-fs fix (got the name wrong I know 😅) but flashing your files through Magisk worked amazingly!

What you accomplished was what I've been trying to do lately with digging through the Viper files. I'm not really that knowledgeable when it comes to Android apps and their coding, but am interested in learning how to edit things, for the sake of keeping Viper4Android updated for newer Android updates going forward.

Seriously thanks for your effort on this!

Maybe you could help me on this one thing, depending on what vehicle I drive (I do deliveries for a certain auto parts store, so I drive multiple vehicles), sometimes I have to toggle legacy on/off to keep it working, or Android kills the Viper app/process altogether and I have to reopen it. Have you experienced that?

This is specifically tied to these vehicles and their BT. This doesn't happen in my personal vehicle though. Just curious.

Sorry for the late reply. I really don't know anything about that. My fix was just to replace the post-fs-data.sh script for the one with more policy lines included that make Viper work on Adnroid 12. Maybe some cars receive bluetooth audio with a different codec or something...dunno really.

The fix with editing /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh does not work on my Pixel 6 Pro. Anyone here got another idea? It just says "abnormal" when I try to play it on my bluetooth headphones. When I have no bluetooth headphones connected and use the speakers to make sound, a4A works strangely enough.

My most recent attempt was this method

Installed the apk (2.7.2.1) first, opened it, granted root, installed driver, reboot, replace that post-fs-data file with the custom one (yes, I added the stuff correctly at the bottom of the row), reboot and turn on Legacy Mode. Reboot again.

It's working at my end and for many other users. Something could be wrong at your end. Try an Android 12 clean flash. See if it helps.


Cheers!
 

Morgrain

Senior Member
Aug 4, 2015
902
984
Sorry for the late reply. I really don't know anything about that. My fix was just to replace the post-fs-data.sh script for the one with more policy lines included that make Viper work on Adnroid 12. Maybe some cars receive bluetooth audio with a different codec or something...dunno really.



It's working at my end and for many other users. Something could be wrong at your end. Try an Android 12 clean flash. See if it helps.


Cheers!
I literally came from an Android clean flash, since I rooted yesterday and had to setup anew overnight^^
 

Morgrain

Senior Member
Aug 4, 2015
902
984
I just tried out a suggestion from https://forum.xda-developers.com/t/...ow-to-root-magisk-only.4382059/#post-86181119 and deactivated HD audio in developer options (I have been using WF-XM4 (buds) and Sonys bigger XM4 (both work with LDAC) and now it works! But... only with a ****ty codec. I don't really get why this is an issue, it worked without problem back in the days with my P3/P4 with Android 11 and LDAC. Anyone here got an idea?

Is there maybe a way to force LDAC/a higher codec, even though the system thinks that it uses a lower quality one? To trick v4a?

Edit:

Alright, so I narrowed it down a bit.

The problem are both the bitrate and samplerate.

The maximum that this V4A fix currently supports is

48kHz <- down from 96 kHz
32bits/sample <- remains
330kbps <- down from 990kbps

That is still a step up from SBC (44.1Khz 16bit) - ergo if I tune that down in developer options, I can still use LDAC, even though with a reduced bitrate. Besides stating the obvious (v4a is "made" for only 48Khz), that was never a problem in the past (especially not with 990 kbps), so that's something "new" with Android 12/P6.
 
Last edited:

奶茶G

Member
Mar 4, 2017
27
0
53
Working good for me i installed the driver let it reboot then i went into the settings in viper app and toggled the legacy mode i also have the kernel set to permissive

Sony Xperia 1 II Android 12

There is no problem with the current use, and the sound has become better.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    In case it helps anyone else, this worked for me on a rooted stock Android 12 (Jun22) Pixel 4:-
    • Set SELinux to permissive
    • Follow the instructions posted by @elong7681 earlier in the thread
    • Set SELinux to enforced
    • Reboot
    V4AFX works, albeit in Legacy Mode.
  • 16
    Just bumped into this thread today.

    I've created a simple magisk module that all it does is to update the post-fs-data.sh script, included on official installer by @Team_DeWitt.

    This "fix module" just replaces the official script, nothing else. It even deletes himself after replacing the script.

    That is done after 20 seconds upon the reboot we have to do after installing the fix.

    As soon as the script is changed and the fix gets deleted by itself, you may enable Legacy mode, on Viper4Android app, and reboot the device to get this working on Android 12.

    Sometimes a second reboot is needed (faced that during my tests).

    Hope it helps.


    Cheers!
    9
    Hopefully we'll find a solution soon!
    I bought Wavelet today (original dev of V4A), but it doesn't quite work or feel the same as Viper, there is honestly no replacing it, it's invaluable, at least for those of us who love good audio quality.
    Hey man I got it working. Got an apk that works on android 12.. Just install, grand root permissions, install drivers n reboot! Do disable battery optimization! Hope it works. Tested on poco f1 android 12 beta 3.
    8
    Hey guys,

    I got it working without using any unofficial apks. You have to edit the file /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh (can only be edited using a root explorer like Solid Explorer).
    You have to add the following lines to the bottom of the file
    magiskpolicy --live 'allow audioserver audioserver_tmpfs file { read write execute }' magiskpolicy --live 'allow audioserver system_file file { execmod }' magiskpolicy --live 'allow mediaserver mediaserver_tmpfs file { read write execute }' magiskpolicy --live 'allow mediaserver system_file file { execmod }' magiskpolicy --live 'allow audioserver unlabeled file { read write execute open getattr }' magiskpolicy --live 'allow hal_audio_default hal_audio_default process { execmem }' magiskpolicy --live 'allow hal_audio_default hal_audio_default_tmpfs file { execute }' magiskpolicy --live 'allow hal_audio_default audio_data_file dir { search }' magiskpolicy --live 'allow app app_data_file file { execute_no_trans }' magiskpolicy --live 'allow mtk_hal_audio mtk_hal_audio_tmpfs file { execute }'

    Reboot once after saving the file, then open V4A, go to settings and switch on legacy mode.

    No idea why it only works using this way, but I don't want to install any unofficial apks so that was my way of choice. Let me know if it works for you too :)
    6
    Try this it works for me on P5 A12.1 flash V4A first don't reboot then flash the fix don't reboot open the V4A app install the driver and it will reboot automatically you have to use legacy mode but it works
    5
    I'm looking for the same!
    Hopefully we'll find a solution soon!
    I bought Wavelet today (original dev of V4A), but it doesn't quite work or feel the same as Viper, there is honestly no replacing it, it's invaluable, at least for those of us who love good audio quality.