The playback of mono audio with emu10k1 causes distortion. When the same sound is played back using 2 channels, the problem disappears. It seems that samples are multiplied by 2 during mono playback. Fix: Not known. How-To-Repeat: #include <sys/soundcard.h> #include <fcntl.h> #include <unistd.h> int main(int argc, char **argv) { int fd, format, channels, rate, i; /* 450 Hz sine wave on both channels */ unsigned char samples2[] = { 0, 0, 0, 0, 94, 16, 94, 16, 120, 32, 120, 32, 9, 48, 9, 48, 208, 62, 208, 62, 143, 76, 143, 76, 12, 89, 12, 89, 19, 100, 19, 100, 117, 109, 117, 109, 11, 117, 11, 117, 182, 122, 182, 122, 92, 126, 92, 126, 239, 127, 239, 127, 105, 127, 105, 127, 202, 124, 202, 124, 32, 120, 32, 120, 124, 113, 124, 113, 251, 104, 251, 104, 193, 94, 193, 94, 249, 82, 249, 82, 212, 69, 212, 69, 138, 55, 138, 55, 85, 40, 85, 40, 120, 24, 120, 24, 51, 8, 51, 8, 205, 247, 205, 247, 136, 231, 136, 231, 171, 215, 171, 215, 118, 200, 118, 200, 44, 186, 44, 186, 7, 173, 7, 173, 63, 161, 63, 161, 5, 151, 5, 151, 132, 142, 132, 142, 224, 135, 224, 135, 54, 131, 54, 131, 151, 128, 151, 128, 17, 128, 17, 128, 164, 129, 164, 129, 74, 133, 74, 133, 245, 138, 245, 138, 139, 146, 139, 146, 237, 155, 237, 155, 244, 166, 244, 166, 113, 179, 113, 179, 48, 193, 48, 193, 247, 207, 247, 207, 136, 223, 136, 223, 162, 239, 162, 239}; /* 450 Hz sine wave */ unsigned char samples1[] = { 0, 0, 94, 16, 120, 32, 9, 48, 208, 62, 143, 76, 12, 89, 19, 100, 117, 109, 11, 117, 182, 122, 92, 126, 239, 127, 105, 127, 202, 124, 32, 120, 124, 113, 251, 104, 193, 94, 249, 82, 212, 69, 138, 55, 85, 40, 120, 24, 51, 8, 205, 247, 136, 231, 171, 215, 118, 200, 44, 186, 7, 173, 63, 161, 5, 151, 132, 142, 224, 135, 54, 131, 151, 128, 17, 128, 164, 129, 74, 133, 245, 138, 139, 146, 237, 155, 244, 166, 113, 179, 48, 193, 247, 207, 136, 223, 162, 239}; fd = open("/dev/dsp", O_WRONLY); format = AFMT_S16_LE; channels = 2; rate = 22050; ioctl(fd, SNDCTL_DSP_SETFMT,&format); ioctl(fd, SNDCTL_DSP_CHANNELS,&channels); ioctl(fd, SNDCTL_DSP_SPEED,&rate); for(i=0;i<500;i++) write(fd, &samples2, sizeof(samples2)); /* not distorted */ close(fd); sleep(1); fd = open("/dev/dsp", O_WRONLY); format = AFMT_S16_LE; channels = 1; rate = 22050; ioctl(fd, SNDCTL_DSP_SETFMT,&format); ioctl(fd, SNDCTL_DSP_CHANNELS,&channels); ioctl(fd, SNDCTL_DSP_SPEED,&rate); for(i=0;i<500;i++) write(fd, &samples1, sizeof(samples1)); /* distorted */ return 0; }
Responsible Changed From-To: freebsd-bugs->freebsd-multimedia Over to maintainer(s).