A sound test program which fails

Post Reply
Dwedit
Junior Member
Posts: 19
Joined: Tue Mar 18, 2008 9:06 pm

A sound test program which fails

Post by Dwedit »

This is a program that plays stuff through the sound channels, then uses the GBA timers to calculate exact times for the waveform to be okay before starting a new sound at a lower volume.

It sounds significantly different on hardware compared to VBA-M.

The sound played is just repeating E notes, but it waits for the exact timing necessary to begin another note with no impact from the "reset" bit.

On hardware it sounds smooth. On VBA-M, it sounds clicky/noisy/metalic.

 

Code: Select all


//get_wavelength(4);
void test2()
{
REG_IME=0;

REG_TM2CNT_H=0;
REG_TM2CNT_L=0;
REG_TM2CNT_H=0xC1;   //256KiHz timer

REG_SOUNDCNT_X=0x80;
REG_SOUNDCNT_L=0xFF77;

int period = 0x673; //E-note after middle C
int target_time;
int last_time=0;
int num_tones=6;
int volume=15;
int real_period=2048-period;

do
{
	target_time=last_time+real_period*2*num_tones;
	target_time&=0xFFFF;
	while (1)
	{
		if (REG_TM2CNT_L==target_time-1)
		{
			break;
		}
	}
	REG_SOUND1CNT_H = 0x80 + (volume<<12);
	REG_SOUND1CNT_X = 0x8000 + period;
	last_time=target_time;
	volume--;
	if (volume==0) volume=15;
} while (1);
}
Last edited by Dwedit on Fri Apr 18, 2008 1:38 pm, edited 1 time in total.
mudlord
Senior Member
Posts: 306
Joined: Sun Feb 08, 2009 7:16 am

A sound test program which fails

Post by mudlord »

Thanks.

 

Any chance of a recording of the original sound and how VBA-M sounds?

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

A sound test program which fails

Post by Squall Leonhart »

ah, so where would the fault lie.... the sound core, or the output itself...

Dwedit
Junior Member
Posts: 19
Joined: Tue Mar 18, 2008 9:06 pm

A sound test program which fails

Post by Dwedit »

This is in the sound core.

Sorry about some misinformation, it is not completely smooth on a GBA.

 

The wave is normally 134 samples wide.

There is a 'bad wave' which is 26 samples longer every 1468 samples on VBA-M. The bad wave sounds like a pop. You get a pop about 30 times a second.

The bad wave (26 samples longer) occurs every 5638 samples on hardware, so it's less noticable. The pop appears 7.8 times a second.

 

I've attached the test program, VBA-M's wav output, and a bad recording of what hardware produces. WAV files don't compress well, so it's 900k.[attachment=23]

Last edited by Dwedit on Sat Apr 19, 2008 1:45 am, edited 1 time in total.
Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

A sound test program which fails

Post by Squall Leonhart »

ah, ok, well i've been having somewhat a feeling that the gba sound core wasn't correct.. i've noticed some strange squeaking at certain points in a few games, i just thought it was my single core cpu....

mudlord
Senior Member
Posts: 306
Joined: Sun Feb 08, 2009 7:16 am

A sound test program which fails

Post by mudlord »

Well, in that case, please let us know squall so Nach, Jonas, Spacy or I can have a look at them.

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

A sound test program which fails

Post by Squall Leonhart »

it was most noticeble in Super Robot Taisen - Original Generation 1 and 2

Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

A sound test program which fails

Post by Squall Leonhart »

I've been noticing this white noise when playing GBA games, its only audible when you come to a point where no bgm or sound is playing, and it sounds a wave thats eternally moving in, but not going back out.

 

Its not audible in DMG or CGB games.

 

related at all Dwedit?

 

a better description would be scratching to pieces of metal together, albeit very slowly,

Last edited by Squall Leonhart on Sun Jul 13, 2008 4:16 am, edited 1 time in total.
spacy51
Senior Member
Posts: 371
Joined: Tue Mar 18, 2008 4:59 pm

A sound test program which fails

Post by spacy51 »

Here's a more or less clean recording from my NDS using my new ASUS Xonar DX sound card ^^

(NDS headphone jack to sound card line in, 48 kHz recording)

Last edited by spacy51 on Sat Jul 12, 2008 5:42 am, edited 1 time in total.
Squall Leonhart
Posting Freak
Posts: 1223
Joined: Tue Mar 18, 2008 9:21 am

A sound test program which fails

Post by Squall Leonhart »

This will likely be fixed when Blargg rewrites the audio core.

Post Reply