semu
semu copied to clipboard
Implement VirtIO sound device
Implement VirtIO sound device supporting these operations (the item with checked box checked means it is implemented right now):
- For setting up the device:
- [x]
VIRTIO_SND_R_JACK_INFO - [x]
VIRTIO_SND_R_PCM_INFO - [x]
VIRTIO_SND_R_CHMAP_INFO
- [x]
- For playing the sound (PCM):
- [x]
VIRTIO_SND_R_PCM_SET_PARAMS - [x]
VIRTIO_SND_R_PCM_PREPARE - [ ]
VIRTIO_SND_R_PCM_RELEASE - [ ]
VIRTIO_SND_R_PCM_START - [ ]
VIRTIO_SND_R_PCM_STOP
- [x]
Test Cases
The test cases are subjected to be altered.
boot up test
test procedures
- Execute
make checkto runsemu. - Check kernel message (
dmesg).
expected results
- The following message should appear while booting up:
[ 4.011962] ALSA device list:
[ 4.015962] #0: Loopback 1
[ 4.015962] #1: VirtIO SoundCard at platform/f4400000.virtio/virtio2
check driver configuration
test procedures
- Execute
aplay -lin emulator. - Check the output messages.
expected results
- The following message should appear after Step 1:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
<other sound device here>
card 1: SoundCard [VirtIO SoundCard], device 0: virtio-snd [VirtIO PCM 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
play sound
test procedures
- Execute
speaker-testin emulator. - Check the host speaker.
expected results
- A white noise will be played by host speaker while
speaker-testis executing.