Re: [PATCH 3/3] Add ALSA driver for Atmel AC97 controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Wed, 4 Feb 2009 16:02:14 +0100,
Hans-Christian Egtvedt wrote:
> 
> On Wed, 04 Feb 2009 13:09:37 +0100
> Takashi Iwai <tiwai@xxxxxxx> wrote:
> 
> > At Wed,  4 Feb 2009 12:48:34 +0100,
> > Hans-Christian Egtvedt wrote:
> 
> <snipp>
> 
> > > +static int atmel_ac97c_playback_hw_params(struct snd_pcm_substream
> > > *substream,
> > > +		struct snd_pcm_hw_params *hw_params)
> > > +{
> > > +	struct atmel_ac97c *chip =
> > > snd_pcm_substream_chip(substream);
> > > +	int retval;
> > > +
> > > +	retval = snd_pcm_lib_malloc_pages(substream,
> > > +
> > > params_buffer_bytes(hw_params));
> > > +	if (retval)
> > > +		return retval;
> > 
> > Should be a negative-check.
> > 
> 
> For some reason if I only check for < 0, then the buffer is not
> configured properly. Seems like the preallocation goes wrong for some
> reason.
> 
> Any pointers to why?

Could it be due to multiple hw_params calls?
You can check the sequence of PCM callbacks.

Oh wait, is it an error from atmel_ac97c_prepare_dma()?
Looking through the code, it uses runtime->buffer_size and
runtime->period_size.  These aren't set yet inside hw_params.
I think this setup can be done better in prepare callback.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux