[Sound-open-firmware] What is the correct loopback configuration for ASoC machine driver DAI links?
Pierre-Louis Bossart
pierre-louis.bossart at linux.intel.com
Thu May 30 18:29:49 CEST 2019
On 5/30/19 10:14 AM, Thomas Preston wrote:
> Hi,
> I have a question about configuring a physical loopback on a custom
> board for the Intel Skylake platform driver. I have also asked on
> freenode/#alsa-dev but they directed me here.
When you write "Intel Skylake driver", you are referring to the code in
sound/soc/intel/skylake? If yes, this is a different driver based on
closed-source firmware and I am afraid very few people on this list can
really help you.
Also the reference to A2B and the reference to SSP5 make me think this
is an automotive product based on ApolloLake? The board-level loopback
to synchronize two SSPs was enabled in products I was exposed to (maybe
two years ago), but this was quite tricky and you will most likely have
to contact your Intel support channels to get the clocks and SSP setup
right.
>
> We have the following physical SSP layout:
>
> A2B axillary audio
> + SSP0 Tx (connected to SSP5 Rx, for debug)
> + SSP0 Rx
>
> Main speaker output + loopback from A2B
> + SSP5 Tx
> + SSP5 Rx (connected to SSP0 Tx)
>
> We have a board-level hardware loopback where the output signals and
> clock (slave) on SSP0 are connected to the input signals and clock
> (master) on SSP5.
>
> I'm trying to configure the DAI links in the machine driver so that they
> link against SSP0 Pin CPU DAI correctly but I have three problematic
> configurations:
>
> 1. Separate BE DAI links for SSP5 playback and capture, linking against
> the same Skylake CPU DAI "SSP5 Tx". This crashes the kernel with a NULL
> pointer dereference (I'm looking into this). Presumably this is an
> invalid configuration because I have multiple DAI links linking against
> one CPU DAI. See machine1.c
>
> 2. One BE DAI link for SSP5 playback + capture, linking against the same
> Skylake CPU DAI. This silences my SSP5 Tx main audio output (which
> appears to be muted) when I try to arecord on the SSP5 Rx A2B debug
> loopback. The recording is a perfect copy of SSP0 Tx so the loopback
> part works. I can recover by restarting my whole audio stack. See
> machine2.c
This seems like the logical configuration, I don't think we've ever
enabled 2 dailinks for capture and playback on the same SSP. it wouldn't
make a lot of sense since the SSP format needs to be the same for the
two directions (same bclk, fsync, number of slots and data format)
It's likely that you are still configured as SSP0 in master mode or have
some sort of clocking issue. You will also need to enable the SSP5
clocks by default in your machine driver so that the SSP0 TX is always
clocked.
>
> 3. Separate BE DAI links for SSP playback and loopback, linking against
> a separated SSP5 Skylake CPU DAI (SSP5 Pin with ssp5 Tx, SSP5 Pin
> Loopback with ssp5 Rx). This configuration works but requires a
> modification to the Skylake platform driver - which I'd rather avoid.
> See machine3.c, skylake.diff
>
> Configuration 2 is closest to what I want, and configuration 3 is my
> work-around for now.
>
> What is the correct way to link CPU DAIs for this kind of loopback? I
> have attached example code.
>
> Many thanks,
> Thomas
> _______________________________________________
> Sound-open-firmware mailing list
> Sound-open-firmware at alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
More information about the Sound-open-firmware
mailing list