[Alsa Host] Add a default period time #431
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will accomplish two things, in addition to what the buffer
time already provides:
cpu for new audio data more often than this. Maintaining a lower
period time will create unnecessary load. This is an effect
that stacks if the alsa device is virtual (Like the pulse plugin,
which happens to have a low default period time, which stands
in stark contrast to its reportedly high buffer). Most of the
time 50ms would also work, but its better to have some fallout
protection in the default scenario
I removed the workaround introduced earlier for the second issue. While it's still not entirely clear why it should actually raise an error there if you do not first set the period time, there is something to be said for first choosing the period time in general, since it does restrict the possible buffer sizes.
Fixes #369, Fixes #391 (probably)
Now I also strongly suspect a good period time will have a positive effect for #322, but that should be verified. Since pulse appears involved I am optimistic.
EDIT: I now think that period size first is a requirement that comes with devices that require buffer sizes to be multiples of the period size. If that period size is not defined it is not yet possible to set a buffer size even though the minimum and maximum are well defined. That is probably why
set_buffer_time_nearfails.