X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fgp2x.c;h=7a5156c78f22f35be68b562977337d1e4b85802a;hb=dd69833d4575ffe3b332f2632f1552da06d13605;hp=3ed64fb35af18c4fc1ae72cf1c446139682d5b4d;hpb=6245d5a03dba96b93c7cc0a247d17ff3d9e08325;p=libpicofe.git diff --git a/gp2x/gp2x.c b/gp2x/gp2x.c index 3ed64fb..7a5156c 100644 --- a/gp2x/gp2x.c +++ b/gp2x/gp2x.c @@ -232,8 +232,8 @@ void gp2x_start_sound(int rate, int bits, int stereo) if (sounddev == -1) printf("open(\"/dev/dsp\") failed with %i\n", errno); - ioctl(sounddev, SNDCTL_DSP_SPEED, &rate); ioctl(sounddev, SNDCTL_DSP_SETFMT, &bits); + ioctl(sounddev, SNDCTL_DSP_SPEED, &rate); ioctl(sounddev, SNDCTL_DSP_STEREO, &stereo); // calculate buffer size buffers = 16; @@ -242,11 +242,12 @@ void gp2x_start_sound(int rate, int bits, int stereo) while ((bsize>>=1)) frag++; frag |= buffers<<16; // 16 buffers ioctl(sounddev, SNDCTL_DSP_SETFRAGMENT, &frag); + usleep(192*1024); + printf("gp2x_set_sound: %i/%ibit/%s, %i buffers of %i bytes\n", rate, bits, stereo?"stereo":"mono", frag>>16, 1<<(frag&0xffff)); s_oldrate = rate; s_oldbits = bits; s_oldstereo = stereo; - usleep(100000); }