X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fgp2x.c;h=7a5156c78f22f35be68b562977337d1e4b85802a;hb=0480e6c9696e4d4cbd451a91a7ef63d96f60542d;hp=3ed64fb35af18c4fc1ae72cf1c446139682d5b4d;hpb=91b2c3e133f883a1674b7acd7702c225f568bfa3;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); }