Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


mercredi 7 octobre 2015

ReactOS 0.4 svn - Qemu 2.4.0.1 + KVM (Tests: Sound AC97 / SMPlayer / Firefox / Opera)

Youtube video

Referring to ReactOS SVN repository I used revision = 69458 for this VM. As quoted from ReactOS Wiki, sound can work only once :(. But at least I can play one video

Script used for this VM

number=69458	
#number=69461

#version=dbg
version=rel

driver="ac97"
#driver="es1370"

# For ES1370
[ "${driver}" = "es1370" ] && {
	echo "AUDIO DRIVER = ${driver}";
	export QEMU_AUDIO_DRV=alsa;
	export QEMU_AUDIO_TIMER_PERIOD=0;
	export QEMU_AUDIO_DAC_FIXED_CHANNELS=2;
	export QEMU_ALSA_DAC_SIZE_IN_USEC=1;
	export QEMU_ALSA_ADC_SIZE_IN_USEC=1;
	export QEMU_ALSA_ADC_BUFFER_SIZE=2176;
}

# For AC97
[ "${driver}" = "ac97" ] && {
	echo "AUDIO DRIVER = ${driver}";
	export QEMU_AUDIO_DRV=alsa;
	export QEMU_ALSA_DAC_SIZE_IN_USEC=1;
	export QEMU_ALSA_DAC_BUFFER_SIZE=4353 ;
	export QEMU_AUDIO_TIMER_PERIOD=100;  
	export QEMU_AUDIO_DAC_FIXED_CHANNELS=1; 
}



/opt/qemu/2.4.0.1/bin/qemu-system-i386  --enable-kvm  \
	-cpu host -m 2047 -smp  4,sockets=1,cores=4,threads=1 \
	-drive file=/dev/xen-vg/React_OS,if=ide,index=0,media=disk,format=raw,cache=writeback \
        --cdrom /opt/CD_DVD_ISO/ReactOS/bootcd-${number}-${version}.iso  \
	-boot order=cd -vga std -global VGA.vgamem_mb=32 -localtime   \
	-net nic,model=rtl8139 -net bridge,br=br0,helper=/opt/qemu/2.4.0.1/libexec/qemu-bridge-helper \
	-soundhw ${driver}  \
	-writeconfig /root/qemu-2.4.0.1_reactos.conf

Options I used for Qemu 2.4.0.1

I wrote this post so I remember which options I used for Qemu.

Options to build

./configure --prefix=/opt/qemu/2.4.0.1/ --sysconfdir=/opt/qemu/2.4.0.1/etc/ --target-list=arm-softmmu,i386-softmmu,x86_64-softmmu \
--enable-kvm --enable-uuid --enable-virtfs --enable-libnfs --enable-libusb --enable-lzo --enable-bzip2 --enable-libiscsi --enable-attr --enable-libssh2 \
--enable-numa --enable-system --enable-guest-base --enable-guest-agent --audio-drv-list=alsa,pa,sdl --enable-cap-ng --enable-modules --enable-netmap \
--enable-user --enable-linux-user --extra-cflags=-I/opt/Sources/QEMU/netmap/sys/ --enable-tcmalloc --enable-gcov --enable-usb-redir --enable-tcg-interpreter \
--enable-xfsctl --enable-gprof --enable-profiler

Network (bridge mode)

I had to add this paramter to /etc/sysctl.conf file (Allow the host system to forward IP packets)
echo "# Require for QEMU/KVM" >> /etc/sysctl.conf
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
To take into account this parameter above without rebooting
sudo sysctl -p
Here is my /etc/network/interfaces file
root@amdgaming:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual


#################
# bridge + dhcp #
#################
auto br0
iface br0 inet dhcp
	bridge_ports eth0
        bridge_stp off
        bridge_fd off
        bridge_maxwait 0
After that
mkdir -pv /opt/qemu/2.4.0.1/etc/qemu/
echo "allow br0" > /opt/qemu/2.4.0.1/etc/qemu/bridge.conf

mardi 6 octobre 2015

QEMU 2.4.0.1 - Audio help

1. About options

Options are settable through environment variables.

Example:
  export QEMU_AUDIO_DRV=wav
  export QEMU_WAV_PATH=$HOME/tune.wa
v (for csh replace export with setenv in the above)
  qemu ...

2. Audio options

ParameterTypeDefault ValueDescription
QEMU_AUDIO_DAC_FIXED_SETTINGSboolean1Use fixed settings for host DAC
QEMU_AUDIO_DAC_FIXED_FREQinteger44100Frequency for fixed host DAC
QEMU_AUDIO_DAC_FIXED_FMTformat S16 One ofU8 S8 U16 S16 U32 S32 - Format for fixed host DAC
QEMU_AUDIO_DAC_FIXED_CHANNELSinteger 2 Number of channels for fixed DAC (1 - mono,2 - stereo)
QEMU_AUDIO_DAC_VOICESinteger1Number of voices for DAC
QEMU_AUDIO_DAC_TRY_POLLboolean1Attempt using poll mode for DAC
QEMU_AUDIO_ADC_FIXED_SETTINGSboolean1Use fixed settings for host ADC
QEMU_AUDIO_ADC_FIXED_FREQinteger44100Frequency for fixed host ADC
QEMU_AUDIO_ADC_FIXED_FMTformat S16 One of U8 S8 U16 S16 U32 S32 - Format for fixed host ADC
QEMU_AUDIO_ADC_FIXED_CHANNELSinteger 2Number of channels for fixed ADC (1 - mono , 2 - stereo)
QEMU_AUDIO_ADC_VOICESinteger 1Number of voices for ADC
QEMU_AUDIO_ADC_TRY_POLLboolean 1Attempt using poll mode for ADC
QEMU_AUDIO_TIMER_PERIODinteger 100Timer period in HZ (0 - use lowest possible)

3. Available drivers:

3.a) ALSA

