On Fri, 3 Jan 2003, Paul Davis wrote:

> >This part of PCM API has not been discussed. I think that we should follow
> >the most easy way: It is - allow only sample rate given by application, if
> >the master clock is using another sample rate - in trigger() callback -
> >driver will fail. 
> 
> this seems wrong to me. what should fail is an attempt to set the
> sample rate unless the hardware is its own clock Master. if no attempt
> is made to set it, then the application gets whatever the hardware is
> running at, whether that is externally controlled or some h/w specific
> default. 

I think that it's wrong when application receives stream with another
parameters than requested. Imagine that you're doing a software sample
rate conversion and we really need to know the exact rate for this job.

So my suggestion is:

1) offer all available sample rates in open() or reduce them as suggested
   by Anders
2) in trigger(START)
   - check if current sample rate match with hw_params - if not - fail
3) in interrupt callback
   - same job as trigger does

Note that we have to implement this algorithm also for playback, because 
it can use external timing as well.

> >                Also it will fail, when sample rate is changed during
> >operation. 
> 
> the hammerfall driver used to contain stubs for doing this. every
> read/write operation would check that the (possibly externally
> controlled) SR was the same as "last time". i never did any more on this.
> 
> >         We probably need to add a new PCM state -
> >SNDRV_PCM_STATE_STREAM_CHANGED (equal to DRAINING, but informative for
> >applications). The notification of master clock / sample rate (or other
> >parameter) changes should be implemented using the control API.
> 
> and already is for some cards (and some parameters).

Yes, I know.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to