Giter Club home page Giter Club logo

Comments (2)

main-- avatar main-- commented on June 17, 2024

Want want want! For reference purposes:

$ qemu-system-x86_64 -audio-help
Audio options:
  QEMU_AUDIO_DAC_FIXED_SETTINGS: boolean, default = 1
    Use fixed settings for host DAC
  QEMU_AUDIO_DAC_FIXED_FREQ: integer, default = 44100
    Frequency for fixed host DAC
  QEMU_AUDIO_DAC_FIXED_FMT: format, default = S16, (one of: U8 S8 U16 S16 U32 S32)
    Format for fixed host DAC
  QEMU_AUDIO_DAC_FIXED_CHANNELS: integer, default = 2
    Number of channels for fixed DAC (1 - mono, 2 - stereo)
  QEMU_AUDIO_DAC_VOICES: integer, default = 1
    Number of voices for DAC
  QEMU_AUDIO_DAC_TRY_POLL: boolean, default = 1
    Attempt using poll mode for DAC
  QEMU_AUDIO_ADC_FIXED_SETTINGS: boolean, default = 1
    Use fixed settings for host ADC
  QEMU_AUDIO_ADC_FIXED_FREQ: integer, default = 44100
    Frequency for fixed host ADC
  QEMU_AUDIO_ADC_FIXED_FMT: format, default = S16, (one of: U8 S8 U16 S16 U32 S32)
    Format for fixed host ADC
  QEMU_AUDIO_ADC_FIXED_CHANNELS: integer, default = 2
    Number of channels for fixed ADC (1 - mono, 2 - stereo)
  QEMU_AUDIO_ADC_VOICES: integer, default = 1
    Number of voices for ADC
  QEMU_AUDIO_ADC_TRY_POLL: boolean, default = 1
    Attempt using poll mode for ADC
  QEMU_AUDIO_TIMER_PERIOD: integer, default = 100
    Timer period in HZ (0 - use lowest possible)

Available drivers:
Name: spice
Description: spice audio driver
One playback voice
One capture voice
Options:

Name: pa
Description: http://www.pulseaudio.org/
Theoretically supports many playback voices
Theoretically supports many capture voices
Options:
  QEMU_PA_SAMPLES: integer, default = 4096
    buffer size in samples
  QEMU_PA_SERVER: string, default = (not set)
    server address
  QEMU_PA_SINK: string, default = (not set)
    sink device name
  QEMU_PA_SOURCE: string, default = (not set)
    source device name

Name: alsa
Description: ALSA http://www.alsa-project.org
Theoretically supports many playback voices
Theoretically supports many capture voices
Options:
  QEMU_ALSA_DAC_SIZE_IN_USEC: boolean, default = 0
    DAC period/buffer size in microseconds (otherwise in frames)
  QEMU_ALSA_DAC_PERIOD_SIZE: integer, default = 1024
    DAC period size (0 to go with system default)
  QEMU_ALSA_DAC_BUFFER_SIZE: integer, default = 4096
    DAC buffer size (0 to go with system default)
  QEMU_ALSA_ADC_SIZE_IN_USEC: boolean, default = 0
    ADC period/buffer size in microseconds (otherwise in frames)
  QEMU_ALSA_ADC_PERIOD_SIZE: integer, default = 0
    ADC period size (0 to go with system default)
  QEMU_ALSA_ADC_BUFFER_SIZE: integer, default = 0
    ADC buffer size (0 to go with system default)
  QEMU_ALSA_THRESHOLD: integer, default = 0
    (undocumented)
  QEMU_ALSA_DAC_DEV: string, default = default
    DAC device name (for instance dmix)
  QEMU_ALSA_ADC_DEV: string, default = default
    ADC device name

Name: sdl
Description: SDL http://www.libsdl.org
One playback voice
Does not support capture
Options:
  QEMU_SDL_SAMPLES: integer, default = 1024
    Size of SDL buffer in samples

Name: none
Description: Timer based audio emulation
Theoretically supports many playback voices
Theoretically supports many capture voices
No options

Name: wav
Description: WAV renderer http://wikipedia.org/wiki/WAV
One playback voice
Does not support capture
Options:
  QEMU_WAV_FREQUENCY: integer, default = 44100
    Frequency
  QEMU_WAV_FORMAT: format, default = S16, (one of: U8 S8 U16 S16 U32 S32)
    Format
  QEMU_WAV_DAC_FIXED_CHANNELS: integer, default = 2
    Number of channels (1 - mono, 2 - stereo)
  QEMU_WAV_PATH: string, default = qemu.wav
    Path to wave file

Options are settable through environment variables.
Example:
  export QEMU_AUDIO_DRV=wav
  export QEMU_WAV_PATH=$HOME/tune.wav
(for csh replace export with setenv in the above)
  qemu ...

There's A LOT to configure here. The only audio drivers we can reasonably offer are ALSA and pulse but while pulse tends to work fine with default settings (but has the input-delay bug), ALSA is ridiculously hard to get right. And by ridiculously hard I mean that literally nobody in the whole world knows what any of these options really do and everybody just copy-pastes random shit from each other on some mailing lists and forums and then arbitrarily fiddles with it for a while until it either works or you give up.

For instance, this is what I'm using right now:

QEMU_ALSA_ADC_BUFFER_SIZE=512 QEMU_ALSA_ADC_PERIOD_SIZE=170 QEMU_AUDIO_ADC_TRY_POLL=1 QEMU_AUDIO_ADC_FIXED_CHANNELS=1 QEMU_AUDIO_ADC_FIXED_FMT=U16 QEMU_AUDIO_ADC_FIXED_FREQ=48000 QEMU_AUDIO_ADC_FIXED_SETTINGS=1 QEMU_ALSA_DAC_BUFFER_SIZE=512 QEMU_ALSA_DAC_PERIOD_SIZE=170 QEMU_AUDIO_DAC_FIXED_FMT=U16 QEMU_AUDIO_DAC_FIXED_FREQ=48000 QEMU_AUDIO_DAC_FIXED_SETTINGS=1 QEMU_AUDIO_DRV=alsa

It was clearly inspired by the fact that JACK strongly prefers 48KHz while Windows pretty much refuses to work with anything except U16 but that's all I know - well that and the fact that it falls apart whenever I just slightly change anything at all.

from windows-gaming.

oberien avatar oberien commented on June 17, 2024

I wasn't able to correctly configure alsa with qemu and jack, it always had very bad crackling.

So I'm defaulting to pulseaudio, which unfortunately qemu has a bug with: Pulse uses a ringbuffer for its input and output devices. Qemu only reads from the input device when Windows requests it. The ringbuffer per default contains about 20s, which means that every microphone input will be delayed by 20 seconds to Windows.

There is a patch for qemu making it always read from the end from the ringbuffer. Further information can be found in this thread.

from windows-gaming.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.