Description: ALSA http://www.alsa-project.org

  • Theoretically supports many playback voices
  • Theoretically supports many capture voices.
ParameterTypeDefault ValueDescription
QEMU_ALSA_DAC_SIZE_IN_USECboolean0DAC period/buffer size in microseconds (otherwise in frames)
QEMU_ALSA_DAC_PERIOD_SIZEinteger 1024DAC period size (0 to go with system default)
QEMU_ALSA_DAC_BUFFER_SIZEinteger4096DAC buffer size (0 to go with system default)
QEMU_ALSA_ADC_SIZE_IN_USECboolean 0ADC period/buffer size in microseconds (otherwise in frames)
QEMU_ALSA_ADC_PERIOD_SIZEinteger 0ADC period size (0 to go with system default)
QEMU_ALSA_ADC_BUFFER_SIZEinteger 0ADC buffer size (0 to go with system default)
QEMU_ALSA_THRESHOLDinteger0(undocumented)
QEMU_ALSA_DAC_DEVstring defaultDAC device name (for instance dmix)
QEMU_ALSA_ADC_DEVstring defaultADC device name

3.b) PA (Pulse Audio)

Name: pa Description: http://www.pulseaudio.org/

  • Theoretically supports many playback voices
  • Theoretically supports many capture voices
ParameterTypeDefault ValueDescription
QEMU_PA_SAMPLESinteger4096buffer size in samples
QEMU_PA_SERVERstring(not set)server address
QEMU_PA_SINKstring(not set)sink device name
QEMU_PA_SOURCEstring(not set)source device name

3.c) SDL

Name: sdl Description: SDL http://www.libsdl.org

  • One playback voice
  • Does not support capture
ParameterTypeDefault ValueDescription
QEMU_SDL_SAMPLESinteger 1024Size of SDL buffer in samples

3.d) None

Name: none Description: Timer based audio emulation

  • Theoretically supports many playback voices
  • Theoretically supports many capture voices
3.e) WAV

Name: wav Description: WAV renderer http://wikipedia.org/wiki/WAV

  • One playback voice
  • Does not support capture
ParameterTypeDefault ValueDescription
QEMU_WAV_FREQUENCYinteger44100Frequency
QEMU_WAV_FORMATformat S16 (one of: U8 S8 U16 S16 U32 S32) Format
QEMU_WAV_DAC_FIXED_CHANNELSinteger 2Number of channels (1 - mono, 2 - stereo)
QEMU_WAV_PATHstringqemu.wavPath to wave file

4. Help from Linux shell

Use option -audio-help to get help shown below

root@amdgaming:~# /opt/qemu/2.4.0.1/bin/qemu-system-i386 -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: 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: 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: 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 ...

dimanche 16 août 2015

Documentation for QEMU - KVM

  1. https://www.suse.com/documentation/sles11/book_kvm/data/cha_qemu_running_networking.html#cha_qemu_running_networking_bridge