mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 10:32:10 +00:00
devices: virtio: snd: Add 4/6 channel playback support
ARCVM is using 4 ch with chmap {FL, FR, RL, RR}. Borealis is using 6 ch with chmap {FL, FR, FC, LFE, RL, RR}. From amixer we should see ``` localhost / # amixer -c0 cget numid=1 numid=1,iface=PCM,name='Playback Channel Map' ; type=INTEGER,access=r----R--,values=6,min=0,max=36,step=0 : values=0,0,0,0,0,0 | container | chmap-fixed=FL,FR | chmap-fixed=FL,FR,RL,RR | chmap-fixed=FL,FR,FC,LFE,RL,RR ``` BUG=b:199001477 BUG=b:201382814 TEST=`amixer -c0 cget numid=1` TEST=alsa_conformance_test -Phw:0,0 -c 4 TEST=alsa_conformance_test -Phw:0,0 -c 6 Change-Id: I6b8a6e4a637fe0413ba9b8d91727bf5c4ee8cd26 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3331977 Reviewed-by: Woody Chow <woodychow@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
This commit is contained in:
parent
34b48775ab
commit
9ec39843ed
1 changed files with 24 additions and 2 deletions
|
@ -462,7 +462,7 @@ pub fn hardcoded_virtio_snd_config(params: &Parameters) -> virtio_snd_config {
|
||||||
virtio_snd_config {
|
virtio_snd_config {
|
||||||
jacks: 0.into(),
|
jacks: 0.into(),
|
||||||
streams: (params.num_output_streams + params.num_input_streams).into(),
|
streams: (params.num_output_streams + params.num_input_streams).into(),
|
||||||
chmaps: 2.into(),
|
chmaps: 4.into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ fn hardcoded_snd_data(params: &Parameters) -> SndData {
|
||||||
rates: SUPPORTED_FRAME_RATES.into(),
|
rates: SUPPORTED_FRAME_RATES.into(),
|
||||||
direction: VIRTIO_SND_D_OUTPUT,
|
direction: VIRTIO_SND_D_OUTPUT,
|
||||||
channels_min: 1,
|
channels_min: 1,
|
||||||
channels_max: 2,
|
channels_max: 6,
|
||||||
padding: [0; 5],
|
padding: [0; 5],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -522,6 +522,28 @@ fn hardcoded_snd_data(params: &Parameters) -> SndData {
|
||||||
channels: 2,
|
channels: 2,
|
||||||
positions,
|
positions,
|
||||||
});
|
});
|
||||||
|
positions[2] = VIRTIO_SND_CHMAP_RL;
|
||||||
|
positions[3] = VIRTIO_SND_CHMAP_RR;
|
||||||
|
chmap_info.push(virtio_snd_chmap_info {
|
||||||
|
hdr: virtio_snd_info {
|
||||||
|
hda_fn_nid: 0.into(),
|
||||||
|
},
|
||||||
|
direction: VIRTIO_SND_D_OUTPUT,
|
||||||
|
channels: 4,
|
||||||
|
positions,
|
||||||
|
});
|
||||||
|
positions[2] = VIRTIO_SND_CHMAP_FC;
|
||||||
|
positions[3] = VIRTIO_SND_CHMAP_LFE;
|
||||||
|
positions[4] = VIRTIO_SND_CHMAP_RL;
|
||||||
|
positions[5] = VIRTIO_SND_CHMAP_RR;
|
||||||
|
chmap_info.push(virtio_snd_chmap_info {
|
||||||
|
hdr: virtio_snd_info {
|
||||||
|
hda_fn_nid: 0.into(),
|
||||||
|
},
|
||||||
|
direction: VIRTIO_SND_D_OUTPUT,
|
||||||
|
channels: 6,
|
||||||
|
positions,
|
||||||
|
});
|
||||||
|
|
||||||
SndData {
|
SndData {
|
||||||
jack_info,
|
jack_info,
|
||||||
|
|
Loading…
Reference in a new issue