Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
Update host position value in every period to improve precision#5137
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -76,6 +76,7 @@ struct host_data { | ||
| uint32_t host_period_bytes; | ||
| uint16_t stream_tag; | ||
| uint16_t no_stream_position; /**< 1 means don't send stream position */ | ||
| uint8_t cont_update_posn; /**< 1 means continuous update stream position */ | ||
kv2019i marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /* host component attributes */ | ||
| enum comp_copy_type copy_type; /**< Current host copy type */ | ||
| @@ -307,6 +308,8 @@ static void host_update_position(struct comp_dev *dev, uint32_t bytes) | ||
| struct comp_buffer *source; | ||
| struct comp_buffer *sink; | ||
| int ret; | ||
| bool update_mailbox = false; | ||
| bool send_ipc = false; | ||
dbaluta marked this conversation as resolved.
Outdated
Uh oh!There was an error while loading. Please reload this page. | ||
| if (dev->direction == SOF_IPC_STREAM_PLAYBACK) | ||
| @@ -345,6 +348,8 @@ static void host_update_position(struct comp_dev *dev, uint32_t bytes) | ||
| #else | ||
| hd->local_pos = 0; | ||
| #endif | ||
| if (hd->cont_update_posn) | ||
| update_mailbox = true; | ||
| /* Don't send stream position if no_stream_position == 1 */ | ||
| if (!hd->no_stream_position) { | ||
| @@ -361,12 +366,18 @@ static void host_update_position(struct comp_dev *dev, uint32_t bytes) | ||
| /* send timestamped position to host | ||
| * (updates position first, by calling ops.position()) | ||
| */ | ||
| pipeline_get_timestamp(dev->pipeline, dev, &hd->posn); | ||
| mailbox_stream_write(dev->pipeline->posn_offset, | ||
| &hd->posn, sizeof(hd->posn)); | ||
| ipc_msg_send(hd->msg, &hd->posn, false); | ||
| update_mailbox = true; | ||
| send_ipc = true; | ||
| } | ||
| } | ||
| if (update_mailbox) { | ||
| pipeline_get_timestamp(dev->pipeline, dev, &hd->posn); | ||
| mailbox_stream_write(dev->pipeline->posn_offset, | ||
| &hd->posn, sizeof(hd->posn)); | ||
| if (send_ipc) | ||
| ipc_msg_send(hd->msg, &hd->posn, false); | ||
| } | ||
| } | ||
| /* The host memory is not guaranteed to be continuous and also not guaranteed | ||
| @@ -761,6 +772,7 @@ static int host_params(struct comp_dev *dev, | ||
| hd->stream_tag = params->stream_tag; | ||
| hd->no_stream_position = params->no_stream_position; | ||
| hd->host_period_bytes = params->host_period_bytes; | ||
| hd->cont_update_posn = params->cont_update_posn; | ||
| /* retrieve DMA buffer address alignment */ | ||
| err = dma_get_attribute(hd->dma, DMA_ATTR_BUFFER_ADDRESS_ALIGNMENT, | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -29,8 +29,8 @@ | ||
| /** \brief SOF ABI version major, minor and patch numbers */ | ||
| #define SOF_ABI_MAJOR 3 | ||
| #define SOF_ABI_MINOR 20 | ||
| #define SOF_ABI_PATCH 1 | ||
| #define SOF_ABI_MINOR 21 | ||
| #define SOF_ABI_PATCH 0 | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yaochunhung@lgirdwood what is SOF_ABI_PATCH and why is decremented? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| /** \brief SOF ABI version number. Format within 32bit word is MMmmmppp */ | ||
| #define SOF_ABI_MAJOR_SHIFT 24 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -193,6 +193,7 @@ static int ipc_stream_pcm_params(uint32_t stream) | ||
| struct sof_ipc_pcm_params pcm_params; | ||
| struct sof_ipc_pcm_params_reply reply; | ||
| struct ipc_comp_dev *pcm_dev; | ||
| struct sof_ipc_stream_posn posn; | ||
| int err, reset_err; | ||
| /* copy message with ABI safe method */ | ||
| @@ -299,6 +300,11 @@ static int ipc_stream_pcm_params(uint32_t stream) | ||
| reply.rhdr.error = 0; | ||
| reply.comp_id = pcm_params.comp_id; | ||
| reply.posn_offset = pcm_dev->cd->pipeline->posn_offset; | ||
| /* reset position value before send ipc */ | ||
| memset(&posn, 0, sizeof(posn)); | ||
| mailbox_stream_write(reply.posn_offset, &posn, sizeof(posn)); | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you describe in which situations you see invalid position data being delivered to Linux?
| ||
| mailbox_hostbox_write(0, &reply, sizeof(reply)); | ||
| return 1; | ||
Uh oh!
There was an error while loading. Please reload this page.