diff -r bf8d84bb62bc pci/rme9652/hdsp.c --- a/pci/rme9652/hdsp.c Tue Feb 19 16:13:03 2008 +0100 +++ b/pci/rme9652/hdsp.c Wed Feb 20 19:33:57 2008 +0100 @@ -643,6 +643,35 @@ static void hdsp_write(struct hdsp *hdsp static unsigned int hdsp_read(struct hdsp *hdsp, int reg) { + /* Big dirty hack. + * On some archs (Intel DG33BU), when 9632 has got AI4S and(?) AO4S and + * some non-null signal is sent to channels 1&3 or channels 2&4 of AO4S + * (yes, strange conditions!), for some mysterious reason, the whole + * card io space is from time to time read as 0xffffffff. This bad read + * happens only once (from my experience), and next bad reading is + * "several" reads after. Allowing 10 bad reads is more than enough. By + * chance, 0xffffffff is not possible as a status and status2 read (the + * most sensitive registers for PCM) and RME 9632. + * This behavior has been checked by writing samples directly to mmaped + * memory (at playback buffer address) and reading io space the same + * way, so bypassing all alsa stuff. + * Anyay, in all cases, we can wait reading something else than + * 0xffffffff, and if we read 10 consecutive times 0xffffffff, we + * consider this is the true value + */ + if (hdsp->io_type == H9632) + { + unsigned int val; + int count = 10; + + while (count-- > 0) + { + val = readl(hdsp->iobase + reg); + if (val != 0xffffffff) + break; + } + return val; + } return readl (hdsp->iobase + reg); } @@ -3298,8 +3327,10 @@ snd_hdsp_proc_read(struct snd_info_entry status2 = hdsp_read(hdsp, HDSP_status2Register); snd_iprintf(buffer, "%s (Card #%d)\n", hdsp->card_name, hdsp->card->number + 1); - snd_iprintf(buffer, "Buffers: capture %p playback %p\n", - hdsp->capture_buffer, hdsp->playback_buffer); + snd_iprintf(buffer, "Buffers: capture %p playback %p (physical %p %p)\n", + hdsp->capture_buffer, hdsp->playback_buffer, + ALIGN(hdsp->capture_dma_buf.addr, 0x10000ul), + ALIGN(hdsp->playback_dma_buf.addr, 0x10000ul)); snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", hdsp->irq, hdsp->port, (unsigned long)hdsp->iobase); snd_iprintf(buffer, "Control register: 0x%x\n", hdsp->control_register);