DietPi-Config | RPi | OpenGL/VC4 causes soundcard selection to be invalid

Created on 24 Oct 2018  路  9Comments  路  Source: MichaIng/DietPi

Creating a bug report/issue:

Required Information:

  • DietPi version: 6.17.9
  • Distro version: 9.4
  • Kernel version: Linux DietPi 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux
  • SBC device: RPi 3 Model B+ (armv7l)
  • Power supply used: 5V@2A
  • SDcard used: SanDisk ultra

Additional Information (if applicable):

  • Software title: Shairport, Raspotify, Roon bridge.
  • Was the software title installed freshly or updated/migrated? Yes
  • Can this issue be replicated on a fresh installation of DietPi? I guess

Steps to reproduce:

  1. Install raspotify, Roon bridge, shairport.

Expected behaviour:

  • Sound should output from _rPI Allo Boss Dac_.

Actual behaviour:


I can only get an output using Roon.

Extra details:


I have selected Allo Boss Dac in dietpi-config. What is strange is that if I enter alsamixer, I have to manually select the soundcard, which, to my memory, wasn't neccesary in the past.

Bug RPi Workaround available

Most helpful comment

@MichaIng

Applied a simple workaround for now, if vc4, sound card target index++.

Only downside, user will need to re-select sound card after changing vc4 on/off. msg?

EDIT: done a message. Ideally this all needs a complete rewrite and improved detection. But its a big job, not something I can take on now.

All 9 comments

@ezekini

Thanks for the report, lets check a few things, please paste results:

cat /etc/asound.conf
aplay -l

Here are results @Fourdee :

root@DietPi:~# cat /etc/asound.conf
pcm.!default {
    type hw
    card 0
    device 0
}
ctl.!default {
    type hw
    card 0
}
root@DietPi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi [vc4-hdmi], device 0: MAI PCM vc4-hdmi-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: BossDAC [BossDAC], device 0: Boss DAC HiFi [Master] pcm512x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@DietPi:~#

@ezekini

Thanks for the info, yep issue is with vc4hdmi, unexpected, throwing the asound.conf out. Only appears when openGL is enabled.

Solution is copy and paste all:

dietpi-services stop
cat << _EOF_ > /etc/asound.conf
pcm.!default {
    type hw
    card 1
    device 0
}
ctl.!default {
    type hw
    card 1
}
_EOF_
dietpi-services start

I'll need to rewrite our soundcard system, most likely use a 2 stage method to apply, reboot, then use detection based for selection.

@Fourdee
Is reboot needed to (re)load a kernel module? Perhaps it is possible to use modprobe for this?

@MichaIng

Is reboot needed to (re)load a kernel module? Perhaps it is possible to use modprobe for this?

Issue is with dt overlay, which needs to be loaded during boot time via kernel. Can't be done on the fly as far as i'am aware 鈽癸笍
https://www.raspberrypi.org/forums/viewtopic.php?t=99401

@Fourdee
https://www.raspberrypi.org/documentation/configuration/device-tree.md

Very interesting in general, according to changing dtoverlays on runtime level: 3.5.1 THE DTOVERLAY COMMAND

Worth to try to keep configuration handy.

Interesting:
enable_uart=1聽implies core_freq=250 (unless force_turbo=1)

@Fourdee
Yep, basically this should work:

# Check if desired overlay is available
dtoverlay -a | grep 'target_overlay'
# Load desired overlay to running system
dtoverlay 'target_overlay'
# Remove old overlay
dtoverlay -r 'old_overlay'

Source: https://www.raspberrypi.org/documentation/configuration/device-tree.md#part3.5.1

@MichaIng

Applied a simple workaround for now, if vc4, sound card target index++.

Only downside, user will need to re-select sound card after changing vc4 on/off. msg?

EDIT: done a message. Ideally this all needs a complete rewrite and improved detection. But its a big job, not something I can take on now.

@Fourdee
Is good for now. I planned to rewrite our sound card selection menu that way:
Main menu:

  1. enable/disable audio capability: When disable, purge alsa-utils, hide all below items, else install alsa-utils to allow auto-detection.
  2. Allow to select additional dtoverlay/kernel module to load (only shown on HW models that support/require this, e.g. RPi) ToDo then: Check if modprobe+dtoverlay commands allow to skip reboot, for sound cards to be shown by aplay -l.
  3. Select sound card+device based on aplay -l auto detection.
  4. DietPi-Justboom as it was
  5. Optionally, see if we can come up with a reliable option: Select microphone (capture device) based on arecord -l.

Btw. regarding mails some days ago: I found a solution for the Mycroft + microphone issue with default (non equaliser) asound.conf: There is an option to switch capture sample rate within mycroft.conf, that is by default 16000 (does not work) but works well with 48000. This was the case on all my x86 devices (all VMs with different sound cards) and different notebook. So it seems the "plug" module allows this sample rate conversion or something but that totally breaks sound quality.
With equaliser enabled things are broken by error message I wrote you, about pa_lib_alsa (or similar). Looks like in that case Mycroft looks for ("pa" = ?) PulseAudio which is not available, thus fails? However this is all about Mycroft and not about our sound settings, so nothing to change in this direction.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fourdee picture Fourdee  路  3Comments

1021683053 picture 1021683053  路  3Comments

bhaveshgohel picture bhaveshgohel  路  3Comments

Invictaz picture Invictaz  路  3Comments

Kapot picture Kapot  路  3Comments