mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
audio: audiodev= parameters no longer optional when -audiodev present
This means you should probably stop using -soundhw (as it doesn't allow you to specify any options) and add the device manually with -device. The exception is pcspk, it's currently not possible to manually add it. To use it with audiodev, use something like this: -audiodev id=foo,... -global isa-pcspk.audiodev=foo -soundhw pcspk Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 9072b955acffda13976bca7b61f86d7f708c9269.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
9d34e6d8a1
commit
af2041ed2d
|
@ -101,6 +101,8 @@ const struct mixeng_volume nominal_volume = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static bool legacy_config = true;
|
||||||
|
|
||||||
#ifdef AUDIO_IS_FLAWLESS_AND_NO_CHECKS_ARE_REQURIED
|
#ifdef AUDIO_IS_FLAWLESS_AND_NO_CHECKS_ARE_REQURIED
|
||||||
#error No its not
|
#error No its not
|
||||||
#else
|
#else
|
||||||
|
@ -1394,7 +1396,7 @@ static AudiodevListEntry *audiodev_find(
|
||||||
* if dev == NULL => legacy implicit initialization, return the already created
|
* if dev == NULL => legacy implicit initialization, return the already created
|
||||||
* state or create a new one
|
* state or create a new one
|
||||||
*/
|
*/
|
||||||
static AudioState *audio_init(Audiodev *dev)
|
static AudioState *audio_init(Audiodev *dev, const char *name)
|
||||||
{
|
{
|
||||||
static bool atexit_registered;
|
static bool atexit_registered;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -1408,12 +1410,13 @@ static AudioState *audio_init(Audiodev *dev)
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
/* -audiodev option */
|
/* -audiodev option */
|
||||||
|
legacy_config = false;
|
||||||
drvname = AudiodevDriver_str(dev->driver);
|
drvname = AudiodevDriver_str(dev->driver);
|
||||||
} else if (!QTAILQ_EMPTY(&audio_states)) {
|
} else if (!QTAILQ_EMPTY(&audio_states)) {
|
||||||
/*
|
if (!legacy_config) {
|
||||||
* todo: check for -audiodev once we have normal audiodev selection
|
dolog("You must specify an audiodev= for the device %s\n", name);
|
||||||
* support
|
exit(1);
|
||||||
*/
|
}
|
||||||
return QTAILQ_FIRST(&audio_states);
|
return QTAILQ_FIRST(&audio_states);
|
||||||
} else {
|
} else {
|
||||||
/* legacy implicit initialization */
|
/* legacy implicit initialization */
|
||||||
|
@ -1520,7 +1523,7 @@ void audio_free_audiodev_list(AudiodevListHead *head)
|
||||||
void AUD_register_card (const char *name, QEMUSoundCard *card)
|
void AUD_register_card (const char *name, QEMUSoundCard *card)
|
||||||
{
|
{
|
||||||
if (!card->state) {
|
if (!card->state) {
|
||||||
card->state = audio_init(NULL);
|
card->state = audio_init(NULL, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
card->name = g_strdup (name);
|
card->name = g_strdup (name);
|
||||||
|
@ -1546,8 +1549,11 @@ CaptureVoiceOut *AUD_add_capture(
|
||||||
struct capture_callback *cb;
|
struct capture_callback *cb;
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
/* todo: remove when we have normal audiodev selection support */
|
if (!legacy_config) {
|
||||||
s = audio_init(NULL);
|
dolog("You must specify audiodev when trying to capture\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
s = audio_init(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (audio_validate_settings (as)) {
|
if (audio_validate_settings (as)) {
|
||||||
|
@ -1778,7 +1784,7 @@ void audio_init_audiodevs(void)
|
||||||
AudiodevListEntry *e;
|
AudiodevListEntry *e;
|
||||||
|
|
||||||
QSIMPLEQ_FOREACH(e, &audiodevs, next) {
|
QSIMPLEQ_FOREACH(e, &audiodevs, next) {
|
||||||
audio_init(e->dev);
|
audio_init(e->dev, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue