timblepaw / gens-rerecording

Automatically exported from code.google.com/p/gens-rerecording
0 stars 0 forks source link

Unable to select movie, something to do with mp3 files #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Make a directory with spaces
2. Copy an ISO of a SegaCD game into there (my games filename also had spaces)
3. Open it and attempt to play a movie

When I browse to a movie and click open, it fails to open it. It just
displays 0 for rerecords, number of frames etc. and won't let me click play.

Specifics:
Path for ISO: H:\Games\Emulators\MDEmu-SR\Sonic CD (U)\Sonic CD (U).iso
Path for Movie: H:\Games\Emulators\MDEmu-SR\sonic-cd-usa-v2-nitsuja.gmv

It used to work fine like this (when playing upthorn's movie). Removing the
cfg file made no difference.

Original issue reported on code.google.com by farr...@bluetoaster.net on 25 Aug 2008 at 4:57

GoogleCodeExporter commented 9 years ago
Okay now it seems like it's something to do with the MP3 files. I renamed 
everything
without spaces and now it won't load a movie again. What could possibly cause 
that?!
It isn't playing them ingame either..

things are currently named like this:
SonicCD(U).iso
SonicCD(U) 02.mp3
SonicCD(U) 03.mp3
...
etc.

Original comment by farr...@bluetoaster.net on 25 Aug 2008 at 5:13

GoogleCodeExporter commented 9 years ago

Original comment by farr...@bluetoaster.net on 25 Aug 2008 at 5:37

GoogleCodeExporter commented 9 years ago
Selecting movies has absolutely nothing to do with MP3 files. If the number of 
frames
is 0 when you browse for the movie then I think the only possible explanation 
is that
the movie file you browsed to is bad or an incomplete download or on an 
inaccessible
drive or something. (How many bytes is it?) Either that or you're not running 
the
right Gens executable somehow, which would also explain why your MP3 files 
aren't
even playing in the game. I have spaces in my path to Gens and in all of the
ISO/MP3/CUE/movie filenames I use for Sonic CD so I'm pretty sure spaces has 
nothing
to do with it either.

Original comment by nitsuja-@hotmail.com on 26 Aug 2008 at 7:56

GoogleCodeExporter commented 9 years ago
I can load the same movies fine when playing something that isn't sega CD (eg 
loading
a dynamite headdy rom and opening your gmv) yet when I try and do it when 
theres mp3s
in the same folder as the iso, it doesn't work..

Original comment by farr...@bluetoaster.net on 27 Aug 2008 at 12:28

GoogleCodeExporter commented 9 years ago
Okay did some testing, it turns out when I compile the build using the Debug
solution, I get the above problem. When I build using the Release solution,
everything works fine.

I've never been sure of the difference between the two, so perhaps a more 
seasoned
coder on the project could enlighten me?

Original comment by farr...@bluetoaster.net on 27 Aug 2008 at 12:49

GoogleCodeExporter commented 9 years ago
Release is what should always be used unless you're actively debugging code. 
Debug
runs much slower because it has most optimizations off in order to make 
debugging
easier. I have no idea what could cause the problem you're seeing, and I can't
reproduce it using either Release or Debug. What compiler (version) are you 
using?

Original comment by nitsuja-@hotmail.com on 27 Aug 2008 at 4:29

GoogleCodeExporter commented 9 years ago
Microsoft Visual Studio 2005
Version 8.0.50727.867  (vsvista.050727-8600)
Microsoft .NET Framework
Version 2.0.50727 SP1

Installed Edition: Professional

Microsoft Visual C# 2005   77626-009-0000007-41467
Microsoft Visual C# 2005

Microsoft Visual C++ 2005   77626-009-0000007-41467
Microsoft Visual C++ 2005

Crystal Reports for Visual Studio 2005

Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 
(KB926601)   

Update for Microsoft Visual Studio 2005 Professional Edition - ENU (KB932232)   

Original comment by farr...@bluetoaster.net on 27 Aug 2008 at 5:06

GoogleCodeExporter commented 9 years ago
OK, well I still have no idea, but I think part of the problem is that Gens 
doesn't
report what went wrong when it fails to load a movie. Fixing that would be a 
good
first step, so at least we'll have a message like "can't find file x" or 
"doesn't
have a valid movie header" to start from.

