Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion python/lib/alsainfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
'Alsactl output': 'Alsactl',
'All Loaded Modules': 'AllModules',
'Sysfs Files': 'Sysfs',
'Sysfs card info': 'SysfsCard',
'Sysfs ctl-led info': 'SysfsCtlLed',
'ACPI SoundWire Device Status Information': 'AcpiSoundWire',
'AC97 Codec information': 'Ac97Codec',
'USB Descriptors': 'UsbDescriptors',
'USB Stream information': 'UsbStream',
'ALSA/HDA dmesg': 'Dmesg',
'Packages installed': 'Packages'
}
Expand Down Expand Up @@ -225,7 +231,12 @@ def __init__(self, parent, text):
self.text = text
blocks = text.split('!!--')
r1 = r".*--Mixer controls for card (?P<card>\w+) \[(?P<id>.*)\]\n\nCard hw:.*\n[ \t]*Mixer name[ \t]*: '(?P<mixername>.*)'\n[ \t]*Components[ \t]*: '(?P<components>.*)'\n"
r2 = r".*--Mixer controls for card (?P<id>.*)\n\nCard hw:(?P<card>\w+).*\n[ \t]*Mixer name[ \t]*: '(?P<mixername>.*)'\n[ \t]*Components[ \t]*: '(?P<components>.*)'\n"
# amixer names the control device it opened, and which name that is
# depends on how alsa-info.sh addressed the card. Current versions pass
# the card id (`amixer -c PineNote info`) and alsa-lib answers
# "Card sysdefault:0"; older dumps in configs/ say "Card hw:0". Accept
# any device prefix and take the card index that follows it.
r2 = r".*--Mixer controls for card (?P<id>.*)\n\nCard [^\s:]+:(?P<card>\d+).*\n[ \t]*Mixer name[ \t]*: '(?P<mixername>.*)'\n[ \t]*Components[ \t]*: '(?P<components>.*)'\n"
for block in blocks:
if not block:
continue
Expand Down Expand Up @@ -269,6 +280,42 @@ def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfoSysfsCard:

def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfoSysfsCtlLed:

def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfoAcpiSoundWire:

def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfoAc97Codec:

def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfoUsbDescriptors:

def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfoUsbStream:

def __init__(self, parent, text):
self.parent = parent
self.text = text

class AlsaInfo:
"""Parses the output from the alsa-info.sh file."""

Expand Down
Loading