[vorbis-dev] libao alsa output

Jon Ellis ashura666 at mac.com
Wed Mar 26 01:25:41 PST 2003



Hi,

I sent the below a few days ago. It still hasn't turned up in the  
archive so i'm trying again.

Since the first mail was sent, i've found out that removing the call to  
*_set_periods and *_set_period_size is a better solution to the  
problem. It seems that the alsa defaults are better than what ever fine  
tuning the code is trying to do.

patch:

---  
/var/tmp/portage/libao-0.8.3/work/libao-0.8.3/src/plugins/alsa09/ 
ao_alsa09.c	2001-12-19 07:39:24.000000000 +0900
+++ ao_alsa09.c	2003-03-23 17:30:40.000000000 +0900
@@ -192,18 +192,6 @@
          if (err < 0)
                  goto error;

-	cmd = "snd_pcm_hw_params_set_period_size";
-	err = snd_pcm_hw_params_set_period_size(internal->pcm_handle,  
hwparams,
-			internal->buf_size / internal->sample_size, 0);
-	if (err < 0)
-		goto error;
-
-	cmd = "snd_pcm_hw_params_set_periods";
-	err = snd_pcm_hw_params_set_periods(internal->pcm_handle, hwparams,
-			internal->periods * format->channels, 0);
-	if (err < 0)
-		goto error;
-
          cmd = "snd_pcm_hw_params";
          err = snd_pcm_hw_params(internal->pcm_handle, hwparams);
          if (err < 0)

Comments? Can this get applied?

Thanks

j.

Hello,

I was investigating reports that mpg321 (which uses libao) had  
distorted output when using the alsa09 output plugin.

Looking at ao_plugin_open in ao_alsa09.c it makes a call to  
snd_pcm_hw_params_set_period_size when i think it should be called  
snd_pcm_hw_params_set_buffer_size. And in fact, making this change  
fixes the distortion for mp321.

This is my first look at the alsa api so i don't really understand the  
significance of this change. It is also not obvious to me what the  
"correct" buffer size calculation should be.

What is the real fix?

Thanks

j.

ps. i'm not subscribed to this alias so please copy me on any  
responses. Thanks.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list