Skip to content

Commit

Permalink
Start with peakmeters, smarter device handling
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Apr 19, 2021
1 parent 1342891 commit e81894c
Show file tree
Hide file tree
Showing 14 changed files with 610 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

TARGETS = archiso/output/mod-live-usb-v2-x86_64.iso
TARGETS = archiso/output/mod-live-usb-v3-x86_64.iso

all: $(TARGETS)

Expand Down
2 changes: 1 addition & 1 deletion archiso/liveusb/airootfs/etc/passwd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
root:x:0:0:root:/root:/usr/bin/zsh
root:x:0:0:root:/root:/usr/bin/bash
2 changes: 1 addition & 1 deletion archiso/liveusb/airootfs/etc/shadow
Original file line number Diff line number Diff line change
@@ -1 +1 @@
root::14871::::::
root:$1$hl9ecpSq$TkUe1PA1fogPI4I6O1oDF0:::::::
2 changes: 2 additions & 0 deletions archiso/liveusb/packages.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
alsa-utils
amd-ucode
base
bash
breeze
cloud-init
cpupower
Expand All @@ -18,6 +19,7 @@ mkinitcpio
mkinitcpio-archiso
nano
openssh
qt5-webengine
rtirq
syslinux
thermald
4 changes: 2 additions & 2 deletions archiso/liveusb/profiledef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# shellcheck disable=SC2034

iso_name="mod-live-usb"
iso_label="v2"
iso_label="v3"
iso_publisher="MOD Devices <https://moddevices.com>"
iso_application="MOD Live USB"
iso_version="v2"
iso_version="v3"
install_dir="arch"
bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 'uefi-x64.systemd-boot.esp' 'uefi-x64.systemd-boot.eltorito')
arch="x86_64"
Expand Down
2 changes: 1 addition & 1 deletion archiso/liveusb/syslinux/syslinux-linux.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

LABEL arch
MENU LABEL Arch Linux (x86_64, BIOS)
MENU LABEL MOD Live-USB (x86_64, BIOS)
LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux
INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% threadirqs
2 changes: 1 addition & 1 deletion archiso/liveusb/syslinux/syslinux.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

UI menu.c32
MENU TITLE Arch Linux
MENU TITLE MOD Live-USB
MENU CLEAR

DEFAULT arch
Expand Down
2 changes: 1 addition & 1 deletion live-welcome/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ resources/watermark.txt: resources/watermark.png
# $(MOC) $< > $@

clean:
rm -f $(TARGETS) *.o resources/*.txt src/*.o theme/*.o
rm -f $(TARGETS) *.o */*.o resources/*.txt
32 changes: 12 additions & 20 deletions live-welcome/src/AudioDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,11 @@ void enumerateSoundcards(std::stringlist& inputNames,
// snd_ctl_card_info_free(cardinfo);
}

void getDeviceProperties(const char* const deviceID,
unsigned& minChansOut,
unsigned& maxChansOut,
unsigned& minChansIn,
unsigned& maxChansIn,
std::vector<unsigned>& bufSizes,
std::vector<unsigned>& rates,
bool testOutput,
bool testInput)
void getDeviceProperties(const char* const deviceID, bool testOutput, bool testInput, DeviceProperties& props)
{
minChansOut = maxChansOut = minChansIn = maxChansIn = 0;
bufSizes.clear();
rates.clear();
props.minChansOut = props.maxChansOut = props.minChansIn = props.maxChansIn = 0;
props.bufsizes.clear();
props.rates.clear();

if (deviceID == nullptr || *deviceID == '\0')
return;
Expand All @@ -242,9 +234,9 @@ void getDeviceProperties(const char* const deviceID,

if (snd_pcm_open(&pcm, deviceID, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) >= 0)
{
getDeviceNumChannels(pcm, minChansOut, maxChansOut);
getDeviceBufferSizes(pcm, bufSizes);
getDeviceSampleRates(pcm, rates);
getDeviceNumChannels(pcm, props.minChansOut, props.maxChansOut);
getDeviceBufferSizes(pcm, props.bufsizes);
getDeviceSampleRates(pcm, props.rates);

snd_pcm_close(pcm);
}
Expand All @@ -256,13 +248,13 @@ void getDeviceProperties(const char* const deviceID,

if (snd_pcm_open(&pcm, deviceID, SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK) >= 0)
{
getDeviceNumChannels(pcm, minChansIn, maxChansIn);
getDeviceNumChannels(pcm, props.minChansIn, props.maxChansIn);

if (bufSizes.size() == 0)
getDeviceBufferSizes(pcm, bufSizes);
if (props.bufsizes.size() == 0)
getDeviceBufferSizes(pcm, props.bufsizes);

if (rates.size() == 0)
getDeviceSampleRates(pcm, rates);
if (props.rates.size() == 0)
getDeviceSampleRates(pcm, props.rates);

snd_pcm_close(pcm);
}
Expand Down
18 changes: 11 additions & 7 deletions live-welcome/src/AudioDiscovery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ namespace std {
typedef vector<string> stringlist;
}

typedef struct {
unsigned minChansOut = 0;
unsigned maxChansOut = 0;
unsigned minChansIn = 0;
unsigned maxChansIn = 0;
std::vector<unsigned> bufsizes;
std::vector<unsigned> rates;
} DeviceProperties;

void enumerateSoundcards(std::stringlist& inputNames,
std::stringlist& outputNames,
std::stringlist& inputIds,
std::stringlist& outputIds);

void getDeviceProperties(const char* const deviceID,
unsigned& minChansOut,
unsigned& maxChansOut,
unsigned& minChansIn,
unsigned& maxChansIn,
std::vector<unsigned>& bufSizes,
std::vector<unsigned>& rates,
bool testOutput,
bool testInput);
bool testInput,
DeviceProperties& props);
Loading

0 comments on commit e81894c

Please sign in to comment.