-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding high volume low sample rate provides invalid LC3 frames #9
Comments
Hi Casper, just to put this into perspective, in your setup with two frames packed into a single SDU, all the first frames were decodable but not the second one. How high do you estimate the probability that the codec introduces errors in exactly every 2nd frame ? It is not completely excluded, but frankly, I would first take a look into your SDU payload composition code, before blaming the codec ;) |
@cptnpopcorn Try putting only one frame in each and you will see the same. Alternatively just reduce the gain to 50% and you will be able to decode. Also if you run both sides of the sample application you will have no problem decoding the data. |
@pschatzmann But the bug reports an issue when you use full amplitude - and the image shows you are not using full amplitude. Try to set the gain to 100% and decode the second or third frame(after the "ramp-up" period) - then you will see the clipping - also try to decode with another codec or capture it with a sniffer for decode - if the codec have sanity-checks on the values in the encoded data it will fail decoding altogether. |
Hi, About clipping, it's a known artifact of the "Long-Term Post Filter" (LTPF), that adds gain on pure sine signals. Note that this tool is only enabled at low bitrate. You will see those artifacts for any samplerates, that enables this tools.
(There is also artifacts when high energy is detected near nyquist frequency). But in any case, this should not bring you invalid bitstream. The root repository has landed on github (https://github.com/google/liblc3). Thanks. |
When encoding a 400Hz sinewave at 16kHz sample rate it was observed that the codec was clipping the sine, hence volume reduced by 10% as this removed the clipping. But even with this reduction other codecs will discard the data due to invalid content in the frame.
A capture was shared with Ellisys for analysis, and their response were:
The trace was using the current default settings in the unicast sample application. 32kbps, 16kHz, 10ms frames, volume: (INT16_MAX - 3000), 400Hz sine.
A volume of ~75% works around this issue (INT32_MAX - 8000). Also at 48kHz the issue do not seem to exist - even at full volume (+/-INT16_MAX).
UPDATE 2. of May 2022:
PLEASE NOTE:
When looking at this, please note that the issue occurs for HIGH volume. Above a certain gain level the LC3 encoder will start to produce invalid frames. Also please note that the nature of LC3 will introduce a "ramp-up" period where the output amplitude is not 100% even though you supply a 100% gain input signal. Hence please ensure you skip the first few frames for the analysis.
Also please note that several different combinations of frames/SDU were tested, and the issue disappears if gain is reduced - hence this issue is not related to how data is packed in to the SDU.
The text was updated successfully, but these errors were encountered: