All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] buffersize and constraints on pmac
@ 2004-12-15 20:31 danny
  2004-12-15 21:23 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: danny @ 2004-12-15 20:31 UTC (permalink / raw)
  To: alsa-devel


Ok as promised a small patch to fix choppy sound when buffer/period size 
are set to certain values. I was only able to test this on 'Snapper', so I 
hope some people with other cards can verify that this helps (to reproduce 
the choppy sound you could try xmms (or bmp) with the alsaplugin and set 
period/buffer time to arbitrary values while playing a 32 kHz or 
lower mp3 or OGG file. 
Setting it both very low works best for testing).

----------



Buffersize is a bit small compared to the OSS driver (dmasound.h says 128kb is limit for Amiga, 
for pmac 256kb is used). At least on Snapper, some samplerates cause choppy sound when periods<3 
or buffersize is not a multiple of periodsize.

Signed-off-by: Danny Tholen <obiwan@mailmij.org>

--- linux-2.6.7/sound/ppc/pmac.c.old    2004-11-21 15:14:50.000000000 -0500
+++ linux-2.6.7/sound/ppc/pmac.c        2004-11-21 15:17:13.000000000 -0500
@@ -425,7 +425,7 @@
        .rate_max =             44100,
        .channels_min =         2,
        .channels_max =         2,
-       .buffer_bytes_max =     32768,
+       .buffer_bytes_max =     131072,
        .period_bytes_min =     256,
        .period_bytes_max =     16384,
        .periods_min =          1,
@@ -444,7 +444,7 @@
        .rate_max =             44100,
        .channels_min =         2,
        .channels_max =         2,
-       .buffer_bytes_max =     32768,
+       .buffer_bytes_max =     131072,
        .period_bytes_min =     256,
        .period_bytes_max =     16384,
        .periods_min =          1,
@@ -550,6 +550,9 @@
        if (chip->can_duplex)
                snd_pcm_set_sync(subs);

+       /* constraints to fix choppy sound */
+       snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIODS, 3, UINT_MAX);
+       snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
        return 0;
 }





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

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

end of thread, other threads:[~2004-12-15 21:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-15 20:31 [PATCH] buffersize and constraints on pmac danny
2004-12-15 21:23 ` Takashi Iwai
2004-12-15 21:40   ` danny
2004-12-15 21:50     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.