On Wed, Jun 17, 2015 at 01:23:40PM +0100, Mark Brown wrote:
On Wed, Jun 17, 2015 at 08:24:48AM +0530, Vinod Koul wrote:
if (cpu_dai->driver->create) ret = cpu_dai->driver->create(rtd, num);
and each driver passes soc_new_compress (or whatever) there. This is flexible and can be extended if any new stuff has to be handled. Even PCM creation or dai widget links can be passed in that form, too.
and the default would be snd_pcm_new so that *most* drivers dont need to add this. Only Intel atom driver should add soc_new_compress() as create ops, hence direct reference so no gaurds required
Looks good to me then, Mark you okay with this approach?
I'm not sure this fully helps. This will put the reference in the CPU driver which if there's sharing with non-compressed DAIs means that any machine driver using the platform needs to select the compressed audio code. It also means that we're still in the situation whre if a machine *can* support compressed audio it *must* support compressed audio, it's not clear to me that people doing this sort of memory optimisation are always going to be doing it on hardware that doesn't have the capacity for compressed audio (or won't in the future). But then I don't know exactly how much memory is being saved here...
Yes this is a good point but then driver can define the compressed dai only when SND_SOC_COMPRESS is enabled. So if machine has enabled this symbol then only dai get added and machine can create dai-link
Also for the size question, in sound-next we have 248KB soc-compress.o
Thanks