From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: External PCM plugin SDK Date: Mon, 14 Feb 2005 16:33:25 +0100 Message-ID: References: <1107958458.13863.43.camel@pegasus> <1107959869.13863.62.camel@pegasus> <1107970036.13863.77.camel@pegasus> <1107971323.13863.90.camel@pegasus> <1108038565.15974.20.camel@pegasus> <1108057507.15974.97.camel@pegasus> <1108058761.15974.107.camel@pegasus> <1108062270.15974.117.camel@pegasus> <1108124119.18099.23.camel@pegasus> <1108174707.8001.7.camel@pegasus> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII In-Reply-To: <1108174707.8001.7.camel@pegasus> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Marcel Holtmann Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Sat, 12 Feb 2005 03:18:27 +0100, Marcel Holtmann wrote: > > Hi Takashi, > > > > > but I think we still should implement something like init() and exit() > > > > of the objects. Otherwise it would not be possible to handle this in a > > > > correct way and we will get memory leaks and unclosed descriptors. > > > > > > We can add the clean up of cached plugin objects (i.e. calling > > > dlclose) in the existing snd_config_update_free_global(). This > > > function is supposed to be used for clean up of config tree cache. > > > > > > Each plugin with the keep-alive flag can have functions with > > > __attribute__((constructor)) and __attribute__((destructor)) for the > > > purpose above. > > > > The below is a test patch to add the dlobj cache. > > > > It adds a new mode flag to pcm open mode, SND_PCM_KEEP_ALIVE. > > In xmms, change the call of snd_pcm_open() like: > > > > snd_pcm_open(...., SND_PCM_NONBLOCK | SND_PCM_KEEP_ALIVE); > > > > and the dl object will remain alive until > > snd_config_update_free_global() is called explicitly. > > > > If the plugin needs always keep-alive, a bit more change is needed. > > I personal think that the object caching should be transparent for the > applications, but I don't have the insides into the ALSA library. If it > is too hard then this might be a good solution. I introduced the additional flag just for compatibility. But, maybe I was too nervous about that. Basically there is no big problem to use dl-object cache for all cases. OK, now the CVS version keeps the dl-objects. > However I won't have enough time to test this in detail for the next two > weeks, but the pcm_a2dp plugin is committed to the BlueZ CVS and maybe > some others want to give it a try. Has anyone tried? Any feedback is welcome. Takashi ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click