Danny
Programmer | Moderator
hey guys.
My experience with sound emulation is very low, and I am hoping one of you can give me some pointers as to what is wrong.
Basically what this is used in is my Wolfenstein 3D port.
I presumed for a long time that the issue lay in the fmopl.c, (opl emulator implementation). So I ported the latest version from mame to Wolf, and it made no difference.
So I am convinced that the issue lies in sd_sdl.c (Wolf3D Opl Initializer file).
I have done some improvements (such as using a separate buffer for sound and music) but it has only had modest performance gains.
Setting the sample rate to 44010 does improve things, but makes the music playback at a tempo which is far too high, and gives most sound effects "helium" like sounds.
The main problem is the Music. The sound effects seem to play back ok, but don't play the full sample. They play around half (at what seams the middle to end) , never the full sample.
The music plays back poorly. There seems to be a sample that always gets played at the wrong time or in the wrong thread. It also crackles too. The menu suffers from the worst crackling, and in-game is poor too. (unbearable with headphones).
So that is all the information that I have to give you, most of it is based on my naive assumptions and may be totally incorrect. I hope it helps you see what is wrong, so you can hopefully give me a clue how to go about fixing it.
I have pasted the code below and have put it in a zip file (below) too for ease of view.
Thanks so much for any help, and of course anyone who helps will be credited for it on my next release.
(if you need more code just ask, I will happily upload more if required)
Had to use rafb.net (aka nopaste) to submit the code because the message exceeded the character limit with it in the post.
sd_sdl.c
http://rafb.net/p/Mtpjnx47.html
fmopl.c
http://rafb.net/p/YXIfze15.html
Code in a zip file : HERE
My experience with sound emulation is very low, and I am hoping one of you can give me some pointers as to what is wrong.
Basically what this is used in is my Wolfenstein 3D port.
I presumed for a long time that the issue lay in the fmopl.c, (opl emulator implementation). So I ported the latest version from mame to Wolf, and it made no difference.
So I am convinced that the issue lies in sd_sdl.c (Wolf3D Opl Initializer file).
I have done some improvements (such as using a separate buffer for sound and music) but it has only had modest performance gains.
Setting the sample rate to 44010 does improve things, but makes the music playback at a tempo which is far too high, and gives most sound effects "helium" like sounds.
The main problem is the Music. The sound effects seem to play back ok, but don't play the full sample. They play around half (at what seams the middle to end) , never the full sample.
The music plays back poorly. There seems to be a sample that always gets played at the wrong time or in the wrong thread. It also crackles too. The menu suffers from the worst crackling, and in-game is poor too. (unbearable with headphones).
So that is all the information that I have to give you, most of it is based on my naive assumptions and may be totally incorrect. I hope it helps you see what is wrong, so you can hopefully give me a clue how to go about fixing it.
I have pasted the code below and have put it in a zip file (below) too for ease of view.
Thanks so much for any help, and of course anyone who helps will be credited for it on my next release.
(if you need more code just ask, I will happily upload more if required)
Had to use rafb.net (aka nopaste) to submit the code because the message exceeded the character limit with it in the post.
sd_sdl.c
http://rafb.net/p/Mtpjnx47.html
fmopl.c
http://rafb.net/p/YXIfze15.html
Code in a zip file : HERE