From: Takashi Iwai Subject: Re: Missing snd_pcm_link() for the rate plugin Date: Fri, 25 Sep 2015 10:02:39 +0200 Message-ID: References: <55F285E0.7030100@voiceinterconnect.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D003E260660 for ; Fri, 25 Sep 2015 10:02:39 +0200 (CEST) In-Reply-To: <55F285E0.7030100@voiceinterconnect.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Christian Gruber Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Fri, 11 Sep 2015 09:42:24 +0200, Christian Gruber wrote: > > Dear ALSA community, > > does anybody know, why the rate plugin does not support the snd_pcm_link() function? > > As I can see from the ALSA-Lib source code, snd_pcm_link() calls the fast_op "link", which > is a function pointer, whose destination depends on the type of pcm device/plugin to be > linked. > > If the device is a HW-device for instance, the function snd_pcm_hw_link() is called. > Several other plugins (e.g. mmap_emul, linear, lfloat, mulaw, alaw, route) use the generic > function snd_pcm_generic_link(), which forwards the function call to their slave > devices/plugins. > > The rate plugin instead does not support snd_pcm_link(), since the function pointer "link" > is not assigned in the definition of snd_pcm_rate_fast_ops. > > Is their any reason to not use the generic function snd_pcm_generic_link() within the rate > plugin? I don't remember exactly any longer, but my guess is that the rate plugin has a tricky code to delay the actual start when the playback stream is started with less data than slave period size. But it might be a simpler reason: we forgot it. You can play with using snd_pcm_generic_link() & co. If it seems reliably working, we can add the hooks. Takashi