linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: ALSA + mmap or OSS emulation + mmap producing stutering sound
@ 2003-03-18 14:34 dean .
  0 siblings, 0 replies; 4+ messages in thread
From: dean . @ 2003-03-18 14:34 UTC (permalink / raw)
  To: linux-kernel

>>>This is due to a broken ALSA update patch for the cs46xx code.  Apply
>>>the included patch which unbreaks the update.
>>>
>>>David
>>>
>
>>>dean . wrote:
>
>This does not seem to be the case. The problems described below are
>replicable in 2.5.64-mm8 which has the suggested patch applied.
>
>Luuk
>
>
>
>
>>Kernel versions 2.5.61-64 (Havnt tried 60) produce stuttering sound
>>when using alsa and mmap (xmms alsa output plugin) or oss emu and mmap
>>(quake3?) produce stuttering sound happening after around the first
>>half second of playing. This is with the kernels alsa cs46xx module
>>and a Turtle beach Santa Cruz soundcard. Works fine with 2.5.59 though.

I had the same result here, the patch didnt help the stuttering

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ALSA + mmap or OSS emulation + mmap producing stutering sound
@ 2003-03-17 12:32 Luuk van der Duim
  0 siblings, 0 replies; 4+ messages in thread
From: Luuk van der Duim @ 2003-03-17 12:32 UTC (permalink / raw)
  To: linux-kernel

>> This is due to a broken ALSA update patch for the cs46xx code.  Apply
>> the included patch which unbreaks the update.
>>
>> David
>>

>>dean . wrote:

This does not seem to be the case. The problems described below are 
replicable in 2.5.64-mm8 which has the suggested patch applied.

Luuk


 

> Kernel versions 2.5.61-64 (Havnt tried 60) produce stuttering sound 
> when using alsa and mmap (xmms alsa output plugin) or oss emu and mmap 
> (quake3?) produce stuttering sound happening after around the first 
> half second of playing. This is with the kernels alsa cs46xx module 
> and a Turtle beach Santa Cruz soundcard. Works fine with 2.5.59 though.


