[alsa-devel] [PATCH 5/6] compress: add the core file

Vinod Koul vinod.koul at linux.intel.com
Wed Nov 23 17:16:32 CET 2011

On Wed, 2011-11-23 at 16:02 +0000, Mark Brown wrote:
> > +static int snd_compress_add_device(struct snd_compr *device)
> > +{
> > +     int ret;
> > +     struct snd_card *card;
> > +
> > +     ret = snd_card_create(SNDRV_DEFAULT_IDX1, device->name,
> > +                     THIS_MODULE, 0, &card);
> > +     if (ret < 0)
> > +             goto out;
> It's a bit surprising that this is doing snd_card_create() - I'd
> expect
> a compressed device to be added as a subdevice on a card being passed
> in.  At least in the embedded case you'd normally get a card with a
> mix
> of PCM and compressed streams in one unified card.
ATM I am viewing the compressed card as a different one, but yes
logically speaking for embedded audio we can think of this as a single
card and use the same card here as well.
> > +     mutex_init(&device->lock);
> > +     /* todo integrate with asoc */
> The core code shouldn't know anything about ASoC, ASoC should be able
> to
> use the core API like any other card driver.
I was thinking that during the compress stream open, the core will
trigger the asoc to turn on the codec. For that purpose it needs to call
asoc, hence the comment.

Well this changes if we think asoc should use core API.
That way my lower level driver model changes:
	think of a cpu driver which registers cpu side with asoc and compressed
path with core here as compared to my initial thoughts on a compressed
driver outside asoc which registers the compressed ops with core and
acts as wrapper over dsp


More information about the Alsa-devel mailing list