-
Notifications
You must be signed in to change notification settings - Fork 20
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
Synchronization errors #5
Comments
Yes, it is possible that you will have sync issue with ffmpeg decoder, because it lacks proper synchronization. Better alternative is libopenaptx maintained by Pali Rohar. Now, I'm working on (optional) direct bluez-alsa integration with that library, so the usage of openaptx (this repo) will not be required, unless one wants to use proprietary Qualcomm encoder/decoder. Stay tuned, I hope I will finish this integration today :).
Hmm, I've never seen such issue... Thanks for reporting it. |
Thank you for your reply. Unfortunately to build bluealsa with libopenaptx is not straightforward with latest commits. There are some type definitions in openaptx that are not present in libopenaptx. (i.e.: APTXENC). |
That's why I've said that I'm working on this integration :) I know it's not straightforward right now. When I will finish, I will ping you in this thread so maybe you could test whether it is working properly, will that be OK? |
It's fine. This is a important feature, together with added codecs in sink mode makes bluealsa a big product. |
Please, check this brach: https://github.com/Arkq/bluez-alsa/tree/libopenaptx In order to compile with I'd be glad if you could check firstly the new code but still with the |
Oh great. I had a brief test session. |
It should not have any impact. AptX stream does not use RTP anyway, so for aptX it changes nothing. Could you please record hci dump with this case scenario? It can be from phone or from host with bluealsa (the letter is preferable). |
Hi, I created the dumps you requested. |
Please capture dumps with "tcpdump -i bluetooth0". With your text logs there are no data, I need binary data for tests :) Note, that you have to start tcpdump BEFORE connecting headset. |
Oh sorry, I've never used hcidump before. |
OK, third time lucky :) Since you've never used tcpdump, there is the exact command which you shall use: |
And finally :-D This time it decided to work 2 times :-) |
Great, now it is OK. I will try to find the cause maybe today or tomorrow (in the worst case scenario during comming weekend :)) I will ping you here. |
I've updated the https://github.com/Arkq/bluez-alsa/tree/libopenaptx branch and this (openaptx) repository. I've made some tests with the dump you've provided and it seems that now sink more or less works with openaptx (there should be less error messages) and with libopenaptx. Could you please test with these both libraries? |
Hi @arkq , sorry for my late feedback, but I didn't have much time to work on it. BTW I did a quick test with libopenaptx and results are encouraging. It seems it works flawlessy, I tried to play, pause, close the application different times in the same session, no issues at all. Give me some time to have a deep test session and of course to give a chance to openaptx libraries, I will give you some feedbacks soon. |
Using libopenaptx everything is perfect now. No packet loss, no errors in systlog. Wonderful. |
Are you using latest master of openaptx? And what is the output of And the installed file
|
Oh my... no I'm using the v1.3.1 commit. I rebuild with the latest and I'll give you an update soon. |
No it is not working, same errors and choppy stream
|
OK, thanks for the feedback :) I guess changes are ready to be merged with master.
No, I think it's not required. The openaptx repo is mainly for compatibility layer with proprietary Qualcomm libs - and as a bonus there is a backend with ffmpeg, but only as an example. However, if you could provide a dump with an actual choppy stream maybe it would be possible to fix it :D I guess that starting and stopping stream with openaptx works now? |
Cool!!! Yes pause, resume and stop is working. |
I will keep it open for now, and I will try to actually fix this issue, but if it will not be possible (or it will go beyond FFmpeg API usage) I will close it with an appropriate comment. Thank for your support! |
Strange that you've got choppy stream.... I was able to decode this stream with ffmpeg-based decoder without any sync errors (the stream was: song 1, pause, song 2, pause, more song 2) . Of course, I'm doing it in the offline mode but using bluealsa code for decoding aptx stream. Which version of ffmpeg (libavcodec) you are using? On my host I've got this:
|
It is exactly the same version you mentioned: 58.91.100 . The only thing I can say is that the chopping sound is completely de-synchronized. Let say, the small chunk of audible sounds seems to be in late more than 1 sec with a bluealsa buffer of 20ms. Also the cpu load is higher than using libopenaptx but not so high that make me think that there are load issues (we are at 50-55% over the 20-25% of the libopenaptx codec). |
Hi @arkq , I'm testing openaptx with bluealsa on raspios.
I have some issues using with a Samsung A5 (2017) connected via bluetooth, forcing it to use aptx coded, but I don't think it is related on the device itself.
I get a plethora of errors on syslog getting the audio streams choppy and unusable.
Those are the errors:
Jan 24 11:33:10 moode bluealsa[20368]: [aptx @ 0x3bd000] Synchronization error
Jan 24 11:33:10 moode bluealsa[20368]: openaptx: ffmpeg apt-X: Send packet failed: Invalid data found when processing input
Jan 24 11:33:10 moode bluealsa[20368]: /usr/bin/bluealsa: E: Apt-X decoding error: Communication error on send
openaptx is built with those flags:
-DENABLE_DOC=ON -DENABLE_APTX422=ON -DENABLE_APTXHD100=ON -DWITH_FFMPEG=ON -DWITH_SNDFILE=ON
I had to add
libavutil>=56.22.100
dependency in CMakeFiles to complete the build.Thank you for the effort you are putting in your projects.
The text was updated successfully, but these errors were encountered: