diff options
author | Brian Daniels <briandaniels@google.com> | 2024-05-10 09:47:21 -0400 |
---|---|---|
committer | Brian Daniels <briandaniels@google.com> | 2024-05-10 09:47:21 -0400 |
commit | 7e16c8660b9806cc0ca125483fb872429bb51b83 (patch) | |
tree | b837c9b33c1eab5a9c8be25b72b1ca0bed9a0fdd | |
parent | 6a0cacb15919202347b06cf0e9eaf1ad290f7404 (diff) | |
download | car-main.tar.gz |
A start_threshold of 0 lets tinyalsa set it, which defaults to
(period_count * period_size / 2). On some hypervisors, the
virtio-snd virtual device expects a certain amount of periods
to be sent before the device is started. This change lengthens the
start_threshold to this value, which is equal to (period_count *
period_size).
Bug: 331600622
Test: Build, confirm sound plays on the device
Change-Id: I30d328b5ff2037ecc55c04d6dd0c182498065fbf
-rw-r--r-- | emulator/audio/driver/audio_hw.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/emulator/audio/driver/audio_hw.c b/emulator/audio/driver/audio_hw.c index 9f64a72..87b63ce 100644 --- a/emulator/audio/driver/audio_hw.c +++ b/emulator/audio/driver/audio_hw.c @@ -1221,6 +1221,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev, memcpy(&out->pcm_config, &pcm_config_out, sizeof(struct pcm_config)); out->pcm_config.rate = config->sample_rate; out->pcm_config.period_size = out->pcm_config.rate * get_out_period_ms() / 1000; + out->pcm_config.start_threshold = out->pcm_config.period_count * out->pcm_config.period_size; out->standby = true; out->underrun_position = 0; |