ohci: set effectively usb frame rate to 1kHz
commita60f39a4681b369bdcc78a9d1a1067d4a6bb8736
authorMiguel GAIO <mgaio35@gmail.com>
Thu, 27 Sep 2018 15:19:36 +0000 (27 17:19 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 1 Oct 2018 08:49:54 +0000 (1 10:49 +0200)
tree6b5682cf2243b07b602c7fbd0322da274e06a9de
parent3e9191acb797e4298adb853bf6c75cd31af47ef9
ohci: set effectively usb frame rate to 1kHz

USB frame rate is slightly lower than 1kHz: ie. ~950Hz.
Thus usb-audio device is not able to perform a simple audio playback
without underruns on audio backend.
eg. "-device pci-ohci,id=ohci -device usb-audio,bus=ohci.0" vs PulseAudio
backend. more than 50 underruns are observed per second.

Update ohci_sof_time computation, using QEMU_CLOCK_VIRTUAL in
ohci_usb_start(), and increment by usb_frame_time in ohci_sof()
makes USB frame rate close to 1kHz.
This way, no audio underrun are observed during audio playback.

Signed-off-by: Miguel GAIO <mgaio35@gmail.com>
Message-Id: <20180927151936.3647-1-mgaio35@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-ohci.c