-
Notifications
You must be signed in to change notification settings - Fork 789
Add default value for audio driver #2456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,6 +297,9 @@ audio: | |
| # QEMU audiodev, e.g., "none", "coreaudio", "pa", "alsa", "oss". | ||
| # VZ driver, use "vz" as device name | ||
| # Choosing "none" will mute the audio output, and not play any sound. | ||
| # Choosing "default" will pick a suitable of: coreudio, pa, dsound, oss. | ||
| # As of QEMU v6.2 the default is to create a disconnected sound device | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still ambiguous if "the default" means when it is set to But maybe it doesn't really matter, practically speaking. |
||
| # that is still visible in the guest but not connected to the host. | ||
| # 🟢 Builtin default: "" | ||
| device: null | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # A template to run ubuntu using device: default | ||
| # This template requires Lima v0.23.0 or later. | ||
| images: | ||
| # Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. | ||
| - location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" | ||
| arch: "x86_64" | ||
| digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" | ||
| - location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" | ||
| arch: "aarch64" | ||
| digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" | ||
| # Fallback to the latest release image. | ||
| # Hint: run `limactl prune` to invalidate the cache | ||
| - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" | ||
| arch: "x86_64" | ||
| - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" | ||
| arch: "aarch64" | ||
|
|
||
| mounts: | ||
| - location: "~" | ||
| - location: "/tmp/lima" | ||
| writable: true | ||
|
|
||
| vmType: "qemu" | ||
| audio: | ||
| device: "default" | ||
|
|
||
| provision: | ||
| - mode: system | ||
| script: | | ||
| #!/bin/bash | ||
| set -eux -o pipefail | ||
| test -e /lib/modules/$(uname -r)/kernel/sound/pci/hda/snd-hda-intel.ko* && exit 0 | ||
| apt-get install -y linux-modules-extra-$(uname -r) | ||
| modprobe snd-hda-intel | ||
| - mode: system | ||
| script: | | ||
| #!/bin/bash | ||
| set -eux -o pipefail | ||
| command -v aplay >/dev/null 2>&1 && exit 0 | ||
| apt-get install -y --no-install-recommends alsa-utils | ||
| probes: | ||
| - description: "alsa to be installed" | ||
| script: | | ||
| #!/bin/bash | ||
| set -eux -o pipefail | ||
| if ! timeout 30s bash -c "until command -v aplay >/dev/null 2>&1; do sleep 3; done"; then | ||
| echo >&2 "alsa is not installed yet" | ||
| exit 1 | ||
| fi | ||
| hint: See "/var/log/cloud-init-output.log" in the guest | ||
| message: | | ||
| To get a list of all available audio devices: | ||
| $ sudo aplay -L | ||
| To test the audio device, use something like: | ||
| $ sudo speaker-test -c2 -twav |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not part of this PR, but reading the docs here makes me wonder what the difference is between
""and"none"beyond that"none"doesn't work with VZ. Why would you use"none"instead of just leaving off the audio device?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually some distributions don't work properly without an audio card, so the default ("") is to add one but leave it disconnected to any speakers. It can be explicitly removed ("none"), if you know that the OS will still boot...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the comment is actually wrong. It is
""that is muting the audio, and"none"that removes the driver.And I still think it needs to be clarified that
"default"doesn't apply to VZ. This could be as simple as moving the VZ line all the way to the bottom (on top of the "Builtin default" line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, "" omits the qemu flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this is end-user documentation. We should not punt by telling them to read the qemu docs and the Lima sources, but explain what each valid choice does, and why they would want to pick
""over"none"or vice versa. Or just drop"none"from our comments if there is no reason a user would ever want that.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaults changed again in QEMU 8.2, so if we want to document what the default drivers are - it needs some more research and testing.