Page 1 of 3

[FIXED]Sound issues

Posted: Tue Aug 26, 2008 7:52 am
by spacy51

1) Disabling/muting seperate channels does not work for GB and GBA

soundEnableFlag seems to be accurately filled with the binary switches for every channel (1111 means all 4 GB channels on), but the audio core probably just ignores it's value or something like that.

 

 

2) Enabling echo from the menu has no effect

I discovered a strange part of code:

 

void gbSoundTick()
{

Code: Select all

if ( systemSoundOn && gb_apu && stereo_buffer )


{


	// Run sound hardware to present


	end_frame( SOUND_CLOCK_TICKS * ticks_to_time );

 

Code: Select all

	flush_samples();

 

gb_effects_config.enabled = soundEcho;

Code: Select all

	// Update effects config if it was changed


	if ( memcmp( &gb_effects_config_current, &gb_effects_config,


			sizeof gb_effects_config ) )


		apply_effects();


}

}

 

When echo is enabled, the effects get enabled, but since they are at their default values, you can hear no difference. Should I just remove that line, since i'll add the effects config anyway?

 

UPDATE: I just noticed that everything in gb_effects_config is disabled until soundEcho is enabled. The correct behaviour would be to let gb_effects_config.enabled decide.

IMO soundEcho should be removed because it's already in gb_effects_config.echo

 

 

 

 

3) When including gbSound.h additionally to Sound.h (I have to do that for config in MainWnd), I get macro redefinition warnings about these:

Code: Select all

#define NR10 0xff10
#define NR11 0xff11
#define NR12 0xff12
#define NR13 0xff13
#define NR14 0xff14
#define NR21 0xff16
#define NR22 0xff17
#define NR23 0xff18
#define NR24 0xff19
#define NR30 0xff1a
#define NR31 0xff1b
#define NR32 0xff1c
#define NR33 0xff1d
#define NR34 0xff1e
#define NR41 0xff20
#define NR42 0xff21
#define NR43 0xff22
#define NR44 0xff23
#define NR50 0xff24
#define NR51 0xff25
#define NR52 0xff26

 

 

4) Are the initial values of gb_effects_config correct?

Code: Select all

void gbSoundReset()
{
gb_effects_config.echo     = 0.20f;
gb_effects_config.stereo   = 0.15f;
gb_effects_config.surround = false;
[...]

 

Is there a specific reason echo is not 0.0f and stereo is not 1.0f by default?

I'll add these to the save/load ini functions later, so the new default values will be assigned by "void loadSettings()".

 

 

5) I'm not sure what the surround option so good for. When I enable the Dolby Pro Logic IIx decoder of my ASUS Xonar DX sound card, there is no change, meaning sound still comes only from Front Left/Right. What is the intended difference to an stereo-to-surround upmixing matrix like the ones I use in the XAudio2 output or like ffdshow uses it?

 

 

 

 

Here's a link to the latest build of SVN634 including zlib 1.2.3 + libpng 1.2.31. It has all the problems described above.

http://vba-m.com/vbam/vbacompiles/msvc2008/VisualBoyAdvance634.7z


[FIXED]Sound issues

Posted: Tue Aug 26, 2008 11:26 pm
by slacker

it would be great to have a proper volume control too the current one isn't very good

it only has like 3 or so settings and they all sound the same to me something like 0 - 100pct volume would be nice


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 1:42 am
by slacker

Nice ill definitely have to recompile soon then. this is definitively my favorite GBA emulator its good to see its getting better and i love to check/mess around with the code too

 

EDIT: SDL builds are definitely broken im seeing if i can fix them now. if i get it working ill post a patch so whoever is doing them doesn't have to do as much


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 6:52 am
by slacker

i am just doing it for fun anyway. if i get anywhere ill post a patch and it'll make the sdl maintainers life easier if not doesn't matter. i commented out most of the old sound hardware and am changing it as i go volume control works much better [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" width="20" height="20" />


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 7:55 am
by spacy51

@slacker:

Whatever does not compile, just have a look at Sound.h and it should become clear what changed and what has to be done.


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 8:35 am
by bgK

Just fixed the GTK port with the sound API changes. Less global vars, yeah !

 

slacker : I'd be happy to review and commit your SDL patch when it's done.


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 9:00 am
by slacker

here's the patch i came up with. it works its like midnight now so im not doing much more on it for a while.

 

it removes 2 settings that looks like they don't exist now (couldn't find them)

volume controls work well i set a limit between 1.0f - 100.0f you would prob wanna lower that and clean it up but they work well in GBA couldnt tell with GB.

mute works with both ones now ( YAY ) moves lirc functions up a bit so they can access the savegame and loadgame functions

 

anyway it works and compiles should help when whoever is ready to add sdl sound fixes to svn. (I had fun)

 

you will wanna clean it all up its late here so i am done for today.

 

i didn't touch savegames and sound although i saw a function to load sound back.

 

you should enable posting .patch files as attachments


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 9:14 am
by bgK

Thanks for the patch.

However it won't build with LIRC support because it defines twice the lircCheckInput function. Which one should be kept ? Can you provide an updated patch ?


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 10:39 am
by slacker

sorry posted an old patch it was in a folder below the real patch

 

this one removes the old one.


[FIXED]Sound issues

Posted: Wed Aug 27, 2008 11:16 am
by bgK

Thanks, I partially applied your patch, however :

  • I disabled changing the volume using F1 and F2 because it interferes with savestate shortcuts
  • Loading/Saving the volume from/to the config file could use some improvement since as it is stored as an integer, values below 100% can't be used.