-
Notifications
You must be signed in to change notification settings - Fork 140
Auxiliary devices in SOF #2501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auxiliary devices in SOF #2501
Conversation
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fully convinced by the code, the selection between platform device or nocodec mode seems odd.
75d190d to
689d3e1
Compare
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit-picks, also agree with @lyakh that we should create a helper and avoid putting all this code in the middle of sof_machine_register().
sound/soc/sof/nocodec.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to add this specifically when changing to the auxiliary_bus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately it is needed specifically for auxiliary bus because the naming convention for aux drv uses the KBUILD_MODNAME prefix with the machine driver name provided. But the same change is valid even with the platform driver and probably the right thing to do. Let me submit a separate patch for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, sound good
316f39a to
a08392f
Compare
a08392f to
30443eb
Compare
f3ddaf2 to
ecec880
Compare
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SOF parts LGTM @ranj063 but still a couple of warnings to fix.
CHECK: spaces preferred around that '+' (ctx:VxV)
#555: FILE: drivers/base/auxiliary.c:234:
+ dlen = strlen(auxdrv->name+1);
^
Checking sound/soc/sof/sof-probes-client.c ...
sound/soc/sof/sof-probes-client.c:137:10: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
ret = snprintf(buf + strlen(buf), remaining,
^
sound/soc/sof/sof-ipc-test-client.c:44:14: style: Variable 'cur' is assigned a value that is never used. [unreadVariable]
ktime_t cur = ktime_get();
^
Checking sound/soc/sof/control.c ...
sound/soc/sof/control.c:117:82: style:inconclusive: Function 'snd_sof_volume_info' argument 2 names different: declaration 'ucontrol' definition 'uinfo'. [funcArgNamesDifferent]
int snd_sof_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
^
sound/soc/sof/sof-audio.h:128:30: note: Function 'snd_sof_volume_info' argument 2 names different: declaration 'ucontrol' definition 'uinfo'.
struct snd_ctl_elem_info *ucontrol);
^
sound/soc/sof/control.c:117:82: note: Function 'snd_sof_volume_info' argument 2 names different: declaration 'ucontrol' definition 'uinfo'.
int snd_sof_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
^
Create an SOF client driver for IPC flood test. This driver is used to set up the debugfs entries and the read/write ops for initiating the IPC flood test that would be used to measure the min/max/avg response times for sending IPCs to the DSP. The debugfs ops definitions in the driver is existing code that has been copied from the core. These will be removed from the SOF core making is less monolithic and easier to maintain. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Co-developed-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Add new ops for registering/unregistering clients based on DSP capabilities and/or DT information. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Define client ops for Intel platforms. For now, we only add 2 IPC test clients that will be used for run tandem IPC flood tests for. For ACPI platforms, change the Kconfig to select SND_SOC_SOF_PROBE_WORK_QUEUE to allow the ancillary driver to probe when the client is registered. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Co-developed-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Remove the IPC flood test support in the SOF core as it is now added in the IPC flood test client. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Add client APIs to invoke the platform-specific DSP probes ops. Also, add a new API to get the SOF core device pointer which will be used for DMA buffer allocation. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
sof_probe_compr_ops are not platform-specific. So move it to common compress code and export the symbol. The compilation of the common compress code is already dependent on the selection of CONFIG_SND_SOC_SOF_DEBUG_PROBES, so no need to check the Kconfig section for defining sof_probe_compr_ops again. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new client driver for probes support and move all the probes-related code from the core to the client driver. The probes client driver registers a component driver with one CPU DAI driver for extraction and creates a new sound card with one DUMMY DAI link with a dummy codec that will be used for extracting audio data from specific points in the audio pipeline. The probes debugfs ops are based on the initial implementation by Cezary Rojewski and have been moved out of the SOF core into the client driver making it easier to maintain. This change will make it easier for the probes functionality to be added for all platforms without having the need to modify the existing(15+) machine drivers. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Register the client device for probes support on the CNL platform. Creating this client device alleviates the need for modifying the sound card definitions in the existing machine drivers to add support for the new probes feature in the FW. This will result in the creation of a separate sound card that can be used for audio data extraction from user specified points in the audio pipeline. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
fixed the probes abd ipc test client warnings now but control changes are not relevant to this PR. Maybe they need a separate PR |
ecec880 to
f6ad524
Compare
oh man, someone AGAIN changed stuff without running cppcheck. this is painful. Will send a patch on this one. |
|
|
||
| #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_PROBES) | ||
| sof_client_dev_unregister(sdev, "probes", 0); | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add the probes for all of APL/CNL/TGL?
I just tried on TGL and nothing. We should add this for all cAVS1.5+ devices. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart unfortunately Dave is having conflicts with TGL on Linus' tree. Thats why I limited the series to just CNL for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APL should not have any conflicts though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the probes functionality was not validated with the APL firmware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes no sense to me. Let's test it then. This only depends on the HDaudio DMA...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fredoh9 is testing it as we speak. All my APL devices gave up on me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart I was under impression that the Probes feature is supported from CNL onward.
I built with APL FW with the probes and I'm testing on UP2. Everything seems to be working fine, except crecord's output file is not growing. I set multiple extraction points and it ends up with setting all of buffer widget IDs but no good news. I need to check with FW team for some clarification. I will update again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probes is tested in APL UP2. I missed aplay when I tested in APL. That's why its output didn't grow.
Below the diff.txt from @plbossart, it looks great.
|
@ranj063 suggested patch: apl-cnl-tgl.diff.txt |
|
@ranj063 I tested this patch on my sdw platform, and can't find the 'sof-probes' card in /proc/asound/cards. Do it correctly or not? PS: I'm using the kernel: https://sof-ci-storage.sh.intel.com/pr/linux/pr2501-4763/ |
Auxiliary devices in SOF feature is introduced in thesofproject/linux#2501, which adds a new sof-probes card in /proc/asound/cards. Old SOF card number acquisition cannot work any more due to this change. Signed-off-by: Amery Song <chao.song@intel.com>
Auxiliary devices in SOF feature is introduced in thesofproject/linux#2501, which adds a new sof-probes card in /proc/asound/cards. Old SOF card number acquisition cannot work any more due to this change. This patch excludes the sof-probes card with a grep. Signed-off-by: Amery Song <chao.song@intel.com>
@libinyang did you test on a CML platform? If no, probes are not added, see patch above. |
|
@libinyang which platform did you try? If you keep not seeing Probe card, I can help you to figure out why Probe soundcard is not enumerated. |
|
@plbossart @fredoh9 I tested it on TGL, not CML. Thanks for the information. I will look for a CML SDW platform to have a test on the userspace, especially for the pulseaudio test. |
Auxiliary devices in SOF feature is introduced in thesofproject/linux#2501, and it adds a new sof-probes card in /proc/asound/cards, which will break current test, because we cannot acquire the correct card ID. This patch workarounds the issue by filtering out the sof-probes card with grep. Even it gets merged, our test is safe to run. Signed-off-by: Amery Song <chao.song@intel.com>
Auxiliary devices in SOF feature is introduced in thesofproject/linux#2501, and it adds a new sof-probes card in /proc/asound/cards, which will break current test, because we cannot acquire the correct card ID. This patch workarounds the issue by filtering out the sof-probes card with grep. Even it gets merged, our test is safe to run. Signed-off-by: Amery Song <chao.song@intel.com>
Now added support for nocodec machine driver, ipc test client and probes client all using the auxiliary bus