HydrogenAudio

Lossy Audio Compression => Opus => Topic started by: Tuval on 2023-01-03 21:16:45

Title: Opus Compatibility: 1.3.1 encoder with 1.1.2 decoder
Post by: Tuval on 2023-01-03 21:16:45
Hi all,

TL;DR: Encoding with 1.3.1 Opus encoder and decoding with 1.1.2 Opus decoder results in extremely bad / distorted audio.

We have a software that (among other functionalities) sends encoded audio between different machines, using `libopus` to encode/decode the audio.
(in case it's relevant - we're using `ALSA` APIs to control recording/playback devices)
Some of our machines are running Ubuntu 18.04 and some are running Ubuntu 20.04.
Some machines are amd64 and some are arm64.

The Ubuntu apt repos for 18.04 bionic provide libopus0 version 1.1.2.
The Ubuntu apt repos for 20.04 focal provide libopus0 version 1.3.1.

When we encode the audio with 1.3.1 Opus encoder (on 20.040, and decode it with 1.1.2 Opus decoder - we get very distorted sound.
When we manually cloned the Opus git repo, and built v1.1.2 on the 20.04 machine, the resulting sound quality was good.

Manually building 1.1.2 on all the 20.04 machines we want to run our software on, is not really a practical solution for us.

My questions:
1. Do you know why we are experiencing the distorted / bad quality audio? Are 1.3.1<>1.1.2 incompatible (I didn't find any such note in the Opus documentation)
2. Can I somehow change the 1.3.1 encoder configurations, so that it's compatible with a 1.1.2 decoder?
3. Can you suggest to me how to further debug the issue, to better analyze the root cause??
4. Is there a way to install 1.3.1 on 18.04 OR 1.1.2 on 20.04, without manually cloning the git repo and building?

Thanks in advance.
Title: Re: Opus Compatibility: 1.3.1 encoder with 1.1.2 decoder
Post by: Eurobeat_fan on 2023-01-04 05:33:23
I guess it would be a good idea to provided a sample of distorted audio here so people here would get an idea what's wrong.

Because actually version of Opus decoder shouldn't matter at all if we talk about decoding.
Title: Re: Opus Compatibility: 1.3.1 encoder with 1.1.2 decoder
Post by: itisljar on 2023-01-04 07:37:41
Manually building 1.1.2 on all the 20.04 machines we want to run our software on, is not really a practical solution for us.

Correct me if I'm wrong, but you don't need to manually build encoder on all machines, you can just copy the encoder from one machine into /usr/bin on all machines and it will work. At least until this is all sorted out.

EDIT: I'm on Windows, so that may be the difference, but I've encoded a song with latest opus I have (opus-tools 0.2-3-gf5f571b using libopus 1.3) at 96 kbit VBR and decoded with old decoder (v0.1.9-9-gaa7e018 using libopus 1.1.2) and there was no problem whatsoever. Samples of input and distorted output would be most preferable.