-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 1934 - audio server regression (#1946)
* Audio configuration * Update * Update schema --------- Co-authored-by: Daniel Girtler <[email protected]>
- Loading branch information
1 parent
d76f4a0
commit 439bb54
Showing
12 changed files
with
137 additions
and
82 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,54 @@ | ||
from dataclasses import dataclass | ||
from enum import Enum | ||
from typing import Any, TYPE_CHECKING, Dict | ||
|
||
from ..hardware import SysInfo | ||
from ..output import info | ||
from ...default_profiles.applications.pipewire import PipewireProfile | ||
|
||
if TYPE_CHECKING: | ||
_: Any | ||
|
||
|
||
@dataclass | ||
class Audio(Enum): | ||
Pipewire = 'pipewire' | ||
Pulseaudio = 'pulseaudio' | ||
|
||
@staticmethod | ||
def no_audio_text() -> str: | ||
return str(_('No audio server')) | ||
|
||
|
||
@dataclass | ||
class AudioConfiguration: | ||
audio: Audio | ||
|
||
def __dump__(self) -> Dict[str, Any]: | ||
return { | ||
'audio': self.audio.value | ||
} | ||
|
||
@staticmethod | ||
def parse_arg(arg: Dict[str, Any]) -> 'AudioConfiguration': | ||
return AudioConfiguration( | ||
Audio(arg['audio']) | ||
) | ||
|
||
def install_audio_config( | ||
self, | ||
installation: Any | ||
): | ||
info(f'Installing audio server: {self.audio.name}') | ||
|
||
match self.audio: | ||
case Audio.Pipewire: | ||
PipewireProfile().install(installation) | ||
case Audio.Pulseaudio: | ||
installation.add_additional_packages("pulseaudio") | ||
|
||
if SysInfo.requires_sof_fw(): | ||
installation.add_additional_packages('sof-firmware') | ||
|
||
if SysInfo.requires_alsa_fw(): | ||
installation.add_additional_packages('alsa-firmware') |
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"dry_run": true, | ||
"audio": "none", | ||
"bootloader": "systemd-bootctl", | ||
"debug": false, | ||
"harddrives": [ | ||
|
This file contains 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
Oops, something went wrong.