Skip to content

Conversation

@johnylin76
Copy link
Contributor

commit message

At present, dax instance is initialized and allocated inner buffer on module_init(), and released on module_free(). The memory requirement for the inner buffer per instance is quite large.

The existing implementation has 2 pipelines containing dax. Even though the host is restricted from processing stream on both pipelines simultaneously, they may coexist with each other under some circumstances e.g. the interim when switching PCM device from one to the other, which may drain out the memory.

This commit changes the timing of instance allocation/deallocation to module_prepare()/reset() respectively. That is, dax instance only occupies the inner buffer memory when processing.

This commit is to fix the following bug on the targeting Google device:

bug report

Steps to Reproduce:

  1. Play audio file.
  2. Plug headphone/headset in system.
  3. Check sound output from headphone/ headset.
  4. Change output to internal speaker.
  5. Check sound output from internal speaker.

Expected behavior:
Switch to the internal speaker output with sound,when connecting headphones to play music.

What do you see instead?
Switch to the internal speaker output without sound,when connecting headphones to play music.

Fail rate:
2 out of 2 units,6 out of 40 Times

At present, dax instance is initialized and allocated inner buffer
on module_init(), and released on module_free(). The memory
requirement for the inner buffer per instance is quite large.

The existing implementation has 2 pipelines containing dax. Even
though the host is restricted from processing stream on both
pipelines simultaneously, they may coexist with each other under some
circumstances e.g. the interim when switching PCM device from one to
the other, which may drain out the memory.

This commit changes the timing of instance allocation/deallocation to
module_prepare()/reset() respectively. That is, dax instance only
occupies the inner buffer memory when processing.

Signed-off-by: Johny Lin <johnylin@google.com>
@johnylin76
Copy link
Contributor Author

Will need review by Dolby folks @checkupup

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnylin76 IIUC, you have 2 pipelines today, each with a DAX instance that allocates a large inner buffer. I'm not following why this fixes your issue, I can only assume that this change only allocates 1 mutually exclusive inner buffer as perhaps allocating > 1 inner buffer was failing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants