Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Config | Audio Options rework #2988

Merged
merged 15 commits into from
Jul 21, 2019
Merged

DietPi-Config | Audio Options rework #2988

merged 15 commits into from
Jul 21, 2019

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Jul 16, 2019

Status: Ready

  • DietP-Patch | Fix/remove obsolete config.txt entries and audio related boot scripts/services
  • Changelog

Commit list/description:

  • DietPi-Set_hardware | soundcard: Skip installing alsa-utils via input value "none"
  • DietPi-Set_hardware | soundcard: Reset current and persistent control state before applying new soundcard setting
  • DietPi-Set_hardware | soundcard: Skip applying amixer settings via boot script or service. alsa-restore.service (or alsa-state.service, in case daemon mode enabled) safes and restores them automatically
  • DietPi-Set_hardware | soundcard: Fix I2S on RPi which is a dtparam and no dtoverlay
  • DietPi-Set_hardware | soundcard: Skip dtoverlay=i2s-mmap on RPi which is not available since kernel 4.9 but enabled by default with I2S.
  • DietPi-Set_hardware | soundcard: Split RPi onboard options: HDMI, 3.5mm and auto
  • DietPi-Set_hardware | soundcard: Coding: Merge simple dtoverlay options on RPi
  • DietPi-Set_hardware | soundcard: Remove "pine64-analogue" which is not available anymore in DietPi-Config. Re-add when users can verify correct method to enable 3.5mm on new ARMbian-based Pine64 image.
  • DietPi-Set_hardware | soundcard: Enable all dtoverlays, kernel modules, services and scripts immediately to allow skipping reboot from DietPi-Config
  • DietPi-Config | Audio Options: Split disabling audio capabilities as a separate menu entry, hide all other options when disabled. Install alsa-utils when enabling, as well mark as installed for DietPi-Software, purge when disabling.
  • DietPi-Config | Audio Options on RPi: Remove obsolete rpi-bcm2835-ultrahq entries and doubled allo-boss-dac-pcm512x-audio. Add additional available HifiBerry and IQaudio soundcard dtoverlay.
  • DietPi-Config | Audio Options: Coding: Sort all soundcard options into a single $G_HW_* if-then-elif statement to grant a better overview of options per device. Add default=HDMI entry only to those devices, where we explicitly configure it like that within DietPi-Set_hardware. Do not show any "default" entry on other devices.
  • DietPi-Config | Audio Options: Add generic /proc/asound based detection to the bottom of the list for all devices
  • DietPi-Config | Audio Options: Add Intel SST DSP as a separate option to all Intel CPU devices, instead of installing the related firmware by default. Most user will never need it.
  • DietPi-JustBoom | Minor coding and merge ALSA + soundcard check into single exit prompt. Either installing ALSA via DietPi-Software or selecting a soundcard via DietPi-Config works.
  • DietPi-Software | ALSA: Enable default soundcard for all devices, if set to "none". Last fallback for this will be hw:0,0. On RPi use newly added "rpi-bcm2835-auto" which replaces "rpi-bcm2835-ultrahq" to enable onboard sound which uses HDMI if plugged, else 3.5mm automatically.
  • DietPi-Software | ALSA: Rely on DietPi-Set_hardware to install "alsa-utils"
  • DietPi-PREP | alsa-utils and firmware-intel-sound is not installed anymore by "dietpi-set_hardware soundcard none", thus does not need to be purged anymore.
  • DietPi-PREP | Do not reduce subversion by 1 anymore. Due to RC versions this is not required anymore, which is always increased before doing stable release.
  • DietPi-PREP | Coding: Remove some empty lines between G_DIETPI-NOTIFY() calls and related singe commands, to optically merge code that belongs together

