New celt build broke jack-audio-connection-kit...

Gregory Maxwell gmaxwell at
Sun Feb 20 02:57:20 UTC 2011

On Sat, Feb 19, 2011 at 9:13 PM, Orcan Ogetbil <oget.fedora at> wrote:
> I didn't try Michael's fix myself since I don't have a rawhide box
> with real audio hardware.
> But looking at the celt code, specifically to the implementations of
> celt_decoder_create() and celt_decoder_create_custom() , I don't think
> Michael did it wrong.
> Am I missing something? Why shouldn't it work?

Two reasons, the libcelt package is not compiled with
--enable-custom-modes, so it will not support anything but the frame
sizes of 120,240,480, and 960 at 48kHz and no other.  The netjack
functionality matches the CELT mode to the jack period which must be a
power of two (64,128,256,512,1024) as using another size would add
additional delay.  As the 0.11 package is compiled it can not be used
for netjack.

It was perhaps foolish of us to not enable custom modes in the default
build— it certainly isn't how a Linux system distributor should be
shipping it. I expect that we'll fix that in the next release of the

The second issue is that the celt-0.8 patch included in the SRPM is
incorrect— for some unimaginable reason it provides NULL to the
frame-size parameter, at first I assumed that this never could have
worked, but then I remembered that the input validation in libcelt was
previously broken. The broken code was managing to pick the largest
frame size supported by the current mode, which happened to coincide
with the frame sizes that the jack was asking for, which was why it
probably did work at one point instead of creating unintelligible
audio and reliably writing outside of the provided buffer.

Finally, jack now needs to call the CELT_SET_INPUT_CLIPPING API on the
encoder to prevent the codec clipping the input levels at 0dBFs.  I
emailed the authors of the netjack functionality when we changed the
clipping behavior because I knew it would impact their use case and
made sure to have an API to get the old behavior back. Though I
haven't heard anything from them.

If someone can get the libcelt package in fedora compiled with
--enable-custom-modes I can provide revised and tested patches for
jack.  I'm clueless about the fedora packaging process— but as one of
the libcelt authors and a netjack user I know this software rather
well and I'm perfectly comfortable hacking on it.

More information about the devel mailing list