mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-21 16:16:31 +00:00
Fix audio cgroup issue (#2575)
This commit is contained in:
parent
a6e4b5159e
commit
941ea3ee68
@ -1,6 +1,6 @@
|
|||||||
"""Audio docker object."""
|
"""Audio docker object."""
|
||||||
import logging
|
import logging
|
||||||
from typing import Dict
|
from typing import Dict, List
|
||||||
|
|
||||||
from ..const import ENV_TIME, MACHINE_ID
|
from ..const import ENV_TIME, MACHINE_ID
|
||||||
from ..coresys import CoreSysAttributes
|
from ..coresys import CoreSysAttributes
|
||||||
@ -41,6 +41,13 @@ class DockerAudio(DockerInterface, CoreSysAttributes):
|
|||||||
|
|
||||||
return volumes
|
return volumes
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cgroups_rules(self) -> List[str]:
|
||||||
|
"""Return a list of needed cgroups permission."""
|
||||||
|
return self.sys_hardware.policy.get_cgroups_rules(
|
||||||
|
PolicyGroup.AUDIO
|
||||||
|
) + self.sys_hardware.policy.get_cgroups_rules(PolicyGroup.BLUETOOTH)
|
||||||
|
|
||||||
def _run(self) -> None:
|
def _run(self) -> None:
|
||||||
"""Run Docker image.
|
"""Run Docker image.
|
||||||
|
|
||||||
@ -61,9 +68,7 @@ class DockerAudio(DockerInterface, CoreSysAttributes):
|
|||||||
name=self.name,
|
name=self.name,
|
||||||
hostname=self.name.replace("_", "-"),
|
hostname=self.name.replace("_", "-"),
|
||||||
detach=True,
|
detach=True,
|
||||||
device_cgroup_rules=self.sys_hardware.policy.get_cgroups_rules(
|
device_cgroup_rules=self.cgroups_rules,
|
||||||
PolicyGroup.AUDIO, PolicyGroup.BLUETOOTH
|
|
||||||
),
|
|
||||||
environment={ENV_TIME: self.sys_config.timezone},
|
environment={ENV_TIME: self.sys_config.timezone},
|
||||||
volumes=self.volumes,
|
volumes=self.volumes,
|
||||||
)
|
)
|
||||||
|
@ -27,7 +27,7 @@ _CGROUPS: Dict[PolicyGroup, List[int]] = {
|
|||||||
29,
|
29,
|
||||||
81,
|
81,
|
||||||
251,
|
251,
|
||||||
242,
|
242, # vchiq (vchiq)
|
||||||
226
|
226
|
||||||
],
|
],
|
||||||
PolicyGroup.AUDIO: [
|
PolicyGroup.AUDIO: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user