+ DietPi-Set_hardware | soundcard: Skip installing alsa-utils via input value "none"
+ DietPi-Set_hardware | soundcard: Reset current and persistent contrl state before applying new soundcard setting
+ DietPi-Set_hardware | soundcard: Skip applying amixer settings via boot script or service. alsa-restore.service (or alsa-state.service, in case daemon mode enabled) safes and restores them automatically
+ DietPi-Set_hardware | soundcard: Fix I2S on RPi which is a dtparam and no dtoverlay
+ DietPi-Set_hardware | soundcard: Skip dtoverlay=i2s-mmap on RPi which is not available since kernel 4.9 but enabled by default with I2S.
+ DietPi-Set_hardware | soundcard: Split RPi onboard options: HDMI, 3.5mm and auto
+ DietPi-Set_hardware | soundcard: Coding: Merge simple dtoverlay options on RPi
+ DietPi-Set_hardware | soundcard: Remove "pine64-analogue" which is not available anymore in DietPi-Config. Re-add when users can verify correct method to enable 3.5mm on new ARMbian-based Pine64 image.
+ DietPi-Set_hardware | soundcard: Enable all dtoverlays, kernel modules, services and scripts immediately to allow skipping reboot from DietPi-Config
@MichaIng MichaIng added this to the v6.26 milestone Jul 16, 2019
@MichaIng MichaIng self-assigned this Jul 16, 2019
MichaIng added 8 commits July 16, 2019 23:22
+ DietPi-Config | Audio Options: Split disabling audio capabilities as a separate menu entry, hide all other options when disabled. Install alsa-utils when enabling, as well mark as installed for DietPi-Software, purge when disabling.
+ DietPi-Config | Audio Options on RPi: Remove obsolete rpi-bcm2835-ultrahq entries and doubled allo-boss-dac-pcm512x-audio. Add additional available HifiBerry and IQaudio soundcard dtoverlay.
+ DietPi-Config | Audio Options: Coding: Sort all soundcard options into a single $G_HW_* if-then-elif statement to grant a better overview of options per device. Add default=HDMI entry only to those devices, where we explicitly configure it like that within DietPi-Set_hardware. Do not show any "default" entry on other devices.
+ DietPi-Config | Audio Options: Add generic /proc/asound based detection to the bottom of the list for all devices
+ DietPi-Config | Audio Options: Add Intel SST DSP as a separate option to all Intel CPU devices, instead of installing the related firmware by default. Most user will never need it.
+ DietPi-JustBoom | Minor coding and merge ALSA + soundcard check into single exit prompt. Either installing ALSA via DietPi-Software or selecting a soundcard via DietPi-Config works.
+ DietPi-Software | ALSA: Enable default soundcard for all devices, if set to "none". Last fallback for this will be hw:0,0. On RPi use newly added "rpi-bcm2835-auto" which replaces "rpi-bcm2835-ultrahq" to enable onboard sound which uses HDMI if plugged, else 3.5mm automatically.
+ DietPi-Software | ALSA: Rely on DietPi-Set_hardware to install "alsa-utils"
+ DietPi-PREP | alsa-utils and firmware-intel-sound is not installed anymore by "dietpi-set_hardware soundcard none", thus does not need to be purged anymore.
+ DietPi-PREP | Do not reduce subversion by 1 anymore. Due to RC versions this is not required anymore, which is always increased before doing stable release.
+ DietPi-PREP | Coding: Remove some empty lines between G_DIETPI-NOTIFY() calls and related singe commands, to optically merge code that belongs together
+ DietPi-Config | Audio Options: Init soundcard array and minor coding
+ DietPi-Config | Audio Options: Wrong ALSA installed check
+ DietPi-Config | Audio Options: Minor visual
+ DietPi-Set_hardware | soundcard: When USB DAC auto detection fails, inform user that it is reverted to "none" and skip creating asound.conf.
+ DietPi-Set_hardware | soundcard: Minor coding: Speed up alsa-utils/bin checks during reset, by checking selection against "none" which assures that either alsa-utils is installed or no amixer defaults need to be set.
+ DietPi-Set_hardware | Coding: Use "systemctl enable/disable --now" (available since Stretch) to include start/stop into the same call. Skip "systemctl daemon-reload" after removing a unit, which has no relevant effect.
@MichaIng
Copy link
Owner Author

MichaIng commented Jul 18, 2019

Actually I wanted to turn this into an auto-detection only menu. But currently on known SBC choosing between 3.5mm jack and HDMI is done via amixer settings on the same card + device index. We could as well add additional menus to switch those, since their names are mostly self-explaining, but by this we would loose much simplicity. User would need to:

  1. Enable sound capabilities: Install ALSA
  2. Enable additional sound card via config.txt/dtoverlay/kernel module/firmware install
  3. Choose the sound device/PCM via auto detection
  4. Adjust the amixer settings to choose between e.g. 3.5mm jack, HDMI, SPDIF, ...

Currently all this is done on known SBCs via a single selection, less flexible but very simple, which I don't want to loose for now.

So having a clear Enable/Disable switch (most relevant for headless non audio systems) to at least have auto detection additionally added to all devices should do for now.

Optional amixer menu requires more work since we would need to scrape allowed input values at best. alsamixer sadly does only show a sub set of available settings, often the levels but not the switches.

MichaIng added 6 commits July 18, 2019 19:05
+ DietPi-Set_hardware | soundcard: Remove doubled "SOUNDCARD_TARGET_DEVICE=0" on USB DAC auto-detection and minor coding
+ DietPi-Config | Minor visual
+ DietPi-Patch | Remove obsolete/invalid audio related services/scripts/settings
+ DietPi-Patch | I2C baudrate fix was applied to wrong config file, whoopsie!
+ DietPi-Set_hardware | soundcard: Store control states once and force restore service, to assure it is active (states preserved) for next reboot
+ DietPi-Set_hardware | serialconsole: Remove obsolete block for Odroid C1 Jessie (kernel 3.x)
+ DietPi-Set_hardware | Minor coding
+ CHANGELOG | DietPi-Config - Audio Options: Menu has been reworked
@MichaIng MichaIng merged commit 7d5a2bc into dev Jul 21, 2019
@MichaIng MichaIng deleted the audio branch July 21, 2019 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant