Hi,
Some of us at Intel are confused with multiple definitions of capture/playback dailink flags (credits to Rander Wang for reporting this in https://github.com/thesofproject/linux/pull/2070).
struct snd_soc_dai_link { [...]
/* For unidirectional dai links */ unsigned int playback_only:1; unsigned int capture_only:1;
[...]
/* DPCM capture and Playback support */ unsigned int dpcm_capture:1; unsigned int dpcm_playback:1; [...]
};
And of course when you start looking at some machine drivers, there are confusions, e.g. below with DPCM front-ends using one or the other set, and with copy-paste and partial diffs, this propagates without being consistent or being noticed:
[GLK_DPCM_AUDIO_HS_PB] = { .name = "Glk Audio Headset Playback", .stream_name = "Headset Audio", .dpcm_playback = 1, <<<< .nonatomic = 1, .dynamic = 1, SND_SOC_DAILINK_REG(system2, dummy, platform), }, [GLK_DPCM_AUDIO_ECHO_REF_CP] = { .name = "Glk Audio Echo Reference cap", .stream_name = "Echoreference Capture", .init = NULL, .capture_only = 1, <<<< should this be .dpcm_capture = 1? .nonatomic = 1, .dynamic = 1, SND_SOC_DAILINK_REG(echoref, dummy, platform), }, [GLK_DPCM_AUDIO_REF_CP] = { .name = "Glk Audio Reference cap", .stream_name = "Refcap", .init = NULL, .dpcm_capture = 1, <<<< .nonatomic = 1, .dynamic = 1, .ops = &geminilake_refcap_ops, SND_SOC_DAILINK_REG(reference, dummy, platform), },
So here are the questions:
- when using DPCM, is there an expectation to use dpcm_ flags only?
- should we instead use playback/capture_only when only one of the two dpcm_ flags is set?
- should we flags errors if we ever encounter cases with e.g. dpcm_playback = true and capture_only = true?
- do we actually need two sets of definitions? There are very few users of the .playback_only and .capture_only flags and only a single place where it's checked in soc-pcm.c
Thanks for your feedback
-Pierre