Repository navigation
ASoC: SOF: add sof vBE and vFE support - #142
Conversation
lgirdwood
left a comment
There was a problem hiding this comment.
Can you update C files where possible with runtime checks for vfe or vbe and resend (using same PR)
There was a problem hiding this comment.
Why do we need this ? If it's for tmp debug then lets put a big comment here stating it's tmp debug for feature XXX and will be removed.
There was a problem hiding this comment.
This is a tmp solution for BE link. I will change it to a new solution with the new topology mode later.
There was a problem hiding this comment.
As suggested on V3, lets use a runtime sdev->is_vfe or sdev->is_vbe to select this code at runtime. These states will be set at probe() time.
There was a problem hiding this comment.
Although we can use such flag to judge whether it is vFE or not, we still need such '#ifdef' because acrn has compile conflict as you know. We have already talked about that before. vFE and vBE must use such '#ifdef' to avoid the compiling error. After acrn has fixed these issues, I will switch to flag and remove the '#ifdef'
There was a problem hiding this comment.
@libinyang the point I'm making is that we only use the ifdef in as few places as possible. To minimize the contamination.
There was a problem hiding this comment.
so this looks like a boolean ? fedev should be "is_vfe"
There was a problem hiding this comment.
So the above ifdef could be replaced with if (sdev->is_vbe) and then the assignement above could be static inline within the header VBE section. Just trying to eliminate all the ifdefs in common code and keeping it to header and one other place.
|
@lgirdwood |
lgirdwood
left a comment
There was a problem hiding this comment.
@libinyang getting close, but I need to see comments on each conditional piece of code so that anyone can understand each descision the code is making. Some funcs have this but some functions dont have any comments at all.
There was a problem hiding this comment.
I think we only need to do this if vBE support has been selected by kconfig ?
There was a problem hiding this comment.
Yes. And I define static inline function to do nothing in the header file if vBE is not selected.
There was a problem hiding this comment.
ok, change comment to "optionally register virtio miscdev "
There was a problem hiding this comment.
I just need ?* optionally register virtio miscdev */ here, the remaining comment detail can go in sof_virtio_miscdev_register()
There was a problem hiding this comment.
do we always need to do this ? - we have three operating modes, VBE, VFE and standalone. sure we dont need to always do this ?
There was a problem hiding this comment.
This function is also defined to update the position only in vBE. It will do nothing in standalone and vFE.
There was a problem hiding this comment.
ok, change comment to "optionally update position for vBE". Also func prefix should be sof_vbe_
|
@lgirdwood |
There was a problem hiding this comment.
Why do we need raw when this in in the type enum ? The requester would send a request SOF_IPC_TPLG_REQUEST and fill in the type, the replier would then reply with the data or an error.
There was a problem hiding this comment.
This is added in your commit: aebf20cc in very-clean branch. What I guess is that we will use it later for FW transition. As We don't use it currently, I will remove it.
There was a problem hiding this comment.
ok, change comment to "optionally register virtio miscdev "
There was a problem hiding this comment.
ok, change comment to "optionally update position for vBE". Also func prefix should be sof_vbe_
|
patch updated based on Liam's comments. |
lgirdwood
left a comment
There was a problem hiding this comment.
Mainly cosmetic changes needed now.
There was a problem hiding this comment.
Can this whole vFE init be placed in sof_virtio_vfe_init(sdev) and be placed after all the list heads are initialised.
There was a problem hiding this comment.
This comment uses magic numbers whence we should be using macros
There was a problem hiding this comment.
I just need ?* optionally register virtio miscdev */ here, the remaining comment detail can go in sof_virtio_miscdev_register()
There was a problem hiding this comment.
fix line length - which userspace API doe this use - Pls add link.
There was a problem hiding this comment.
I don't understand this comment. What shall I do here? Make the line shorter?
There was a problem hiding this comment.
these static func declarations can be deleted if the functions are moved further up the file
There was a problem hiding this comment.
no need for the snd_ prefix as this is static and only used here.
commented
Oct 17, 2018
|
updated based on Liam's comments |
There was a problem hiding this comment.
A new line should always precede a comment to make it obvious where the comment applies and to break the code into easier to follow blocks. This need fixed in several places.
There was a problem hiding this comment.
indentation of variable names - some members use a tab and others a space in this struct.
There was a problem hiding this comment.
got it. I misunderstood your meaning last time.
There was a problem hiding this comment.
system includes should precede local includes
This patch adds the sof virtio BE and FE support. It will create a dev node for the communication to the userspace. It also handles the virtio vq event. It dispatches the different vq kicks to different handlers. In the virtio vq handling, it handles all the ipc events from vFE. When there is position update from FW, it will check whether there is an available entry in notification vq. If yes, send the position update notification immediately. If there is no available entry, add the position update event in a list. As soon as the notification vq has an available entry, send the position update to the vFE. For vFE, it will create a virtual audio device driver and communite with vBE audio driver to create PCMs and playback/capture streams. Signed-off-by: Libin Yang <libin.yang@intel.com>
commented
Oct 18, 2018
|
@lgirdwood |
This patch adds the sof virtio BE and FE support.
It will create a dev node for the communication to the userspace.
It also handles the virtio vq event. It dispatches the different
vq kicks to different handlers. In the virtio vq handling, it handles
all the ipc events from vFE.
When there is position update from FW, it will check whether there is
an available entry in notification vq. If yes, send the position update
notification immediately. If there is no available entry, add the position
update event in a list. As soon as the notification vq has an available
entry, send the position update to the vFE.
For vFE, it will create a virtual audio device driver and communite with
vBE audio driver to create PCMs and playback/capture streams.
Signed-off-by: Libin Yang libin.yang@intel.com