Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add audio device to limayaml and qemu #1527

Merged
merged 1 commit into from
May 11, 2023
Merged

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented May 8, 2023

Tested with mikmod and https://modarchive.org/, seems to work fine (used ALSA)

Only tricky part was that the kernel module was in linux-modules-extra, then alsa

anders@lima-default:~$ sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: Generic Analog [Generic Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Closes #1526

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
audio:
# QEMU audiodev, e.g., "none", "coreaudio", "pa", "alsa", "oss".
# Choosing "none" will mute the audio output, and not play any sound.
# 🟢 Builtin default: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should be "none"

Copy link
Member Author

@afbjorklund afbjorklund May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was mostly to make it backwards-compatible, the "" means that it won't have any device at all

       -audiodev none,id=id[,prop[=value][,...]]
           Creates a dummy backend that discards all outputs.  This backend
           has no backend specific properties.

Maybe it could have been documented better, the default yaml was a bit of copy/paste from video

audiodev += fmt.Sprintf(",id=%s", id)
args = append(args, "-audiodev", audiodev)
// audio controller
args = append(args, "-device", "ich9-intel-hda")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for aarch64 and riscv64?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not had the opportunity to try it yet

Copy link
Member Author

@afbjorklund afbjorklund May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the options are there, at least (in help)

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)"
name "ich9-intel-hda", bus PCI, desc "Intel HD Audio Controller (ich9)"
name "intel-hda", bus PCI, desc "Intel HD Audio Controller (ich6)"

It (Intel HDA) was also mentioned in the man

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the v0.16.0 milestone May 9, 2023
Copy link
Member

@balajiv113 balajiv113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@AkihiroSuda AkihiroSuda merged commit 23a8a7f into lima-vm:master May 11, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add optional support for audio device
3 participants