]> git.alsa-project.org Git - alsa-oss.git/commitdiff
Set format to S16_LE, fixed trigger
authorJaroslav Kysela <perex@perex.cz>
Thu, 26 Feb 2004 15:34:50 +0000 (15:34 +0000)
committerJaroslav Kysela <perex@perex.cz>
Thu, 26 Feb 2004 15:34:50 +0000 (15:34 +0000)
test/osstest.c

index 7a980b1ff94b1124c633ed1a523322a20377718f..56bedcceaa6eee80a5f0772acbf5a3dbd340b42f 100644 (file)
@@ -14,6 +14,7 @@
 //static char data[500000];
 static int verbose;
 static char *device = "/dev/dsp";
+static int format = AFMT_S16_LE;
 static int rate = 48000;
 static int channels = 2;
 static int omode = O_RDWR;
@@ -47,6 +48,12 @@ static void set_params(int do_mmap)
 {
        int caps;
 
+       if (oss_pcm_ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0) {
+               perror("SNDCTL_DSP_SETFMT\n");
+               exit(EXIT_FAILURE);
+       }
+       printf("Format set to %d\n", format);
+
        if (oss_pcm_ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0) {
                perror("SNDCTL_DSP_SPEED\n");
                exit(EXIT_FAILURE);
@@ -127,6 +134,7 @@ static void set_trigger(void)
 {
        int tmp;
 
+       tmp = 0;
        if (oss_pcm_ioctl(fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0) {
                perror("SNDCTL_DSP_SETTRIGGER");
                exit(EXIT_FAILURE);