Hi Daniel,
Please find attached my configuration files (.config and device tree), I hope that will help you understand any mistake I might have made.
Regards, David Sayada.
On Wed, May 3, 2023 at 7:45 PM David Sayada dsayada.upwork@gmail.com wrote:
Hi Daniel,
Please find attached my dmesg logs, I don't have the feelings snd_sof_load_topology is being called. We are using kernel 5.10, if you want tomorrow, I can send you dts and .config files, maybe something is wrong there.
Regards, David Sayada.
On Wed, May 3, 2023 at 4:32 PM Daniel Baluta daniel.baluta@nxp.com wrote:
If you can play a wav then topology load works.
Can you please add a dump_stack() as follows:
--- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2080,6 +2080,8 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
dev_dbg(scomp->dev, "loading topology:%s\n", file);
dump_stack();
ret = request_firmware(&fw, file, scomp->dev);
and then send the result of dmesg?
*From:* David Sayada dsayada.upwork@gmail.com *Sent:* Wednesday, May 3, 2023 4:25 PM *To:* Daniel Baluta daniel.baluta@nxp.com *Cc:* Iuliana Prodan iuliana.prodan@nxp.com; sound-open-firmware@alsa-project.org < sound-open-firmware@alsa-project.org>; Kodel Oleg < oleg.kodel@elbitsystems.com> *Subject:* Re: Bad magic error when loading SOF firmware
Hi Daniel,
Yes, the sound card is indeed created, I can see it when I perform "aplay -l", and I can also play a wav file when using it (hw1:0). For some reason I don't understand, sof_pcm_probe is not called, the platform I am using is i.mx8mp based, I didn't enable sof pci/acpi features.
Regards, David Sayada.
On Wed, May 3, 2023 at 3:34 PM Daniel Baluta daniel.baluta@nxp.com wrote:
What does, 'aplay -l' says on your board.
Is the SOF sound card created?
SOF topology is loaded when kernel boots (or when you load the SOF modules).
You can add a dump_stack() inside sof_pcm_probe.
Call trace should look like this:
sof_of_probe: -> sof_probe_continue -> snd_sof_probe -> sof_pcm_probe
*From:* David Sayada dsayada.upwork@gmail.com *Sent:* Wednesday, May 3, 2023 12:32 PM *To:* Daniel Baluta daniel.baluta@nxp.com *Cc:* Iuliana Prodan iuliana.prodan@nxp.com; sound-open-firmware@alsa-project.org < sound-open-firmware@alsa-project.org>; Kodel Oleg < oleg.kodel@elbitsystems.com> *Subject:* Re: Bad magic error when loading SOF firmware
Hi Daniel,
I have created and compiled myself a new topology in order to support playback/record on sai1 in front of a TI codec, I set it on the right place on my embedded linux file system, and I also declare it properly on my device tree.
Can you please tell when it will be used first? And by whom? I have seen that should be when calling sof_pcm_probe, but I can't also see this function to be called.
Examining my SAI signals on the scope (MCLK, BCLK, ...) using aplay, they seem to be correct, at this stage, is the topology really used? In general, for me to have a better understanding, what does topology stand for?
Thank you for all your help, to tell you the truth, I am a little bit lost. But when I understand these subtleties, I think I will be OK.
Regards, David Sayada.
On Tue, Apr 25, 2023 at 1:14 PM David Sayada dsayada.upwork@gmail.com wrote:
Hi Daniel,
Thank you for the precision, I will look into it.
Regards, David Sayada.
On Mon, Apr 24, 2023 at 10:38 AM Daniel Baluta daniel.baluta@nxp.com wrote:
Hi David,
We use the emulator only to test DSP boot in our CI, we don't have emulated devices that will allow testing audio playback and record.
Documentation:
https://thesofproject.github.io/latest/developer_guides/virtualization/runni...
https://www.alsa-project.org/main/index.php?title=Firmware&oldid=7248#Us...
https://github.com/thesofproject/sof/actions/runs/4782426899/jobs/8501755748...
*From:* David Sayada dsayada.upwork@gmail.com *Sent:* Sunday, April 23, 2023 4:05 PM *To:* Daniel Baluta daniel.baluta@nxp.com *Cc:* Iuliana Prodan iuliana.prodan@nxp.com; sound-open-firmware@alsa-project.org < sound-open-firmware@alsa-project.org>; Kodel Oleg < oleg.kodel@elbitsystems.com> *Subject:* Re: Bad magic error when loading SOF firmware
Hi Daniel,
I have seen it is possible to emulate all supported SOF HW platforms using qemu. As a beginning, I would like to run the "audio playback and record" scenarios using the sof-imx8mp-wm8960.tplg topology. Can you please refer me to the documentation that will allow me to set up a VM that will allow me to perform this emulation?
Best Regards, David Sayada.
On Fri, Apr 7, 2023 at 5:44 PM David Sayada dsayada.upwork@gmail.com wrote:
Hi Daniel,
Yes, I already started using sof-logger as you suggested 😉 Oleg, who is the customer I am working for, will certain have some specific questions after we finish our preliminary bring-up (imx8mp + sai1
- tlv320aic3x6), I can see the device enumerated when performing "aplay
-l", next stage will be to render/record WAV files. I am sure you will be able to start a kind of interesting cooperation together in the future.
See you soon, Have a nice week-end, David Sayada.
On Fri, Apr 7, 2023 at 5:22 PM Daniel Baluta daniel.baluta@nxp.com wrote:
Hi David,
uart should work in the future once we switch th Zephyr.
@Iuliana Prodan iuliana.prodan@nxp.com is working on this.
Until then you can use the sof-logger tool which mostly allows you to do the same thing as with the serial console.
Here is how you cross compile the tool for ARM64:
https://thesofproject.github.io/latest/getting_started/nxp/sof_imx_user_guid...
And then just it like this:
./sof-logger -l sof-imx8m.ldc
You need to make sure that the kernel has the SOF debugging features compiled.
Let me know if you have more questions.
*From:* David Sayada dsayada.upwork@gmail.com *Sent:* Friday, April 7, 2023 4:59 PM *To:* Daniel Baluta daniel.baluta@nxp.com *Cc:* sound-open-firmware@alsa-project.org < sound-open-firmware@alsa-project.org>; Kodel Oleg < oleg.kodel@elbitsystems.com>; Iuliana Prodan iuliana.prodan@nxp.com *Subject:* Re: Bad magic error when loading SOF firmware
Hi Daniel,
Thank you for your quick response. I believed I had to run the SOF firmware using remoteproc, and a week ago I understood it had to be run via the SOF driver. No more issues for me regarding this topic. Do you give the possibilities to use, for instance, uart4, in order to have some kind of printf feature as it is the case using "DSP Framework"?
Wishing you an excellent week-end.
Regards, David Sayada.
On Wed, Apr 5, 2023 at 5:45 PM Daniel Baluta daniel.baluta@nxp.com wrote:
Hi David,
Can you provide us more information about your use case?
At NXP we have different scenarios for using DSP:
- via remoteproc, for that you will need a special firmware (not SOF)
- via SOF driver, for that you will need the SOF firmware
Let us know what is your scenario and what are you trying to do so that we can provide further help.
For starting with SOF there is this quick start guide here:
https://thesofproject.github.io/latest/getting_started/nxp/sof_imx_user_guid...
thanks, Daniel.
*From:* David Sayada dsayada.upwork@gmail.com *Sent:* Sunday, April 2, 2023 11:32 AM *To:* sound-open-firmware@alsa-project.org < sound-open-firmware@alsa-project.org> *Cc:* Kodel Oleg oleg.kodel@elbitsystems.com *Subject:* Bad magic error when loading SOF firmware
Hello SOF team,
We are trying to evaluate the SOF project on our 8MPLUSSLPD4-EVK based product, and we are getting some issues when trying to run one of the "yocto compiled" SOF Firmware.
Below is the procedure we are trying to perform:
*echo /lib/firmware/imx/sof/sof-imx8m.ri > /sys/class/remoteproc/remoteproc0/firmware* *echo start > /sys/class/remoteproc/remoteproc0/state*
We are getting, at the end, a "Image is corrupted (bad magic)" -22 return code.
We have also created a VM (based on SOF 2.4.1) where we can compile (and sign, with default keys) the different toolchains and firmwares. Will that help in having a firmware run correctly?
Maybe, we are doing incorrect things, if this is the case, please advise.
Best regards, David Sayada.