feat: add support for sound duplex. closes #935
Passing `--sound-duplex hda-output` to quickemu will only present an audio output, but no microphine/line-in device.
This commit is contained in:
parent
48f74d2cec
commit
a0d33ca42b
18
quickemu
18
quickemu
|
@ -839,7 +839,7 @@ function vm_boot() {
|
||||||
elif [ "${sound_card}" == "none" ]; then
|
elif [ "${sound_card}" == "none" ]; then
|
||||||
SOUND=""
|
SOUND=""
|
||||||
fi
|
fi
|
||||||
echo " - Sound: ${sound_card}"
|
echo " - Sound: ${sound_card} (${sound_duplex})"
|
||||||
|
|
||||||
# Set the hostname of the VM
|
# Set the hostname of the VM
|
||||||
local NET="user,hostname=${VMNAME}"
|
local NET="user,hostname=${VMNAME}"
|
||||||
|
@ -1421,6 +1421,7 @@ function usage() {
|
||||||
echo " --mouse <type> : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'"
|
echo " --mouse <type> : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'"
|
||||||
echo " --usb-controller <type> : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'"
|
echo " --usb-controller <type> : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'"
|
||||||
echo " --sound-card <type> : Set sound card. @Options: 'intel-hda' (default), 'ac97', 'es1370', 'sb16', 'none'"
|
echo " --sound-card <type> : Set sound card. @Options: 'intel-hda' (default), 'ac97', 'es1370', 'sb16', 'none'"
|
||||||
|
echo " --sound-duplex <type> : Set sound card duplex. @Options: 'hda-micro' (default: speaker/mic), 'hda-duplex' (line-in/line-out), 'hda-output' (output-only)"
|
||||||
echo " --extra_args <arguments> : Pass additional arguments to qemu"
|
echo " --extra_args <arguments> : Pass additional arguments to qemu"
|
||||||
echo " --version : Print version"
|
echo " --version : Print version"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1438,6 +1439,13 @@ function sound_card_param_check() {
|
||||||
echo "ERROR! Requested sound card '${sound_card}' is not recognised."
|
echo "ERROR! Requested sound card '${sound_card}' is not recognised."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
#name "hda-duplex", bus HDA, desc "HDA Audio Codec, duplex (line-out, line-in)"
|
||||||
|
#name "hda-micro", bus HDA, desc "HDA Audio Codec, duplex (speaker, microphone)"
|
||||||
|
#name "hda-output", bus HDA, desc "HDA Audio Codec, output-only (line-out)"
|
||||||
|
if [ "${sound_duplex}" != "hda-duplex" ] && [ "${sound_duplex}" != "hda-micro" ] && [ "${sound_duplex}" != "hda-output" ]; then
|
||||||
|
echo "ERROR! Requested sound duplex '${sound_duplex}' is not recognised."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function viewer_param_check() {
|
function viewer_param_check() {
|
||||||
|
@ -1553,6 +1561,7 @@ keyboard_layout="${keyboard_layout:-en-us}"
|
||||||
mouse="${mouse:-tablet}"
|
mouse="${mouse:-tablet}"
|
||||||
# options: intel-hda, ac97, es1370, sb16, none
|
# options: intel-hda, ac97, es1370, sb16, none
|
||||||
sound_card="${sound_card:-intel-hda}"
|
sound_card="${sound_card:-intel-hda}"
|
||||||
|
sound_duplex="${sound_duplex:-hda-micro}"
|
||||||
|
|
||||||
ACCESS=""
|
ACCESS=""
|
||||||
ACTIONS=()
|
ACTIONS=()
|
||||||
|
@ -1709,6 +1718,9 @@ else
|
||||||
-sound-card|--sound-card)
|
-sound-card|--sound-card)
|
||||||
sound_card="${2}"
|
sound_card="${2}"
|
||||||
shift 2;;
|
shift 2;;
|
||||||
|
-sound-duplex|--sound-duplex)
|
||||||
|
sound_duplex="${2}"
|
||||||
|
shift 2;;
|
||||||
-version|--version)
|
-version|--version)
|
||||||
echo "${VERSION}"
|
echo "${VERSION}"
|
||||||
exit;;
|
exit;;
|
||||||
|
@ -1782,7 +1794,9 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then
|
||||||
if [ -n "${BRAILLE}" ]; then
|
if [ -n "${BRAILLE}" ]; then
|
||||||
display="sdl"
|
display="sdl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
display_param_check
|
display_param_check
|
||||||
|
sound_card_param_check
|
||||||
viewer_param_check
|
viewer_param_check
|
||||||
|
|
||||||
# Set the default 3D acceleration.
|
# Set the default 3D acceleration.
|
||||||
|
@ -1833,8 +1847,6 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sound_card_param_check
|
|
||||||
|
|
||||||
# Check if vm is already run
|
# Check if vm is already run
|
||||||
VM_PID=""
|
VM_PID=""
|
||||||
if [ -r "${VMDIR}/${VMNAME}.pid" ]; then
|
if [ -r "${VMDIR}/${VMNAME}.pid" ]; then
|
||||||
|
|
Loading…
Reference in New Issue