diff -Nru a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
--- a/sound/pci/cs46xx/cs46xx_lib.c	Mon Feb 17 14:57:26 2003
+++ b/sound/pci/cs46xx/cs46xx_lib.c	Mon Feb 17 14:57:26 2003
@@ -677,6 +677,7 @@
 {
 	/* cs46xx_t *chip = snd_pcm_substream_chip(substream); */
 	snd_pcm_runtime_t *runtime = substream->runtime;
+	snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
 	snd_pcm_sframes_t diff;
 	cs46xx_pcm_t * cpcm;
 	int buffer_size;
@@ -685,14 +686,14 @@
 
 	buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift;
 
-	diff = runtime->control->appl_ptr - cpcm->appl_ptr;
+	diff = appl_ptr - cpcm->appl_ptr;
 	if (diff) {
 		if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
 			diff += runtime->boundary;
-		cpcm->sw_ready += diff << cpcm->shift;
+		frames += diff;
 	}
 	cpcm->sw_ready += frames << cpcm->shift;
-	cpcm->appl_ptr = runtime->control->appl_ptr + frames;
+	cpcm->appl_ptr = appl_ptr + frames;
 	while (cpcm->hw_ready < buffer_size && 
 	       cpcm->sw_ready > 0) {
 		size_t hw_to_end = buffer_size - cpcm->hw_data;
@@ -724,15 +725,16 @@
 {
 	cs46xx_t *chip = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
-	snd_pcm_sframes_t diff = runtime->control->appl_ptr - chip->capt.appl_ptr;
+	snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
+	snd_pcm_sframes_t diff = appl_ptr - chip->capt.appl_ptr;
 	int buffer_size = runtime->period_size * CS46XX_FRAGS << chip->capt.shift;
 	if (diff) {
 		if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
 			diff += runtime->boundary;
-		chip->capt.sw_ready -= diff << chip->capt.shift;
+		frames += diff;
 	}
 	chip->capt.sw_ready -= frames << chip->capt.shift;
-	chip->capt.appl_ptr = runtime->control->appl_ptr + frames;
+	chip->capt.appl_ptr = appl_ptr + frames;
 	while (chip->capt.hw_ready > 0 && 
 	       chip->capt.sw_ready < (int)chip->capt.sw_bufsize) {
 		size_t hw_to_end = buffer_size - chip->capt.hw_data;



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ALSA + mmap or OSS emulation + mmap producing stutering sound
  2003-03-15  5:52 dean .
@ 2003-03-16  0:10 ` David Ford
  0 siblings, 0 replies; 4+ messages in thread
From: David Ford @ 2003-03-16  0:10 UTC (permalink / raw)
  To: dean .; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

This is due to a broken ALSA update patch for the cs46xx code.  Apply 
the included patch which unbreaks the update.

David

dean . wrote:

> Kernel versions 2.5.61-64 (Havnt tried 60) produce stuttering sound 
> when using alsa and mmap (xmms alsa output plugin) or oss emu and mmap 
> (quake3?) produce stuttering sound happening after around the first 
> half second of playing. This is with the kernels alsa cs46xx module 
> and a Turtle beach Santa Cruz soundcard. Works fine with 2.5.59 though.


[-- Attachment #2: cs46.patch --]
[-- Type: text/plain, Size: 1965 bytes --]

diff -Nru a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
--- a/sound/pci/cs46xx/cs46xx_lib.c	Mon Feb 17 14:57:26 2003
+++ b/sound/pci/cs46xx/cs46xx_lib.c	Mon Feb 17 14:57:26 2003
@@ -677,6 +677,7 @@
 {
 	/* cs46xx_t *chip = snd_pcm_substream_chip(substream); */
 	snd_pcm_runtime_t *runtime = substream->runtime;
+	snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
 	snd_pcm_sframes_t diff;
 	cs46xx_pcm_t * cpcm;
 	int buffer_size;
@@ -685,14 +686,14 @@
 
 	buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift;
 
-	diff = runtime->control->appl_ptr - cpcm->appl_ptr;
+	diff = appl_ptr - cpcm->appl_ptr;
 	if (diff) {
 		if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
 			diff += runtime->boundary;
-		cpcm->sw_ready += diff << cpcm->shift;
+		frames += diff;
 	}
 	cpcm->sw_ready += frames << cpcm->shift;
-	cpcm->appl_ptr = runtime->control->appl_ptr + frames;
+	cpcm->appl_ptr = appl_ptr + frames;
 	while (cpcm->hw_ready < buffer_size && 
 	       cpcm->sw_ready > 0) {
 		size_t hw_to_end = buffer_size - cpcm->hw_data;
@@ -724,15 +725,16 @@
 {
 	cs46xx_t *chip = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
-	snd_pcm_sframes_t diff = runtime->control->appl_ptr - chip->capt.appl_ptr;
+	snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
+	snd_pcm_sframes_t diff = appl_ptr - chip->capt.appl_ptr;
 	int buffer_size = runtime->period_size * CS46XX_FRAGS << chip->capt.shift;
 	if (diff) {
 		if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))
 			diff += runtime->boundary;
-		chip->capt.sw_ready -= diff << chip->capt.shift;
+		frames += diff;
 	}
 	chip->capt.sw_ready -= frames << chip->capt.shift;
-	chip->capt.appl_ptr = runtime->control->appl_ptr + frames;
+	chip->capt.appl_ptr = appl_ptr + frames;
 	while (chip->capt.hw_ready > 0 && 
 	       chip->capt.sw_ready < (int)chip->capt.sw_bufsize) {
 		size_t hw_to_end = buffer_size - chip->capt.hw_data;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* ALSA + mmap or OSS emulation + mmap producing stutering sound
@ 2003-03-15  5:52 dean .
  2003-03-16  0:10 ` David Ford
  0 siblings, 1 reply; 4+ messages in thread
From: dean . @ 2003-03-15  5:52 UTC (permalink / raw)
  To: linux-kernel

Kernel versions 2.5.61-64 (Havnt tried 60) produce stuttering sound when 
using alsa and mmap (xmms alsa output plugin) or oss emu and mmap (quake3?) 
produce stuttering sound happening after around the first half second of 
playing. This is with the kernels alsa cs46xx module and a Turtle beach 
Santa Cruz soundcard. Works fine with 2.5.59 though.

_________________________________________________________________



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-18 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 14:34 ALSA + mmap or OSS emulation + mmap producing stutering sound dean .
  -- strict thread matches above, loose matches on Subject: below --
2003-03-17 12:32 Luuk van der Duim
2003-03-15  5:52 dean .
2003-03-16  0:10 ` David Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).