Crackling noise when using Opus codec with certain other apps open

Issue description:

When playing files that use Opus directly, or files that have been transcoded to Opus either on the fly or in the cache quite noticeable crackling noise appears when Symfonium is backgrounded and certain other apps are running in the foreground, for example Pokemon Go (note all sounds have been disabled in Pokemon Go, but I assume it’s still sending audio to the system with 0% volume triggering the issue).

The issue usually does not occur when listening to FLAC files, but if I enable offline cache on a FLAC file so it transcodes the issue then appears for that file. On occasion while mucking with caching I’ve had FLAC have the same issue, but I suspect it’s actually still cached in those instances and the UI just isn’t showing the correct information

Logs:

Upload description: nvxnvx

Additional information:

 
It sometimes seems intermittent, frustratingly while attempting to reproduce it with logging enabled I had the issue occur playing a FLAC file (Song of Storms), but the issue didn’t occur when playing “7 Minutes” after adding it to the persistent offline cache which made it transcode to Opus, so perhaps the codec is a red herring

Also the app happily let me upload the logs with “nvx” as the identifier, but then the support page said 5 character minimum for the identifier, so I had to upload it a second time as “nvxnvx”
 

Reproduction steps:

 

 

Media provider:

Subsonic

Screenshots:

     

Be sure to read https://dontkillmyapp.com/.

And you can try to uncheck the option prefer internal decoder as the OS decoder may have higher priority.

I’m on a Pixel 9a and unrestricted background battery is enabled for Symfonium. Not having to fight silly OS behaviour is one of the reasons I pick Pixel phones.

Note this doesn’t happen when the app is backgrounded generally, only with certain apps are open (I suspect unity based games). Most other apps can be running in the foreground without issues. I’m wondering if it’s something where say one app sending 48kHz audio to the system while another app sends 44.1kHz audio (even at 0 volume) is causing some weirdness. I note there’s an option to limit to 48kHz presumably to fix issues where say 96kHz isn’t supported, but I do wonder if a similar option to limit to 44.1kHz might help in this case. That said this is just a guess.

As I said try to uncheck prefer internal decoder.

No difference with prefer internal decoder disabled vs enabled.

Then there’s not much I can do here :frowning: