From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Holtmann Subject: Re: External PCM plugin SDK Date: Sat, 12 Feb 2005 03:18:27 +0100 Message-ID: <1108174707.8001.7.camel@pegasus> 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> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit In-Reply-To: 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: Takashi Iwai Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org 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. 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. Regards Marcel ------------------------------------------------------- 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