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