+ // memory map the dma buffer
+ shm->bufferlength = info.fragstotal * info.fragsize;
+ shm->buffer = (unsigned char *) mmap(NULL, shm->bufferlength, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
+ if (!shm->buffer || shm->buffer == (unsigned char *)-1)
+ {
+ perror("/dev/dsp");
+ Con_Print("Could not mmap /dev/dsp\n");
+ close(audio_fd);
+ return 0;
+ }
+
+ // toggle the trigger & start her up
+ tmp = 0;
+ rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);