Skip to content

Instantly share code, notes, and snippets.

@mcejp
Created November 22, 2020 17:12
Show Gist options
  • Save mcejp/db709bfcd4c812eba48068be3a7b9736 to your computer and use it in GitHub Desktop.
Save mcejp/db709bfcd4c812eba48068be3a7b9736 to your computer and use it in GitHub Desktop.
Enabling audio output for Arm versatilepb machine in QEMU

Add this to the QEMU command line: -usb -device usb-audio

In VM:

$ nano /etc/asound.conf

pcm.!default {
    type plug
    slave {
            pcm "hw:1,0"
    }
}

ctl.!default {
    type hw
    card 1
}


$ lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 46f4:0002

$ aplay /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

$ aplay -l
 List of PLAYBACK Hardware Devices 
card 1: Audio [QEMU USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment