All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Hofman <pavel.hofman@ivitera.com>
To: alsa@scripple.org, alsa-devel@alsa-project.org
Subject: Re: Loopback device respond to changing parameters on the other end.
Date: Mon, 5 Oct 2020 09:12:45 +0200	[thread overview]
Message-ID: <691bd7f1-cf08-014a-6d8d-da7c50fdab91@ivitera.com> (raw)
In-Reply-To: <44f29dca-c238-d90c-4221-0f5265d61019@schells.com>



Dne 05. 10. 20 v 4:38 alsa@scripple.org napsal(a):
> Hello,
> 
> Let me open by saying I am not an experienced ALSA developer so 
> hopefully I'm just missing something really easy here.
> 
> I'm trying to use some DSP programs that insert themselves into the 
> audio chain via the ALSA loopback device.  My understanding is that 
> whichever program opens the loopback device first sets the parameters, 
> so the DSP
> program has to know what parameters any playback program is going to use 
> before it opens its end of the loopback device.  And it has to know when 
> to release the loopback device so that another (or the same) playback 
> program can open the loopback device with possibly different parameters. 
>   (The DSP program also needs to the know the audio parameters just to 
> do the right thing of course.)
> 
> I'm not sure how best to accomplish this.  I don't want any form of 
> auto-format conversion such as using a resampling or format conversion 
> plugin.  I want the DSP program to access the raw PCM stream however it 
> was configured by the playback program.
> 
> I was thinking I could use the PCM hook system to accomplish what I 
> want.  Capture the SND_PCM_HOOK_TYPE_CLOSE (and possibly even use the
> hook init) to tell the DSP program to close its end of the loopback 
> device.  Capture the SND_PCM_HOOK_TYPE_HW_PARAMS to configure the DSP
> program with the appropriate parameters and tell it to open the loopback 
> device with those new parameters.
> 

There used to be a notification module parameter (pcm_notify) which 
closed the other loopback side if params changed 
https://mailman.alsa-project.org/pipermail/alsa-devel/2020-March/165454.html

I am afraid it remains to be fixed.

Best regards,

Pavel.

  reply	other threads:[~2020-10-05  7:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05  2:38 Loopback device respond to changing parameters on the other end alsa
2020-10-05  7:12 ` Pavel Hofman [this message]
2020-10-05 15:21   ` alsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=691bd7f1-cf08-014a-6d8d-da7c50fdab91@ivitera.com \
    --to=pavel.hofman@ivitera.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=alsa@scripple.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.