Original comment by nitsuja-@hotmail.com on 28 Aug 2008 at 6:48

GoogleCodeExporter commented 9 years ago
I added some error reporting in the movie playback window, let me know what 
happens.
(You should be able to copy the message labeled "Notes" and paste it here, if 
not
then please show me a screenshot of the playback window.)

Original comment by nitsuja-@hotmail.com on 28 Aug 2008 at 8:47

GoogleCodeExporter commented 9 years ago
DEBUG Solution Notes:
ERROR: File "H:\Games\Emulators\MDEmu-SR\sonic-cd-usa-v2-nitsuja.gmv" not found.

I can assure you Mr. Gens, it is there. See, even your optimized brother says 
so:

RELEASE Solution Notes:
nitsuja

Original comment by farr...@bluetoaster.net on 28 Aug 2008 at 4:05

GoogleCodeExporter commented 9 years ago
Hmm, I was hoping it had gotten the path wrong, but that tells me that
fopen("H:\\Games\\Emulators\\MDEmu-SR\\sonic-cd-usa-v2-nitsuja.gmv","rb") is
returning NULL in Debug for you. Maybe it's some hardware limitation (what is 
this H
drive? does it work if you copy the whole thing to your C drive?) but I don't 
know
why Debug would run up against it if Release doesn't. There might be a function
equivalent to fopen that will give more information about why it is unable to 
open
that file ("file is locked", "too many file handles already open", something 
like that).

Original comment by nitsuja-@hotmail.com on 28 Aug 2008 at 4:34

GoogleCodeExporter commented 9 years ago
I figured it was a fair assumption it might be hardware, so I tried again on my
primary RAID:

ERROR: File "C:\Users\Scan\Desktop\sonic-cd-usa-v2-nitsuja.gmv" not found.

H: is a 500GB external Maxtor drive I use for all programs and data that do not
require extremely high performance.

What is this "too many file handles already open"? It sounds like that might be 
a
possible error in this case. For example, what if it can only load a couple of 
files
at once? that would explain why I can open a ROM and gmv fine, but when I open 
an
ISO, the mp3s don't play and any attempts to open a gmv fails..

Original comment by farr...@bluetoaster.net on 28 Aug 2008 at 4:49

GoogleCodeExporter commented 9 years ago
I told it to print a more informative message than "not found", let's see what 
it says.

Original comment by nitsuja-@hotmail.com on 29 Aug 2008 at 7:19

GoogleCodeExporter commented 9 years ago
It seems my above idea was correct:

ERROR: File "H:\Games\Emulators\MDEmu-SR\sonic-cd-usa-v2-nitsuja.gmv" failed to 
load
because: Too many open files.

I don't understand why it thinks theres too many open files in only the Debug 
though..

Original comment by farr...@bluetoaster.net on 29 Aug 2008 at 2:56

GoogleCodeExporter commented 9 years ago
It should print how many files is too many now, maybe that will tell us 
something.
The limit's initial value is determined by the libc library and Debug does link 
in a
different version of that library than Release does. The limit for me when 
compiling
in either Debug or Release is 512. It's possible to increase the limit (to at 
least
2048) but it seems like 512 should be enough for Gens.

Original comment by nitsuja-@hotmail.com on 29 Aug 2008 at 4:26

GoogleCodeExporter commented 9 years ago
Debug:
ERROR: File "H:\Games\Emulators\MDEmu-SR\sonic-cd-usa-v2-nitsuja.gmv" failed to 
load
because: Too many open files (512).

Original comment by farr...@bluetoaster.net on 29 Aug 2008 at 4:45

GoogleCodeExporter commented 9 years ago
I found and fixed an MP3 file handle leak, see if it works now. I don't think it
could have been adding up to 512 files on its own though...

Original comment by nitsuja-@hotmail.com on 30 Aug 2008 at 6:22

GoogleCodeExporter commented 9 years ago
Unfortunately, the problem still remains.

Is there a way I can check which files are being opened by gens though code 
change or
debugger?

Original comment by farr...@bluetoaster.net on 30 Aug 2008 at 3:01

