LoginSignup
0
1

More than 1 year has passed since last update.

QEMU on WindowsでPC Speakerをエミュレートする

Last updated at Posted at 2021-10-02

-audiodev オプションと -machine オプションを利用する。

具体例

例えば、以下のようにオプションとその値を指定すると、PC Speakerがエミュレートできるようになる。

- qemu-system-i386 -drive file=./os.img,format=raw,if=floppy
+ qemu-system-i386 -drive file=./os.img,format=raw,if=floppy -audiodev dsound,id=0 -machine pcspk-audiodev=0

-audiodev オプションにはエミュレートのバックエンドで利用するオーディオを指定する。値には dsound (DirectSound)とそれを識別するためのidを指定する。ちなみにidに指定する値は文字列でもOK。

-machine にはデバイスとそれに割り当てるidを指定する。値には pcspk-audiodev=<audiodev id> を指定する。

DirectSoundCaptureの初期化エラーが発生する場合の対処

オプションとその値を適切に指定しても、以下のようなエラーが出る場合がある。

dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID

これはQEMU側の問題ではなく、Windows側の問題である可能性が高い。

例えば、 設定 アプリの システム > サウンド > 入力 の入力デバイスを選択するためのドロップダウンリストの値が「入力デバイスが見つかりません」になっているとこのエラーが発生する。

この場合は、なにかしらの音声入力デバイスをPCに接続し、 サウンドデバイスを管理する > 入力デバイス に表示されているデバイスを有効にしてあげるとエラーが消える。

Version

$ qemu-system-i386 --version
QEMU emulator version 6.1.0 (v6.1.0-11882-g7deea770bf-dirty)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1