[FIXED]Sound issues

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

[FIXED]Sound issues

Post 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

Last edited by spacy51 on Thu Jan 22, 2009 5:27 am, edited 1 time in total.
slacker
Junior Member
Posts: 22
Joined: Wed Jul 09, 2008 5:31 am

[FIXED]Sound issues

Post 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

slacker
Junior Member
Posts: 22
Joined: Wed Jul 09, 2008 5:31 am

[FIXED]Sound issues

Post 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

Last edited by slacker on Wed Aug 27, 2008 1:52 am, edited 1 time in total.
slacker
Junior Member
Posts: 22
Joined: Wed Jul 09, 2008 5:31 am

[FIXED]Sound issues

Post 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/[email protected] 2x" width="20" height="20" />

spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

[FIXED]Sound issues

Post 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.

bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

[FIXED]Sound issues

Post 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.

slacker
Junior Member
Posts: 22
Joined: Wed Jul 09, 2008 5:31 am

[FIXED]Sound issues

Post 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

bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

[FIXED]Sound issues

Post 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 ?

slacker
Junior Member
Posts: 22
Joined: Wed Jul 09, 2008 5:31 am

[FIXED]Sound issues

Post by slacker »

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

Â

this one removes the old one.

bgK
Member
Posts: 88
Joined: Thu Apr 17, 2008 3:58 pm

[FIXED]Sound issues

Post 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.
Post Reply