GoogleCodeExporter commented 9 years ago
- Run Gens to the point where the game is open and the movie play dialog is up 
but
won't let you play the movie. Make sure that's the only Gens that's running.
- Download and run Process Explorer
(http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx).
- Click on Gens in the process tree (on the left, you might have to scroll down 
to
see it).
- Turn on Show Lower Pane in the View menu, and (I think it's the default but) 
make
sure the Lower Pane View is set to Handles.
- The lower pane will show which files Gens has opened (among other things)
- You can choose Save As... from the file menu to share this information.

Original comment by nitsuja-@hotmail.com on 30 Aug 2008 at 6:42

GoogleCodeExporter commented 9 years ago
Your instructions have been followed. I was considering trimming the process 
list out
of the file, but who knows, maybe something is conflicting.

Original comment by farr...@bluetoaster.net on 30 Aug 2008 at 7:00

Attachments:

GoogleCodeExporter commented 9 years ago
That's a perfectly ordinary amount of files for Gens to have open, so it seems 
like
something is wrong with the debug libraries you're linking in or with the way 
they
run on your computer (it looks like you're running 64-bit windows, I'm not sure 
if
that matters).

I've attached my debug executable so you can see if it gives you the same 
problem. If
it does, then I'm lost (if you post the .cfg file your debug exe is using I 
could try
duplicating the problem that). If it works fine though, it must be something 
about
your setup for compiling/linking the emulator rather than a problem with 
running it,
in which case, maybe you could post the debug exe and its pdb file so I could 
try
debugging where it fails?

Original comment by nitsuja-@hotmail.com on 30 Aug 2008 at 7:48

Attachments:

GoogleCodeExporter commented 9 years ago
Yours works fine, so it must be something my end, which is annoying. Here is 
the gens
and pdb file for you. Also, you might note that your gens is smaller than mine. 
I'm
unsure why.

Original comment by farr...@bluetoaster.net on 30 Aug 2008 at 7:57

Attachments:

GoogleCodeExporter commented 9 years ago
OK, it looks like you're running into this problem:
http://connect.microsoft.com/VisualStudio/feedback/Validation.aspx?FeedbackID=25
7606

Which has a hotfix "available" here: http://support.microsoft.com/kb/934586

I don't see a download link, so I guess it's necessary to call Microsoft 
support or
something to get a link to the download. After some searching around I found a 
post
that vaguely suggests the necessary files can be found inside the download 
available
at
http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d
-389c36f85647&DisplayLang=en
but it's possible I misunderstood what version that is.

If it helps, it's not happening for me because I have a slightly older version 
of
Visual Studio before they introduced that bug:

Microsoft Visual Studio 2005
Version 8.0.50727.762  (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP1

Installed Edition: Professional

Microsoft Visual C++ 2005   77626-009-0000007-41395
Microsoft Visual C++ 2005

Security Update for Microsoft Visual Studio 2005 Professional Edition - ENU 
(KB925674)   

Original comment by nitsuja-@hotmail.com on 31 Aug 2008 at 1:36

GoogleCodeExporter commented 9 years ago
Also, I could change the code in cd_file.c to use a windows API function 
instead of
fopen to check for file existence to stop the problem from happening. But I'm 
not
sure if I should... the current way of doing it is valid, and changing it would 
only
be a workaround for a bug in a particular version of Visual Studio.

Original comment by nitsuja-@hotmail.com on 31 Aug 2008 at 1:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Also also, if you use a .cue file for your MP3s (open it instead of the ISO) the
problem shouldn't happen. I've
attached a cue file that should work with the filenames you said your MP3s and 
ISO
had. (If you've renamed them you'll have to adjust the filenames inside it 
accordingly.)

Original comment by nitsuja-@hotmail.com on 31 Aug 2008 at 1:58

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for your assistance with this. I likely won't be coding anything that
requires testing/debugging with SegaCD games, and I can't downgrade because SP1
includes a Vista fix. I'll just have to remember to use Release only from now 
on :)

Still, it's nice to know that this is 100% a problem with Visual Studio 2005 
and NOT
Gens. Also thanks for the cue.

Setting to WontFix since changing the code to Windows API seems a bit stupid.

Original comment by farr...@bluetoaster.net on 31 Aug 2008 at 2:20