[Sound-open-firmware] Using the Qemu DSP emulator

Daniel Baluta daniel.baluta at gmail.com
Mon Mar 19 14:13:54 CET 2018


On Mon, Mar 19, 2018 at 1:33 PM, Liam Girdwood
<liam.r.girdwood at linux.intel.com> wrote:
> On Sat, 2018-03-17 at 11:29 +0200, Daniel Baluta wrote:
>> On Tue, Feb 6, 2018 at 6:38 PM, Liam Girdwood
>> <liam.r.girdwood at linux.intel.com> wrote:
>> > On Tue, 2018-02-06 at 10:14 +0200, Daniel Baluta wrote:
>> > > > Sorry for the delay, I was travelling last week. Turns out I missed
>> > > > some machine type setting in some of the machines when doing the
>> > > > forward port. Fix pushed.
>> > >
>> > > Thanks Liam for the updates. I forgot to reply, I've did some hacks
>> > > and
>> > > finally got qemu working.
>> > >
>> > > Now I get a timeout when trying to boot the DSP, but will get back
>> > > with more details once I have some spare time.
>> >
>> > Fwiw, firmware will send a FW ready message to the host to indicate
>> > boot complete. This involves writing to a special shim register that
>> > causes an IRQ on the host side.
>>
>> Finally got a chance to get back to this.
>>
>> First run I got a crash, which I think it's due to a race condition.
>
> Yeah, I've not root caused that yet, had to hack around it when I upgraded to
> the latest qemu release.
>
>>
>> I'm using:
>>
>> * sof.git/master - 19e48c5 Merge branch '1.1-stable'
>
> Can you also use the 1.1-stable branch for the sof tools and topology.

Sure.

>
>> * osadsp-qemu/master - 771e78b FIXME: log: Support 64bit trace format.
>> * asoc/sof-v4.15 - 130e9f7 0day warnings
>>
> Best to use my Pierre's v4.14 stable branch here as we are in the middle of a
> release (meaning my branches have more experiment patches).
>
>  https://github.com/plbossart/sound.git #topic/sof-v4.14

All right. Will give it a try.

>
>> Running
>>
>> $ ./xtensa-host.sh byt
>> $ ./x86-host.sh byt
>>
>> I get the following crash:
>> * https://pastebin.com/tDawwd5P
>>
>> full log here:
>>
>> * https://pastebin.com/dbjiimJx
>>
>> I guess this is a race and fixed it with:
>
> great, thanks ! Can you send that as a patch with your SoB ?

All right. Which branch should I base it on?

>
>>
>>
>> daniel at firefly:~/w/sof-sdk/asoc$ git diff
>> diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c
>> index 744d75b..7f5bef9 100644
>> --- a/sound/soc/sof/trace.c
>> +++ b/sound/soc/sof/trace.c
>> @@ -245,6 +245,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
>>         params.buffer.offset = 0;
>>         params.buffer.pages = sdev->dma_trace_pages;
>>
>> +
>> +       init_waitqueue_head(&sdev->trace_sleep);
>> +
>>         /* send IPC to the DSP */
>>         ret = sof_ipc_tx_message(sdev->ipc,
>>                 params.hdr.cmd, &params, sizeof(params),
>> @@ -255,7 +258,6 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
>>                 goto table_err;
>>         }
>>
>> -       init_waitqueue_head(&sdev->trace_sleep);
>>         sdev->host_offset = 0;
>>         return 0;
>>
>> After this, DSP firmware boots fine but then i get this error:
>>
>> [   11.264059] sof-audio sof-audio: error: ipc timed out for
>> 0x90010000 size 0x18
>> [   11.264458] sof-audio sof-audio: error: waking up any trace sleepers
>> [   11.264460] sof-audio sof-audio: error: cant set params for DMA for Trace-
>> 110
>> [   11.264467] sof-audio sof-audio: error: failed to initialize trace -110
>>
>>
>> Full log here:
>>
>>   * https://pastebin.com/VffNxrXg
>>
>> Any idea?
>
> Firmware is crashing
>
> [   11.264202] sof-audio sof-audio: shim 0x40 value 0x0dead00670028800
>
> But what does rmbox show ?

Never used rmbox. Can you provide an example.

Another comment:

Can you let me know which configuration worked for you on Qemu?

Using default {xtensa|x86}-host.sh scripts with baytrail parameter
i cannot get it working.

I have figured out that I also need a topology file.

I have used both byt-rt5640 machine Or hacked to used the nocodec but still
at some point I get a timeout from

I expect that if everything works well a sound card device should be created
and I can list it using arecord -l or aplay -l. Then I can use aplay/arecord
to send a file to DSP for decoding.

thanks,
Daniel.


More information about the Sound-open-firmware mailing list