GP2X Setting Master Volume On Gp2x


md81544

Still Fresh
Joined
Nov 25, 2006
Messages
14
Location
London, UK
Website
Visit site
I need help setting the master volume on the GP2X.

I'm not referring to using SDL to set mix volume, I'm talking about the entire master volume of the GP2X.

The reason I ask is because, with headphones on, when I boot my GP2X, when it gets to the green 2.1.1 firmware screen, there's a noticeable background hiss which sounds like the master volume's been turned up to max.

If I immediately play, say, Vektar in this state, my eardrums will likely start bleeding. Also the volume adjustment steps are very wide (and yes, I do have volume limit setting on). However, if I go into the default music player and start to play one track, the background hiss disappears: it appears that music player resets the master volume to a more sensible level. Playing Vektar AFTER doing this is a much more pleasant experience!

Does anyone else have this experience? It seems to have started behaving like this after the 2.1.1 firmware update, but it may be because of the util I ran to remove the annoying boot jingle :blink:

So: my question. How does one set the master volume? I've done quite a bit of poking around, and was digging into various sources, but can't see any references, and can't figure it out. Ideally I'd like to create a tiny .gpu which I could call via a shell script on boot.

Any advice greatly appreciated - many thanks!

-Martyn
 
I'd like to add to this, i found i could control the systems volume using the Music player but i think that the software should leave the system volume to the user to decide and have another "device" that applications can take advantage of.
 
You need to do something like this (well, it's what I do, based on rlyeh's example from a while ago):

Code:
void gp2x_set_volume(int leftVolume, int rightVolume)
{
	unsigned long soundDev = open("/dev/mixer", O_RDWR);
	if (soundDev)
	{
		int vol =(((leftVolume*0x50)/100)<<8)|((rightVolume*0x50)/100);
		ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol);
		close(soundDev);
	}
}
 
Wait, so is it possible to change the volume of the sound the GP2x outputs at, globally?
If so, can someone release a simple app (commandline or GUI, I do not really care) that allows me to increase/decrease the master volume? That'd be neat, since currently my GP2x seems to be way too loud for me... :p
 
Wait, so is it possible to change the volume of the sound the GP2x outputs at, globally?
If so, can someone release a simple app (commandline or GUI, I do not really care) that allows me to increase/decrease the master volume? That'd be neat, since currently my GP2x seems to be way too loud for me... :p

Yep, thanks to Critical's info above I knocked it up this evening.

As it stands it's a .gpu file which I've chained into the startup process so automatically turns the volume down when the thing boots, but I could make it so you could call it manually if you want.

I'll put together a small "how to" and link to it together with the relevant binaries in the next day or so. Watch this space.
 
Last edited by a moderator:
Last edited by a moderator:
Back
Top