Rockbox

Tasklist

FS#11999 - New NSF (Nintendo Sound Format) codec based on Game_Music_Emu ;)

Attached to Project: Rockbox
Opened by Mauricio Garrido (gama) - Tuesday, 08 March 2011, 14:38 GMT
Last edited by Andree Buschmann (Buschel) - Monday, 04 July 2011, 05:54 GMT
Task Type Patches
Category Codecs
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi, this is a new nsf codec based on blargg's great
Game_Music_Emu library (http://slack.net/~ant/libs/audio.html#Game_Music_Emu).

I decidec to write it because the old one didn't have vrc7 support and i think
the emulation and sound quality is better in Game_Music_Emu.

Created from revision: 29484
Tested on: Sansa Fuze V2

Features:

- Support for all nes extra sound chips (mmc5, fme7, fds, vrc6, vrc7, n106)
- Support for nsf and nsfe files.
- 44 khz stereo sound.
- Support for extended m3u playlists and internal
nsfe playlists.
- Very good sound quality thanks to the use of blargg's library.

Note1: This codec has Joshua's patch merged to make it compile fine in all targets.
I have only a Sansa Fuze V2 so please let me know if something doesn't work in
other player.
Note2: If you find some bug or have any comment or suggestion please let me know.
This task depends upon

Closed by  Andree Buschmann (Buschel)
Monday, 04 July 2011, 05:54 GMT
Reason for closing:  Duplicate
Additional comments about closing:  Replaced by FS#12176.
Comment by Postolati Maxim (tails_) - Tuesday, 08 March 2011, 17:43 GMT
maaan you're my hero for last weeks ;_;
Comment by Postolati Maxim (tails_) - Tuesday, 08 March 2011, 18:25 GMT
At least one tune (attached; that's robokabuto's entry to famicompo mini 5) plays wrong: at 1:45 should be VRC6 solo and at ~1:50 should be VRC7 in background (though it appears later but sounds totaly wrong) hmm is that's GME's problem?
Comment by Postolati Maxim (tails_) - Tuesday, 08 March 2011, 18:33 GMT
whoops that was not VRC6 bu FME7. You also can check how it should sound in nsf play ( http://www.pokipoki.org/dsa/index.php?NSFplay )
Comment by Postolati Maxim (tails_) - Tuesday, 08 March 2011, 18:41 GMT
VRC7 emulation really pushes out D2's CPU... I wonder will it handle ym2612? oh and looks like custom tone update in VRC don't works et all :(
P.S. Really sorry for flooding in such serious place >_<
Comment by Mauricio Garrido (gama) - Tuesday, 08 March 2011, 21:59 GMT
Yes i have confirmed those bugs, and it seems it sounds fine in the original gme6,
might be a nes cpu problem, since i'm still using the one from gme5.2. Will give it a
try and let you know.

> VRC7 emulation really pushes out D2's CPU... I wonder will it handle ym2612?

Yeah even on the PSP i had to overclock a little when playing vgm's with the ym2413
enabled. But anyway once the codec is finished there will be more chances that someone
makes some optimizations, like happened with the spc codec ;).
Comment by JoshuaChang (JoshuaChang) - Wednesday, 09 March 2011, 01:46 GMT
the psp's core cpu is based on mips architecture, much different from arm.
as far as i know, the onda vx7x7 series also base on mips and have a clock around 350mhz, as you can see the comparison in docs, it doesn't have advantage over d2's 200mhz arm926e
Comment by Mauricio Garrido (gama) - Wednesday, 09 March 2011, 03:43 GMT
> At least one tune (attached; that's robokabuto's entry to famicompo mini 5) plays wrong ...

I think i have fixed the fme7 bug, but not sure about the vrc custom tone update
though, could you explain how it should work?. Great song by the way, it uses four chips :0.

And sorry for making the psp's cpu comparison, i don't really know much about cpu arquitectures ;P.
Comment by Postolati Maxim (tails_) - Wednesday, 09 March 2011, 05:41 GMT
well i don't know much about VRC7 chip but you found most information here http://kevtris.org/nes/vrcvii.txt
Comment by Mauricio Garrido (gama) - Wednesday, 09 March 2011, 14:46 GMT
Made some quick fixes/changes to the codec.

Changelog:

- Fixed amp table not being defined in fme7 apu.
- Merged latest nes cpu from blargg's gme.

Maxim could you try this updated codec? And could you tell me of a song that uses
custom tone in vrc7 to compare it with nsf_play?.
Comment by Mauricio Garrido (gama) - Wednesday, 09 March 2011, 14:50 GMT
NOTE: There are two files missing in the patch v0.2, please put them in the libnsf folder ;)
Comment by Postolati Maxim (tails_) - Wednesday, 09 March 2011, 16:12 GMT
Tried it now. FME7 seems to work fine but again same problem with VRC7 chip looks like it plays sinus wave instead of reprogrammed tone, so i wonder if it really updates it (becouse there was only one game on NES that used FM synth so blargg could basicly use custom tone from it without allowing update).
P.S. Can you record how this tune(entry015.nsf) sounds on GME 0.6 on PC?
Comment by Postolati Maxim (tails_) - Wednesday, 09 March 2011, 16:23 GMT
Here's another nice tune to check VRC7, check on 0:50 I don't hear vrc7 here at all (compared to nsfplay).
Comment by Postolati Maxim (tails_) - Wednesday, 09 March 2011, 16:37 GMT
oh and there is another nsf player i guess you can look how VRC7 emulation interpreted here
Sources: http://offgao.no-ip.org/program/nezplug++_s.zip
Binary: http://offgao.no-ip.org/program/nezplug++.zip (includes winamp plugin stanalone player and browser plugin)
bad that all documentation in japanese and programmer doesn't seems to know english
P.S. that's not good idea to port this one becouse it has pretty bad N106 emulation
P.P.S there's nsfplug(nsfplay) sources if you didn't noticed them: http://dsa.sakura.ne.jp/arc/src/xgm/xgmapp061209s.zip
Comment by Chris Moeller (kode54) - Wednesday, 09 March 2011, 22:13 GMT
Both files posted work fine in foo_gep, which uses Game_Music_Emu 0.6-pre in its native form. Maybe the plug-in developer made an error in his C++ to C conversion?
Comment by Mauricio Garrido (gama) - Wednesday, 09 March 2011, 23:09 GMT
Yep, you are right Chris, i made a mistake in the tl and sin tables, i'm using precalculated tables because rockbox doesn't have
a math library, but i was using incorrect values. Maxim, could you try with these files, i also increased the vrc7 apu
volume gain a little just for testing, but i think some apus might need more volume.

P.S Really great song by the way.
Comment by Postolati Maxim (tails_) - Thursday, 10 March 2011, 04:46 GMT
Hoooooray it works ;) though again i have feeling that VRC7 is a bit quet again, where in sources i could tweak device voulmes?
Comment by Postolati Maxim (tails_) - Thursday, 10 March 2011, 05:13 GMT
Checked again. VRC7 voulme is fune but only custom instrument sounds quet
Comment by Chris Moeller (kode54) - Thursday, 10 March 2011, 05:39 GMT
In which case, the YM2413 emulator it uses must be broken, because it treats all instruments equally. Compare with foo_gep or in_mgme, two plug-ins which also use GME 0.6-pre.
Comment by Postolati Maxim (tails_) - Thursday, 10 March 2011, 18:26 GMT
err please forget last comment it sounds just fine, thanks gama :-)
Comment by Mauricio Garrido (gama) - Thursday, 09 June 2011, 23:49 GMT
This is the updated codec that works with the new playback engine.

Changelog:

- Removed all metadata handling from the codec
- Made some changes to the nsf metadata parser to work correctly with the new codec.
- Replaced the MAME 2413 emu with one by Mitsutaka Okazaki, who grants permission
to redistribute his emu.
- ...

Comment by Mauricio Garrido (gama) - Friday, 10 June 2011, 13:42 GMT
Please update the file apps/metadata/nsf.c with this one:

- Fixed some memset bug
   nsf.c (8 KiB)

Loading...