Offload mode with opus does not work anymore

App version

Production

Issue description

Since the update with the new audio engine, playing a file with opus does not use offload anymore. It worked flawless in version 14 (and other apps that support offload). For AAC it’s still working.

Device type

Phone

Media provider

Navidrome

Steps to reproduce

  • Set prefer hardware-accelerated codecs/Bypass processing/offload mode enabled in Output Settings
  • Play a file with opus codec
  • No sign of using offload (like offload=true in log or “Successfully opened file /vendor/dsp/adsp/./opus_dec_module.so.1” in Android logs like with version 14)

I searched existing issues first

on

I understand that logs are mandatory

on

Log upload name / description

dr85_opusoffload

Your device does not embed an hardware decoder for Opus it’s software only.

The log would suggest, that the DSP has support for opus.

If I enabled offload mode on version 14 (or some other apps), it would show entries like this in the logcat:

audioadsprpcd 2301 D audioadsprpcd vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:369: apps_std_fopen_fd done for /vendor/dsp/adsp/./opus_dec_module.so.1 with fsize:163752
audioadsprpcd 2301 I audioadsprpcd vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:1209: Successfully opened file /vendor/dsp/adsp/./opus_dec_module.so.1

Like it did with AAC (and still does with version 15), when offload mode enabled:

audioadsprpcd vendor/qcom/proprietary/adsprpc/src/apps_std_imp.c:1209: Successfully opened file /vendor/dsp/adsp/./aac_dec_module.so.1

Also, the App log showed something like this in version 14:

Verbose/ExoPlayer/3: audioTrackInit [eventTime=251.38, mediaPos=0.00, window=0, period=0, enc=opus, channelConf=stereo, sampleRate=48000, bufferSize=9562500, offload]
Verbose/AudioEngine/3: onAudioTrackInitialized: AudioTrackConfig(sampleRate=48000, channelConfig=12, tunneling=false, offload=true, bufferSize=9562500, encoding=20)

Again support Opus doesn’t mean it’s hardware decoded.

It’s not the case for your device.

With the new engine, offload with software decoder is less efficient than everything inside Symfonium.

I think I understand:

If I used offload with Opus on 14, it was still just running a software decoder, just on the Hexagon DSP instead of the main CPU, correct?

But shouldn’t that be still more efficient as the main CPU can go to sleep? How is it better with the new engine?

You are playing over network, the actual cpu and battery usage is mostly all there.

You can measure easily.

With that said provide an Android bug report https://developer.android.com/studio/debug/bug-report uploaded to https://upload.symfonium.app when playing with version 15 at least 10 minutes then another one with version 14 and offload. This will give number and may expose that OnePlus have hardware decoder but wrongly expose it as software.

Done. Description:dr85_opusoffload_bugreport