Skip to content

Commit

Permalink
snap: plugs audio-playback by default (#4331)
Browse files Browse the repository at this point in the history
The new audio-playback interface in snapd 2.41 will be the preferred
interface for audio moving forward. On systems with a mediating
pulseaudio, it provides playback access (with audio-record providing
recording). The interface allows for updating snapd to allow other sound
servers, such as pipewire, without the need for snaps to change their
plugs policy. While audio-playback is preferred, keep pulseaudio for now
until everyone has updated to snapd 2.41.

References:
- canonical/snapd#5644
- https://forum.snapcraft.io/t/the-audio-playback-interface/13089
- https://forum.snapcraft.io/t/the-audio-record-interface/13090

Co-authored-by: jdstrand <[email protected]>
  • Loading branch information
2 people authored and develar committed Jan 16, 2020
1 parent 35bff8c commit 24018dd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -4365,7 +4365,7 @@
"type": "null"
}
],
"description": "The list of [plugs](https://snapcraft.io/docs/reference/interfaces).\nDefaults to `[\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"pulseaudio\", \"opengl\"]`.\n\nIf list contains `default`, it will be replaced to default list, so, `[\"default\", \"foo\"]` can be used to add custom plug `foo` in addition to defaults.\n\nAdditional attributes can be specified using object instead of just name of plug:\n```\n[\n {\n \"browser-sandbox\": {\n \"interface\": \"browser-support\",\n \"allow-sandbox\": true\n },\n },\n \"another-simple-plug-name\"\n]\n```"
"description": "The list of [plugs](https://snapcraft.io/docs/reference/interfaces).\nDefaults to `[\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]`.\n\nIf list contains `default`, it will be replaced to default list, so, `[\"default\", \"foo\"]` can be used to add custom plug `foo` in addition to defaults.\n\nAdditional attributes can be specified using object instead of just name of plug:\n```\n[\n {\n \"browser-sandbox\": {\n \"interface\": \"browser-support\",\n \"allow-sandbox\": true\n },\n },\n \"another-simple-plug-name\"\n]\n```"
},
"publish": {
"anyOf": [
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/options/SnapOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions {

/**
* The list of [plugs](https://snapcraft.io/docs/reference/interfaces).
* Defaults to `["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "pulseaudio", "opengl"]`.
* Defaults to `["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"]`.
*
* If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom plug `foo` in addition to defaults.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getTemplatePath } from "../util/pathManager"
import { LinuxTargetHelper } from "./LinuxTargetHelper"
import { createStageDirPath } from "./targetUtil"

const defaultPlugs = ["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "browser-support", "network", "gsettings", "pulseaudio", "opengl"]
const defaultPlugs = ["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"]

export default class SnapTarget extends Target {
readonly options: SnapOptions = {...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name]}
Expand Down
3 changes: 3 additions & 0 deletions test/out/linux/__snapshots__/snapTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Object {
"browser-support",
"network",
"gsettings",
"audio-playback",
"pulseaudio",
"opengl",
],
Expand Down Expand Up @@ -316,6 +317,7 @@ Object {
"browser-support",
"network",
"gsettings",
"audio-playback",
"pulseaudio",
"opengl",
],
Expand Down Expand Up @@ -385,6 +387,7 @@ Object {
"browser-support",
"network",
"gsettings",
"audio-playback",
"pulseaudio",
"opengl",
],
Expand Down

0 comments on commit 24018dd

Please sign in to comment.