public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource•cirrus.com>
To: Marc Gonzalez <marc.w.gonzalez@free•fr>
Cc: alsa-devel@alsa-project•org, Takashi Iwai <tiwai@suse•com>,
	Linux ARM <linux-arm-kernel@lists•infradead.org>
Subject: Re: [alsa-devel] Propagating audio properties along the audio path
Date: Tue, 24 Sep 2019 13:52:19 +0000	[thread overview]
Message-ID: <20190924135219.GQ10204@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <878168cb-07e0-cdfd-37e9-9b9fb229155b@free.fr>

On Mon, Sep 23, 2019 at 12:47:33PM +0200, Marc Gonzalez wrote:
> On 20/09/2019 11:50, Marc Gonzalez wrote:
> 
> > One more concern popped up: if the audio stream changes mid-capture
> > (for example, a different TV program uses different audio settings),
> > then I would detect this in the eARC receiver, but it's not clear
> > (to me) how to propagate the info to the DSP...
> > 
> > I'm not even sure when the HW params actually get applied...
> > Is it for SNDRV_PCM_IOCTL_PREPARE? SNDRV_PCM_IOCTL_START?
> 
> I enabled debug logs in the sound layer:
> echo "file sound/* +fpm" > /sys/kernel/debug/dynamic_debug/control
> 
> and sprinkled dump_stack() in several driver callbacks.
> 
> When I run 'tinycap /tmp/earc.wav -t 10 -r 44100 -b 32'
> I see the open/SyS_openat call and the capture ioctl call
> which together generate calls to
> 1) dpcm_fe_dai_open
> 2) dpcm_fe_dai_hw_params
> 3) dpcm_fe_dai_prepare
> 4) dpcm_fe_dai_trigger
> 
> But everything looks "synchronous", as in "reaction to user-space commands".
> I don't see how "asynchronous" events are dealt with, such as the stream
> params changing while a capture is active?
> 

In general the ALSA framework doesn't really allow for stream
params to change whilst the stream is active. Doing so is
also normally very hard for the types of hardware usually
involved. For example changing the clocks on a running I2S bus,
very difficult to get both ends to pick up those changes at
exactly the correct sample. Some newer buses like soundwire
have more support for things like this were the ends of the
link can synchronise changes but even there that is normally
used for adding/removing streams from the bus, not reconfiguring
a running stream.

In your case above I would imagine the system would probably be
setup where the DSP handles the conversion between the params
requested from the receiver and those requested by user-space.
One of the intentions of DPCM was to allow the backend
(DSP-receiver here) to have different params to the frontend
(DSP-userspace here). Although as you note you still probably
need to add something to propogate those changes to the DSP. What
form does the physical link between the receiver and the DSP
take?

Thanks,
Charles

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-09-24 13:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 15:33 Propagating audio properties along the audio path Marc Gonzalez
2019-09-20  9:50 ` Marc Gonzalez
2019-09-23 10:47   ` Marc Gonzalez
2019-09-24 13:52     ` Charles Keepax [this message]
2019-09-24 14:26       ` [alsa-devel] " Marc Gonzalez
2019-09-24 14:42         ` Charles Keepax

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=20190924135219.GQ10204@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource$(echo .)cirrus.com \
    --cc=alsa-devel@alsa-project$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=marc.w.gonzalez@free$(echo .)fr \
    --cc=tiwai@suse$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox