Page 1 of 2
FFmpeg download Catch-22
Posted: Tue Sep 30, 2014 12:49 am
by Edgar
This only happens with the experimental VS 2012 Project. I grabbed SVN HEAD (R13340) yesterday; it looks like it should be the release version of 2.0.6. Because I was previously running 2.0.5 I had the old FFmpeg installed. The compile went fine in both Debug & Release. The first time I launched Audacity 2.0.6 I did so via the debugger using the Debug build. It got past asking me if I wanted to reset preferences but then asserted/crashed. The problem is in this section of code at or near line number 849 of file srcFFmpeg.cpp:
Code: Select all
// Show the actual libraries loaded
if (avutil) {
//efm5 debug
//wxLogMessage(wxT("Actual avutil path %s"),
// FileNames::PathFromAddr(avutil->GetSymbol(wxT("avutil_version"))).c_str());
}
if (avcodec) {
//efm5 debug
//wxLogMessage(wxT("Actual avcodec path %s"),
// FileNames::PathFromAddr(avcodec->GetSymbol(wxT("avcodec_version"))).c_str());
}
if (avformat) {
//efm5 debug
//wxLogMessage(wxT("Actual avformat path %s"),
// FileNames::PathFromAddr(avformat->GetSymbol(wxT("avformat_version"))).c_str());
}
The actual problem is somewhere in:
Code: Select all
FileNames::PathFromAddr(avutil->GetSymbol(wxT("avutil_version"))).c_str()
and her brethren. As you can see above I have commented these out and got Audacity run successfully, open Preferences, open the Libraries panel and ultimately download the new version of FFmpeg library.
Code: Select all
// Returns a pointer to the symbol on success, or NULL if an error occurred
// or the symbol wasn't found.
void *GetSymbol(const wxString& name, bool *success = NULL) const;
Note that while error-checking is available we are not attempting to use. Getting ridiculously exhaustive:
Code: Select all
//wxLogMessage(wxT("Actual avutil path %s"),
// FileNames::PathFromAddr(avutil->GetSymbol(wxT("avutil_version"))).c_str());
bool theError = false;
wxString theVersion(wxT("avutil_version"));
void * thePointer = avutil->GetSymbol(theVersion.c_str(), &theError);
wxString thePath = FileNames::PathFromAddr(thePointer);
I broke the Log Message parameter out into each of its individual component parts. Single stepping through this new code I can show that the error occurs at the line:
void * thePointer = avutil->GetSymbol(theVersion.c_str(), &theError);

