[Google Pixel 3a Guides, News, & Discussion] marstonpear:
This guide is about installing v4a on factory ROM viper4Android. Your mileage may vary with other versions of Android/OSs. I'm not responsible if your device bricks. I'm only writing this guide because I miss the golden days of using V4A on my personal device to enhance audio quality.

1. Get the earliest version of Android from Google's website. Make sure you have fastboot and adb installed on your system.

https://developers.google.com/android/images#sargo > get Android 9 from here

2. Enable Developer options. Go to developer options and enable bootloader unlocking.

3. Reboot the phone by holding down Power + Vol Down button to boot into fastboot.

4. With the phone in fastboot mode, connect it to your PC and execute the following. WARNING: This will wipe all data on the phone, I mean ALL.

fastboot flashing unlock

Then confirm on the phone that you want to unlock the bootloader.

5. Go into the zip file you've downloaded from Google and find the other zip file from within it. Extract the boot.img from that second zip.

6. Boot the phone into Android 9 but DO NOT connect it to any network.

7. Enable developer options again and disable automatic system updates from developer options.

8. Download Magisk from Github (from the releases) https://github.com/topjohnwu/Magisk

9. Clone the v4a repo from https://github.com/Magisk-Modules-Repo/ViPER4Android-FX and put the contents in a zip file. The top folder should contain the repo's folders, so when you open the zip file it should be exactly the same as the repo. On Linux you can use the following commands to do the job:

git clone https://github.com/Magisk-Modules-Repo/ViPER4Android-FX.git v4a
zip -r viper.zip v4a

Do the same thing with this repo to download Audio Modification Library : https://github.com/Zackptg5/Audio-Modification-Library

10. Transfer the boot.img, magisk apk and the compiled zips to the phone storage. Install Magisk.apk

11. Open Magisk and select install from top and select and patch a file. Choose the boot.img. This will give you another file called magisk_boot_random.img. Transfer this file to your desktop.

12. Boot the phone in fastboot mode and flash this magisk patched boot image onto the boot partition with the following:

fastboot flash boot magisk_patched_random.img

13. Boot the phone and open Magisk. Choose Modules> install from storage and install viper.zip and then AML's zip files. DO NOT REBOOT.

14. Open the v4a application and allow it to install the drivers. This will reboot the phone automatically.

15. Install a file explorer that allows root access to the system, add the following code to the /data/adb/modules/ViPER4AndroidFX/post-fs-data.sh

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 }'

16. Reboot and open v4a app, if it's not working, in the settings toggle the Legacy option on & off. This should be working now.