Hi, currently writing hd-audio driver. I have passed the reset process, my driver resets the controller and take it out of reset mode. It also setup corb and rirb. But the problem is I can send command but I receive 0 response, tested in virtual box latest version and qemu.
I iterate through statests register for codec. I found only one codec in vbox and it's fine. But I couldn't received any response in rirb buffer.
My code- https://github.com/manaskamal/aurora-xe ... da/hda.cpp
Hd-Audio corb/rirb problem
Re: Hd-Audio corb/rirb problem
Code: Select all
rirb_base = (uintptr_t)get_physical_address((uint64_t)_ihd_audio.rirb);
_aud_outl_(RIRBLBASE, rirb_base);
_aud_outl_(RIRBUBASE, rirb_base >> 32);
Code: Select all
_aud_outw_ (CORBRP, 0x8000);
_aud_outw_ (CORBRP, 0x0);
Also it is important that in RIRB you receive 8 bytes, from whose is first dword response to verb.
Re: Hd-Audio corb/rirb problem
Klakap wrote:CORB/RIRB is memory aligned, LBASE register has first 7 bits hardwired to zero.Code: Select all
rirb_base = (uintptr_t)get_physical_address((uint64_t)_ihd_audio.rirb); _aud_outl_(RIRBLBASE, rirb_base); _aud_outl_(RIRBUBASE, rirb_base >> 32);
You have to wait a little between these commands, and you have to be sure that CORB RP set bit 15 after first command and that bit 15 is clear after second command.Code: Select all
_aud_outw_ (CORBRP, 0x8000); _aud_outw_ (CORBRP, 0x0);
Also it is important that in RIRB you receive 8 bytes, from whose is first dword response to verb.
Thank you so much for your reply, It's still not working, I get 0 response. If I use immediate commands interface, I get response only in qemu not in virtual box.
Re: Hd-Audio corb/rirb problem
Because you set CORB write pointer to 0, you have to write first command to CORB entry 1, then increase CORB write pointer to 1 and read response from RIRB entry 1. (by CORB entry 1 I mean CORB_MEMORY+4 bytes and by RIRB entry 1 RIRB_MEMORY+8 bytes)
Re: Hd-Audio corb/rirb problem
Thank you so much for pointing my mistake, now I get response from hd audio controller. In qemu I found one audio output, and in virtual box I found three audio output.Klakap wrote:Because you set CORB write pointer to 0, you have to write first command to CORB entry 1, then increase CORB write pointer to 1 and read response from RIRB entry 1. (by CORB entry 1 I mean CORB_MEMORY+4 bytes and by RIRB entry 1 RIRB_MEMORY+8 bytes)
Re: Hd-Audio corb/rirb problem
Sorry!!..again I was doing wrong, I was not iterating through num_widgets. Now I get one audio output, one audio input and two pin complex in qemu and one audio output in virtual box. Once again, thank you so muchKamal123 wrote:Thank you so much for pointing my mistake, now I get response from hd audio controller. In qemu I found one audio output, and in virtual box I found three audio output.Klakap wrote:Because you set CORB write pointer to 0, you have to write first command to CORB entry 1, then increase CORB write pointer to 1 and read response from RIRB entry 1. (by CORB entry 1 I mean CORB_MEMORY+4 bytes and by RIRB entry 1 RIRB_MEMORY+8 bytes)
Re: Hd-Audio corb/rirb problem
Hi, i found a problem with virtual box, seems that virtual box don't update corb read pointer.. I send verb after increasing the corb write pointer. But virtual box keeps the corb read pointer in between 0 and 1.
Re: Hd-Audio corb/rirb problem
Ok, it's working now, corb dma engine was not started properly, I was using _aud_outl_ instead of _aud_outb_, since corbctl is 1 byte in size. Now, I am getting list of widgets in virtual box, with vendor I'd 8384.
My code -> https://github.com/manaskamal/aurora-xe ... da/hda.cpp
My code -> https://github.com/manaskamal/aurora-xe ... da/hda.cpp