- crash.png (82.18 KiB) Viewed 3751 times
As you can see in the picture the complaint is "Can't load symbol from unloaded library".
Re: FFmpeg download Catch-22
Posted: Tue Sep 30, 2014 10:06 am
by Gale Andrews
Are you sure this is only with VS2012, Ed? I have seen this on VS 2008 and Martyn Shaw has seen it (I don't know if he is still on VS 2008).
A developer would add FFmpeg using audacity.cfg if he/she could not bypass the assert.
A user of release builds gets told that FFmpeg was configured successfully before but they should now reconfigure it.
Gale
Re: FFmpeg download Catch-22
Posted: Tue Sep 30, 2014 5:02 pm
by Edgar
Gale Andrews wrote:Are you sure this is only with VS2012
100% repeatable on VS2012 (which I built at least 200 times in the last 2 days trying to get VS2012 2.0.6 to compile & run-so far unsuccessfully). I do see the "FFmpeg was configured successfully before but they should now reconfigure it" with (almost?) each new VS2008 2.0.6 compile (but I have not tried since using the new FFmpeg installer & reinstalling - to a different drive, renamed the old folders - Lame). I know the VS2012 Project is unsupported. I just wish someone who knew the compilers would figure out why the Debug configuration runs fine but the Release does not.
Gale Andrews wrote:
A developer would add FFmpeg using audacity.cfg if he/she could not bypass the assert.
After hours of tracking down the problem <grin>. Since I still have not gotten it to run in Release, I am not sure if FFmpeg is even working (though running the Debug via double-clicking the icon and Importing an FFmpeg-needed file works great). Just uncommented one of the Log calls and built Debug with the new FFmpeg installed - the problem is still there even with the new FFmpeg installed.
Re: FFmpeg download Catch-22
Posted: Wed Oct 01, 2014 2:48 am
by Gale Andrews
So there are two issues using VS2012 in 2.0.7-alpha, as I understand it.
1 The release build crashes before the app window appears:
http://forum.audacityteam.org/viewtopic ... 19&t=81447 .
2 The debug build asserts with an FFmpeg-related error "Can't load symbol from unloaded library" even if FFmpeg 2.2.2 is correctly installed to %PROGRAM FILES%FFmpeg for Audacity.
So I would suggest these should be tracked on bugzilla as soon as you we have sufficient information.
Do #1 and #2 occur even if you just execute audacity.exe, or do they only occur if you run Audacity from within VS2012?
Gale
Re: FFmpeg download Catch-22
Posted: Wed Oct 01, 2014 3:36 am
by Edgar
Gale Andrews wrote:So there are two issues using VS2012 in 2.0.7-alpha, as I understand it.
1 The release build crashes before the app window appears:
http://forum.audacityteam.org/viewtopic ... 19&t=81447 .
2 The debug build asserts with an FFmpeg-related error "Can't load symbol from unloaded library" even if FFmpeg 2.2.2 is correctly installed to %PROGRAM FILES%FFmpeg for Audacity.
Do #1 and #2 occur even if you just execute audacity.exe, or do they only occur if you run Audacity from within VS2012?
First, I have not tested 2.0.7-alpha just 2.0.6 Release although I expect the issues to present In the alpha.
Issue 1: there is something wrong with the hash tables. In the post to which you link I found that the hash pool dirTopPool caused a problem after approximately 164 entries. I spent another day today trying to figure out why the hash tables in the Command Manager are suffering exactly the same problem – after approximately 164 entries a problem appears. If you run either the Release or the Debug build from within the VS 2012 debugger there is no problem – everything works properly. However, if you run either the Release or the Debug build by double-clicking on their icons the problem is 100% repeatable. This is incredibly difficult to debug! The only debugging method is to insert MessageBox statements surrounding each potentially offensive statement and see where the problem occurs. This is an "hard crash" – the Windows dialog "Windows is checking for a solution…" appears.
Issue 2: this one raises its ugly head whether run from within the VS 2012 debugger or just by double-clicking the icon. From within the debugger you get an Assert and a forced Break; via double-click it is an "hard crash" unless the dialog "the libraries were found before… reconfigure" appears.
I see no point in raising Issue 1 on Bugzilla. I see strong support on the Developer List for moving to VS 2013; If these problems persist with VS 2013 the Developer responsible for the Project conversion will immediately hit these stumbling blocks. I was just hoping that someone else was also trying to get VS 2012 going and would chime in here.
I think you already have something appropriate on Bugzilla for issue 2.
Re: FFmpeg download Catch-22
Posted: Wed Oct 01, 2014 1:26 pm
by Gale Andrews
Edgar wrote:Gale Andrews wrote:So there are two issues using VS2012 in 2.0.7-alpha, as I understand it.
1 The release build crashes before the app window appears:
http://forum.audacityteam.org/viewtopic ... 19&t=81447 .
2 The debug build asserts with an FFmpeg-related error "Can't load symbol from unloaded library" even if FFmpeg 2.2.2 is correctly installed to %PROGRAM FILES%FFmpeg for Audacity.
[...]I think you already have something appropriate on Bugzilla for issue 2.
Where is that, Ed?
Gale
Re: FFmpeg download Catch-22
Posted: Wed Oct 01, 2014 5:31 pm
by Edgar
Gale Andrews wrote:Ed wrote:
[...]I think you already have something appropriate on Bugzilla for issue 2.
Where is that, Ed?
That's why they don't pay me for thinking <grin>! I'm pretty sure I've seen the topic discussed at length – most likely on the Developer List…here it is bugzilla:
http://bugzilla.audacityteam.org/show_bug.cgi?id=342
The title is now misleading but, starting with the second comment, you can see that Leland Lucius is probably the go-to person for this.
Re: FFmpeg download Catch-22
Posted: Thu Oct 02, 2014 2:37 am
by Gale Andrews
Edgar wrote:Gale Andrews wrote:Ed wrote:
[...]I think you already have something appropriate on Bugzilla for issue 2.
Where is that, Ed?
That's why they don't pay me for thinking <grin>! I'm pretty sure I've seen the topic discussed at length – most likely on the Developer List…here it is bugzilla:
http://bugzilla.audacityteam.org/show_bug.cgi?id=342
The title is now misleading but, starting with the second comment, you can see that Leland Lucius is probably the go-to person for this.
Yes I know that bug (as stated). But I understood the problem was
2 The debug build asserts with an FFmpeg-related error "Can't load symbol from unloaded library" even if FFmpeg 2.2.2 is correctly installed to %PROGRAM FILES%FFmpeg for Audacity.
I understood that because you said that
running the Debug via double-clicking the icon and Importing an FFmpeg-needed file works great
If that was tagged 2.0.6 then FFmpeg 2.2.2 must be correctly installed, and so if Debug crashes from within VS then it is doing so despite correct FFmpeg installation. So bug 342 doesn't seem relevant at first sight.
But to test your theory you could apply Leland's patch and see if the issue goes away, no?
Gale
Re: FFmpeg download Catch-22
Posted: Thu Oct 02, 2014 4:16 am
by Edgar
Gale Andrews wrote:
So bug 342 doesn't seem relevant at first sight.
But to test your theory you could apply Leland's patch and see if the issue goes away, no?
Sorry, I'm chasing down so many VS 2012 related problems I can't keep all the symptoms in mind. The "debug build runs fine or running either build under the debugger works fine" was probably only related to the HashTable bug. I think that bug 342 is sufficiently related, especially since it drifted almost immediately off-topic. I have not looked at the patch but from what I read on the Developer List and what I see in the source code it looks like a lot of the Dynamic Library loading code is in place and the wrapping #defines have not been used to turn it off. Just now I took a quick look at the code again and I might know what's going on – I'll do some more digging.
Re: FFmpeg download Catch-22
Posted: Thu Oct 02, 2014 4:32 am
by Edgar
Edgar wrote:I'll do some more digging.
Nope, sorry – just spaghetti code which needed some thought to figure out.