Setting Volume Via /dev/mixer


JoJo_ReloadeD

Still Fresh
Joined
Nov 18, 2007
Messages
19
I'm stuck with this code, there's no way of get a higher volume, still very low when volume = 100

Code:
        unsigned long soundDev = open("/dev/mixer", O_RDWR);
        if(soundDev)
        {
                int vol = ((volume << 8) | volume);
                //ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol);
                ioctl(soundDev, MIXER_WRITE(SOUND_MIXER_VOLUME), &vol);
                ioctl(soundDev, MIXER_WRITE(SOUND_MIXER_PCM), &vol);
                ioctl(soundDev, MIXER_WRITE(SOUND_MIXER_OGAIN), &vol);

                close(soundDev);
        }

Any ideas ?
 
Heres what i use:

Code:
        unsigned long soundDev = open("/dev/mixer", O_RDWR);
        if(soundDev)
        {
            int vol = ((volume << 8) | volume);
            ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol);
            close(soundDev);
        }

I limit at 100
 
100 is the max for /dev/mixer on the GP2X (OSS3 sound driver) so I'd assume it's the same for the Wiz.

SDL on the GP2X usually doesn't control /dev/mixer directly and has its own internal volume level. Try adjusting it instead maybe?
 
Pickle said:
Heres what i use:

Code:
        unsigned long soundDev = open("/dev/mixer", O_RDWR);
        if(soundDev)
        {
            int vol = ((volume << 8) | volume);
            ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol);
            close(soundDev);
        }

I limit at 100

That's it, it's your code, got from lemonboy :)

Any ideas to make it sound louder?
 
Last edited by a moderator:
Back
Top