aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652/hdspm.c
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2011-02-23 05:43:09 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-23 09:42:28 -0500
commit483cee77d2be6c22ef67ac8c6711e757d138a538 (patch)
treeb9fc379a7642a9a0627c6c7c2ce7570b05ec94ca /sound/pci/rme9652/hdspm.c
parent432d2500ac11ca88532e08716813b189a27f74a9 (diff)
ALSA: hdspm - Fix buffer handling on RME MADI/MADIface/AES(32)
Only RayDAT and AIO provide sane buffer pointers that can be used with HDSPM_BufferPositionMask, on all other cards, this would result in a wrong HW pointer leading to xruns and these messages: [260808.916788] BUG: pcmC0D0p:0, pos = 2976, buffer size = 1024, period size = 512 [260808.961124] BUG: pcmC0D0c:0, pos = 4944, buffer size = 1024, period size = 512 Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r--sound/pci/rme9652/hdspm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 92588975f580..509a35a881f5 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -1231,8 +1231,17 @@ static snd_pcm_uframes_t hdspm_hw_pointer(struct hdspm *hdspm)
1231 int position; 1231 int position;
1232 1232
1233 position = hdspm_read(hdspm, HDSPM_statusRegister); 1233 position = hdspm_read(hdspm, HDSPM_statusRegister);
1234 position &= HDSPM_BufferPositionMask; 1234
1235 position /= 4; /* Bytes per sample */ 1235 switch (hdspm->io_type) {
1236 case RayDAT:
1237 case AIO:
1238 position &= HDSPM_BufferPositionMask;
1239 position /= 4; /* Bytes per sample */
1240 break;
1241 default:
1242 position = (position & HDSPM_BufferID) ?
1243 (hdspm->period_bytes / 4) : 0;
1244 }
1236 1245
1237 return position; 1246 return position;
1238} 1247}