[Android Software Development] najabi:
I haven't touched the USB config, since I don't use it. You could edit it in the main audio policy or the usb audio policy xml, depending on your configuration. (There is an import link to a the usb file in my main config). I think whenever possible it should use the passthrough to the usb dac with a fixed bitdepth. Currently it's only 44.1 or 48 KHz. It should't resample before sending but I'm afrait it's what it does.

Yes, you add some profiles to deep_buffer mixport, without deleting the word "source".

As for the last question, you could make the edits and install narsil afterwards, if you want to have narsil effects. Basically what narsil does is remove most of all effect chains in audio_effects.xml, the main policy only adds 44.1 to primary_output, as long as i can remember, which is not useful in my opinion. I have found that only the highest value is used for mixer output. So you should only choose one value. To me just deep_buffer addition is meaningful, since primary_output is for calls, notifications, games..

In my experimentation I have observed that the effect chains are not detrimental to the sound. All the contrary, some manufactures like Xiaomi add effects to make the speaker sound better (e.g. dirac). Also I find volume listeners to be useful. If you use direct_pcm out, only volume listeners are applied to the output, if you don't enable others at the user interface in Android. I find equalizer useful. There are some effects that are loaded but not applied to the final output. You can remove them by hand, but I don't need it. In fact I haven't touched the policy or effects. When I want to listen to music on headphones, I use direct_pcm or compress_offload output, which is almost bitperfect as it is. If I use chrome with the phone speaker, I don't mind the ocassional resampling because the speaker itself is not hi-res. And I'm happy. I haven't found Narsil to sound any better in my phone in my tests. Same for the modified parameters, like build.prop values or with custom narsil configuration options. I don't notice them with my Audio-Technica headphones. But it might work for others, idk. The script seems well done, but in my case it doesn't modify the active policy file, which is /vendor/etc/audio/audio_policy_configuration.xml for my Xiaomi Mi 8. It modifies files on /vendor/etc and /system/etc.

As for deep_buffer and volume listeners, I have read that if you are using custom effect software tweaks like Viper4A, some music apps like Spotify don't work well with default deep_buffer output, that is why there is another magisk module 'Sound Modification Library', which what does is remove the deep_buffer mixport, since it seems deep_buffer doesn't let software effect work well with big buffers. Also, volume listeners that trigger to lower the volume when notification kick in, also disable the V4A effect. So that is why I think Narsil removes them aswell. I have tested JamesDSP effect library and it works ok with deep-buffer for me and Chrome, but I haven't tested it with Spotify or other apps.

What I do find useful for sound quality on headphones, and according to other audio related posts on xda, is to use a custom kernel supporting 'audio control'. This enable an Analog amp gain control for headphones, which lets you up 100% volume on android (full digital volume) and reduce the analog amp gain for adequate level on your headphones. Default value is about 80% analog amp. If you set full volume on android, you can obtain nice loud levels at 50% amp. If you listen to headphones with a low volume as, say 5% or 10% volume on android, we are losing bit depth or dynamic range in theory.