Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > Bug Reports & Feature Requests > NSF does not export correctly (DPCM bug) Owner: jrlepage New post
Page 1 of 2 Sort: Goto Page: [1] [2] Next >>
NSF does not export correctly (DPCM bug) Posted: 2013-07-19 01:02  (Last Edited: 2013-07-19 18:40) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49555
The NSF in [url=http://famitracker.com/forum/posts.php?id=2579&pid=41874#41874]this post completely freezes my Famicom when I try to play it on my TNS-HFC3. The NSF will play correctly in NSFPlay 2.3b4 (and other NSF players I'm sure), however. This appears to be a DPCM issue, since the FTM contains 175 kB of DPCM samples. I tried removing all DPCM pattern data and exporting, and the DPCM-less NSF does play on the Famicom. This happens regardless of whether I export from 0.4.2 or 0.4.3 beta 2.

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-19 02:23 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#49561
That NSF plays correctly on my powerpak with DPCM samples so the export itself seems fine. It's likely an issue with the TNS cart, though I have no idea why DPCM would make it fail.

_______________________
Programmer and developer
Posted: 2013-07-19 04:59 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49567
PowerPak is just emulation...

This isn't the first time DPCM causes a N163 NSF to fail. None of the N163 games published used DPCM samples. I'm beginning to feel there's a reason for that...

Any chance you might look into this further?

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-19 05:03  (Last Edited: 2013-07-19 05:03) Reply | Quote
Im_a_Track_Man

Avatar

Member for: 4137 days
Location: Plantation, Florida
Status: Offline

#49568
[quote=jrlepage]PowerPak is just emulation...[/quote]The 2A03 (and by extension, DPCM) isn't though, so if DPCM caused it to fail, wouldn't the same happen?

_______________________
[BURNING LOVE]
[url=http://www.youtube.com/user/ImATrackMan]YouTube
[url=https://twitter.com/ImATrackMan]Twitter (Stay off my lawn, kids)
Posted: 2013-07-19 05:05 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49569
Not if there's some kind of conflict between the DPCM and the N163 that the chip isn't able to emulate (because the bug/conflict/whatever in question isn't known in the first place).

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-19 05:06 Reply | Quote
DjJizzer5

Avatar

Member for: 3937 days
Status: Offline

#49570
i think you used to do hardware recordings of N163 songs with dpcm samples in them, though there was like max 16 kb and that worked. so is too much data the answer or is it something else

Posted: 2013-07-19 05:08  (Last Edited: 2013-07-19 05:08) Reply | Quote
Im_a_Track_Man

Avatar

Member for: 4137 days
Location: Plantation, Florida
Status: Offline

#49571
[quote=DjJizzer5]i think you used to do hardware recordings of N163 songs with dpcm samples in them, though there was like max 16 kb and that worked. so is too much data the answer or is it something else[/quote]

There are A LOT of samples in that song, and even if they're not used, they're still there, so that might be it.

_______________________
[BURNING LOVE]
[url=http://www.youtube.com/user/ImATrackMan]YouTube
[url=https://twitter.com/ImATrackMan]Twitter (Stay off my lawn, kids)
Posted: 2013-07-19 05:09 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49572
Yes, not all NSFs with DPCM fail, but there has been more than a few instances where an NSF will freeze at some point (sometimes even at the very beginning like this one). Maybe using more than 16 kB [i]is[/i] the problem, but if it's the case, I'd like to know for sure (and I'd like to know if there's a way to fix this).

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-19 05:09  (Last Edited: 2013-07-19 05:13) Reply | Quote
DjJizzer5

Avatar

Member for: 3937 days
Status: Offline

#49573
^ sanic the speed of light

umm, i know. it's just that n163 songs with less sample data worked on jrlepage's famicom. as far as i remember.

edit: is n163 connected with dpcm in any way?

Posted: 2013-07-19 05:15  (Last Edited: 2013-07-19 06:08) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49576
Shouldn't be.

EDIT: rainwarrior and I were discussing this, and he also seems to think it might be a problem with the HFC3; possibly some sort of conflict between what the FT driver does and what the player inside the HFC3 does. The problem is, TNS haven't released the source for their player (at least, I don't think they have), so it's pretty much impossible to know where the issue might be. Any ideas, jsr?

EDIT2: I did some testing, and sure enough, using too much DPCM data seems to cause issues. Right now the exact value where it goes from playing fine to crahing seems to be somewhere between 19 kB and 25 kB, but I still need to do some testing to find out more about the issue.

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-19 12:24 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#49585
The powerpak was just to verify that the exported NSF worked on the Famicom hardware, I didn't use N163 at all.

Yeah I would also assume it's some kind of conflict, the good question is why it would appear only on N163. One thing we could try is to create a song in MCK or manually with similar amount of DPCM samples and see if it works.

One other thing would be to limit the DPCM window in case it conflicts in some way, but then I would expect all NSFs to work only if they have less than 16kB samples. The first samples in that song is located near $C000 which would also indicate that something else is wrong. Maybe you can try deleting all DPCM notes from the first couple of frames (so that no DPCM bankswitching takes place) and see if the rest of the song plays?

_______________________
Programmer and developer
Posted: 2013-07-19 18:44  (Last Edited: 2013-07-19 18:58) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49593
I tried running the NSF in the first post without actually inserting a cartridge in the HFC3, and it still crashed, thus confirming the N163 had nothing to do with this issue after all.

I also tried making my own NSF with a large number of samples, and that's how I managed to reproduce the bug. The actual amount of individual samples doesn't seem to affect the outcome so much as the amount of data (which makes sense, after all - DPCM data is just data, it doesn't matter how you use it). I loaded the attached sample four times and the NSF plays fine on the HFC3. Load a fifth instance, however, and the NSF crashes on the first sample.

EDIT: doing the same as above (loading sine2.dmc five times) in ppMCK creates an NSF that will work just fine on the HFC3. I have attached that as well (clipboard.nsf), perhaps you can take a look and figure out what it's doing differently? Untitled.nsf is an NSF created under the same conditions but in FT instead.

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Attachments:
clipboard.nsf (40 Kb)
sine2.dmc (8 Kb)
untitled.nsf (28 Kb)
Posted: 2013-07-19 22:20 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#49608
This is strange. Could you please try if this file works better?

_______________________
Programmer and developer
Attachments:
dpcm_test.nsf (36 Kb)
Posted: 2013-07-19 22:26 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49610
Yup, works just fine.

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-19 23:22 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#49612
Ok, all I did was to add some empty banks to get the initial bank layout linear. I have no idea why that is necessary though.

_______________________
Programmer and developer
Page 1 of 2 Sort: Goto Page: [1] [2] Next >>