All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: Jaroslav Kysela <perex@suse.cz>
Cc: alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: dmix bugs. sounds very broken up.
Date: Tue, 02 Sep 2003 12:50:29 +0100	[thread overview]
Message-ID: <3F548405.80902@superbug.demon.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.53.0309021232410.29300@pnote.perex-int.cz>

Jaroslav Kysela wrote:
> On Tue, 2 Sep 2003, James Courtier-Dutton wrote:
> 
> 
>>Jaroslav Kysela wrote:
>>
>>>On Mon, 1 Sep 2003, James Courtier-Dutton wrote:
>>>
>>>
>>>
>>>>I have found two problems with using the dmix alsa device name.
>>>>1) snd_pcm_hw_params_can_pause (params)  causes alsa-lib to assert!
>>>>
>>>>2) Sound is broken up.
>>>>a) It can only function with 2 periods, why is that? Having 8 periods
>>>>might be better, although "front" works fine with 2 periods, but "dmix"
>>>>with 2 periods fails.
>>
>>See attachment dmix-fail.c
>>compile with
>>gcc -g -DDEBUG -lasound a.c
>>
>>Shows problem (1) and (2)
> 
> 
> (1)
> 
> The count of used periods is probably 2.73 for 64kB buffer, my setup is:
> 
> buffer_size  : 16384
> period_size  : 6000
> 
> If you want another setup, you must write your own configuration to
> ~/.asoundrc.
> 
> (2)
> 
> Problem with uninitialized pcm->info value is fixed in CVS.
> 
> 
>>>>b) Of the 2 periods, it sounds like sound is only being played from one
>>>>of the periods, with silence for the other period.
>>>>
>>
>>I don't have a small compilable example for this yet. The problem
>>application is the latest xine cvs. (xine.sf.net)
> 
> 
> Note that it might be caused that your code is broken. Please, use the
> correct transfer unit (period_size) and not the period count which might
> be a real not integer value, thus buffer_size / period_size !=
> integer(period_count).
> 
> 						Jaroslav
> 
> -----
> Jaroslav Kysela <perex@suse.cz>
> Linux Kernel Sound Maintainer
> ALSA Project, SuSE Labs
> 
> 
The aim of my code is to try for a buffer that is about 1 second long or 
less, and has hopefully 8 periods.
I had always assumed that the period_count had to be an integer.
If it is in fact possible to to have the period_count a non-interger on 
all sound cards, then I will change my code.

The problem with trying the period_size approach was: -
set_buffer_time_near(1 second)
size = get_buffer_size()  (e.g. this gets set to 16384)
set_period_size_near(size/8, dir=0)  (e.g. try to set period_size to 
2048) <- Failed on some cards/devices that did not like 8 periods.

I thought that set_period_size_near with a dir=0, should have resulted 
in a setting of 6000 for "dmix", but it in-fact failed, and I did not 
want to go round a loop trying different period sizes until one worked.

Does this point to a bug in the set_period_size_near function then?

Cheers
James



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  parent reply	other threads:[~2003-09-02 11:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-01  0:59 dmix bugs. sounds very broken up James Courtier-Dutton
2003-09-01  6:08 ` Jaroslav Kysela
2003-09-01 23:08   ` James Courtier-Dutton
     [not found]     ` <Pine.LNX.4.53.0309021232410.29300@pnote.perex-int.cz>
2003-09-02 11:50       ` James Courtier-Dutton [this message]
2003-09-04  9:46         ` Jaroslav Kysela
2003-09-09  8:05           ` Safe to call snd_pcm_close after failed snd_pcm_open? Arve Knudsen
2003-09-09  9:04             ` Jaroslav Kysela
2003-09-02 13:20       ` dmix bugs. sounds very broken up James Courtier-Dutton
2003-09-02 15:19         ` Jaroslav Kysela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F548405.80902@superbug.demon.co.uk \
    --to=james@superbug.demon.co.uk \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=perex@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.