Re: sb16 duplex and quake

Andrea Arcangeli (andrea@e-mind.com)
Sun, 25 Oct 1998 19:38:26 +0100 (CET)


On Tue, 20 Oct 1998, Daniel J. Rodriksson wrote:

>Found the problem
>
>Quake is opening the device for both read and write
>( maybe a conference amongst the participants was in mind ? )

This trivial fullduplex proggy that was working fine with my sb-duplex
patch doesn' t work with your one (and so with 126):

#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/soundcard.h>

#define BUFSIZE 1024
void main(void)
{
int format = AFMT_S16_LE;
/* int speed = 8000;*/
char buf[BUFSIZE];
int fds[2];
int dsp = open("/dev/dsp",O_RDWR);
if (ioctl(dsp, SNDCTL_DSP_SETFMT, &format)==-1) {
perror("SNDCTL_DSP_SETFMT\n");
exit(1);
}
/* if (ioctl(dsp, SNDCTL_DSP_SPEED, &speed)==-1) {
perror("SNDCTL_DSP_SPEED\n");
exit(1);
}*/
pipe(fds);
if(fork())
for (;;) {
read(dsp,buf,BUFSIZE);
write(fds[1],buf,BUFSIZE);
}
else
for (;;) {
read(fds[0],buf,BUFSIZE);
write(dsp,buf,BUFSIZE);
}
}

While it _not_ works I get many:

Oct 25 19:20:55 dragon kernel: Sound: DMA (input) timed out - IRQ/DRQ config error?

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/