Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

AAC encoding error #34

Closed
prurigro opened this issue Feb 13, 2019 · 16 comments
Closed

AAC encoding error #34

prurigro opened this issue Feb 13, 2019 · 16 comments
Labels
bug Something isn't working

Comments

@prurigro
Copy link

prurigro commented Feb 13, 2019

First of all, thank you for this project! I didn't think I'd ever be able to use bluetooth headphones on Linux before finding this.

Everything seems to be working correctly (with pactl showing the AAC codec in use), but after a certain amount of time (sometimes minutes, sometimes seconds), the pulseaudio output device automatically switches back to the default (line out) and journalctl shows the following error:

pulseaudio[22152]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60

I can then switch the output device back to the bluetooth headphones and it'll work again for a few more seconds or minutes until the error appears again. I tried manually switching the output away from the bluetooth headphones to see if the error was triggered in the other direction, but no error messages appear in that case. The bluetooth logs don't show any brief disconnects or anything either.

Let me know if there's any additional output or tests I can perform to help!

@EHfive EHfive added the bug Something isn't working label Feb 13, 2019
@EHfive
Copy link
Owner

EHfive commented Feb 13, 2019

Please build from https://github.com/EHfive/pulseaudio-modules-bt/tree/aac_fix_dev .

If issue not fixed, show me the AAC error log

@prurigro
Copy link
Author

Thanks for the quick response and attempt at a fix! Unfortunately the error hit again, but I see you've added additional debugging output which will hopefully help:

pulseaudio[13772]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0

@prurigro
Copy link
Author

I'm not sure if this will tell you anything, but I tested a few more times and the error is identical every time:

Feb 13 17:15:34 hostname pulseaudio[13772]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0
Feb 13 17:19:42 hostname pulseaudio[13772]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0
Feb 13 17:23:53 hostname pulseaudio[13772]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0

@EHfive
Copy link
Owner

EHfive commented Feb 14, 2019

pulseaudio[13772]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0

The log shows nothing wrong in buffers.
It probably is a AAC encoder's issue.

I pushed a commit to aac_fix_dev which make it initializes necessary AAC encoder modules only.
Also, you might consider upgrading you fdk-aac library.

@prurigro
Copy link
Author

prurigro commented Feb 14, 2019

It seems like I'm running the latest version of fdk-aac (2.0.0), but I'll try git master after giving your update to aac_fix_dev a shot.

@prurigro
Copy link
Author

I tested your update and still got the error. I then updated to the master branch of fdk-aac and got the error again. Downgrading to v0.1.6 of fdk-aac however seems to have resolved the issue (it's been running successfully for an hour now).

If newer versions of fdk-aac (2.0.0 and above so far) are going to break pulseaudio-modules-bt, would it be worth statically compiling v0.1.6 until things are resolved upstream so other people don't have this issue as well?

Either way, thank you for your help!

@EHfive
Copy link
Owner

EHfive commented Feb 14, 2019

If newer versions of fdk-aac (2.0.0 and above so far) are going to break pulseaudio-modules-bt, would it be worth statically compiling v0.1.6 until things are resolved upstream so other people don't have this issue as well?

Actually, I'm OK with fdk-aac 2.0.0.

@EHfive
Copy link
Owner

EHfive commented Feb 14, 2019

Still OK with fdk-aac git latest (2.0.0.r100.g95858d7)

pulseaudio v12.2 s16le 2ch 48000Hz
bluez git latest (5.50.r264.g750a26cd9)

@prurigro
Copy link
Author

Strange, maybe there's something unique about my setup-- I suppose if others have the same configuration quirks and run into this problem they can read this issue and see that they need to downgrade.

Thanks again for your help and this project!

@prurigro
Copy link
Author

Just noticed your other comment-- for comparison, I'm running:

pulseaudio v12.2 s16le 2ch 48000Hz
bluez 5.50

@tobiolo
Copy link

tobiolo commented Feb 14, 2019

With fix applied still E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0
Now recompiled with downgraded libfdk-aac v0.2.6, also bluez 5.50, pulseaudio 12.2-2
So far no aac encoding errors.

@Neurognostic
Copy link

Neurognostic commented Jul 23, 2019

I was having the same issue with libfdk-aac v2.0.0. Downgrading to v0.1.6 seems to have resolved the issue.

pulseaudio v12.2
bluez-git v5.50.r470.g79bf51dbb-1

@Schlaefer
Copy link

Schlaefer commented Aug 22, 2019

My headphones were disconnecting with the same error every few minutes too. I toyed with the settings and switching to CBR with aac_bitrate_mode=0 seems to avoid the issue.

pulseaudio-modules-bt-git r141.3ecf1d7-1
bluez 5.50
libfdk-aac 2.0.0
pulseaudio 12.2

@tobiolo
Copy link

tobiolo commented Aug 23, 2019 via email

@lkraav
Copy link

lkraav commented Dec 11, 2019

Hmm, I'm not sure this issue should be closed. It's definitely constantly happening with pulseaudio-modules-bt, whereas it never happened with upstream bluetooth module implementation.

In my case, this error seems to consistently trigger within 30 min of Spotify playtime:

dets  11 15:42:42 papaya pulseaudio[89657]: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1778, to_read:4096, to_write:1778, encoded:0

pulseaudio-13.0
bluez-5.51
fdk-aac-2.0.0

I have bluez-5.52 and fdk-aac-2.0.1 available in unstable, I guess I could try those out.

@xhpohanka
Copy link

Hello, I'm also affected by this issue

pulseaudio[2057]: E: [bluetooth] a2dp_aac.c: AAC encoding error, 0x60; frame_count:0, in_bufSizes:4096, out_bufSizes 1332, to_read:4096, to_write:1332, encoded:0

My system is Arch linux, pulseaudio 13.0-3, pulseaudio-modules-bt 1.3-6, bluez 5.54-1, libfdk-aac 2.0.1-1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants