[rpi4_v8 7.6 - v7.8.2] o!mpd volume slider no working + allo dac no soxr

rpi4 4GB latest v8 Bullseye image fully updated and modified to install v7.6.0 beta branch on first boot.

After not being able to listen to Music with v7 Allo GUI (even after upgrading to 7.6 beta branch no dice) i thought lets try out the v8 image and at first mpd and o!mpd worked fine until i wanted to adjust the volume.
From not showing the slider to if the slider was shown it would not change the Volume.

One quick indicator being few dots under the Volume icon the other that i could not enable soxr in dietpi-justbom.
Trying to enable soxr journalctl doesnt show much.

Sep 15 10:52:26 DietPi systemd[1]: Stopping Music Player Daemon...
Sep 15 10:52:26 DietPi mpd[2659]: player: played "http://10.10.1.84/ompd/stream.php?action=streamTo&stream_id=-1&track_id=gugneiayzb_3a8c095b&ext=.mp3"
Sep 15 10:52:26 DietPi systemd[1]: mpd.service: Succeeded.
Sep 15 10:52:26 DietPi systemd[1]: Stopped Music Player Daemon.
Sep 15 10:52:26 DietPi systemd[1]: Starting Music Player Daemon...
Sep 15 10:52:26 DietPi systemd[1]: Started Music Player Daemon.
Sep 15 10:52:27 DietPi mpd[2997]: avahi: Service 'Music Player @ DietPi' successfully established.



root@DietPi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: BossDAC [BossDAC], device 0: Boss DAC HiFi [Master] pcm512x-hifi-0 [Boss DAC HiFi [Master] pcm512x-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@DietPi:~# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
hw:CARD=BossDAC,DEV=0
    BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
    Direct hardware device without any conversions
plughw:CARD=BossDAC,DEV=0
    BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
    Hardware device with all software conversions
sysdefault:CARD=BossDAC
    BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
    Default Audio Device
dmix:CARD=BossDAC,DEV=0
    BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
    Direct sample mixing device

I know it’s beta and i am willing to test (:

Volume slider in o!mpd still not working after the update to DietPi v7.7.0 (beta).

O!MPD slider works here. Can you share your:

cat /var/www/ompd/include/config.local.inc.php

DietPi-JustBoom indeed is buggy since we do not enforce an own /etc/mpd.conf anymore as it expects certain settings to be present, at least commented. I made a larger rework of the script now, to assume defaults, add settings when missing, allow to also unset a setting (makes much sense to not enforce an audio format to either preserve the input format or leave it up to ALSA to do auto-conversion when required). Of course when using SOXR, then it is obviously wanted :wink:: https://github.com/MichaIng/DietPi/commit/9d6197fbd2aa04a8ce5ace57ca27305476558e00

If you find time, it would be great if you could test this also:

> /boot/dietpi/misc/dietpi-justboom
curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/dev/dietpi/misc/dietpi-justboom' -o /boot/dietpi/misc/dietpi-justboom
dietpi-justboom

Also the Allo GUI likely requires some similar changes. My idea is to add a simple CLI to dietpi-justboom and then use this in the Allo GUI instead of having the code for those methods doubled, which may change in the future. E.g. I don’t find it great that with SOXR enabled, audio formats are automatically enforced globally while it makes sense to do this on a device-level. Not yet sure how to handle this best. Currently the format is applied to the first found MPD ALSA output and additionally globally when SOXR is enabled (this is like it was), while to me it makes sense to only apply it to the first ALSA output and do not ever enforce via global option. But not sure how e.g. CAVA reacts to this, if there are glitches when the formats do not match.

Any input on this would be great, as I personally do not use audio on my DietPi systems, other than for testing.

Hi and thanks for looking into this!
Run the update earlier today to v7.7.3 before reading your reply here.

root@DietPi:/boot/dietpi/misc# cat /var/www/ompd/include/config.local.inc.php 
<?php
# Database
$cfg['mysqli_host']                 = '127.0.0.1';
$cfg['mysqli_db']                   = 'ompd';
$cfg['mysqli_user']                 = 'ompd';
$cfg['mysqli_password']             = 'xXXxxxXXxxxXXx';
$cfg['mysqli_port']                 = '';
$cfg['mysqli_socket']               = '/run/mysqld/mysqld.sock';
$cfg['mysqli_auto_create_db']       = true;
# Media dir
$cfg['media_dir']                   = '/mnt/dietpi_userdata/Music/';
?>

Run the curl command you posted and detpi-justbom file was updated with your changes.
The o!mpd volume slider still does not work.

Noticed the exception here,

root@DietPi:/boot/dietpi/misc# journalctl -u mpd -f
-- Journal begins at Tue 2021-07-13 20:29:25 EEST. --
Oct 17 09:55:19 DietPi systemd[1]: Stopped Music Player Daemon.
Oct 17 09:55:19 DietPi systemd[1]: mpd.service: Consumed 4.827s CPU time.
Oct 17 09:55:19 DietPi systemd[1]: Starting Music Player Daemon...
Oct 17 09:55:20 DietPi systemd[1]: Started Music Player Daemon.
Oct 17 09:55:20 DietPi mpd[2449]: exception: Failed to open mixer for 'DietPi ALSA': no such mixer control: PCM
Oct 17 09:55:21 DietPi mpd[2449]: avahi: Service 'Music Player @ DietPi' successfully established.
Oct 17 09:55:23 DietPi mpd[2449]: alsa_output: Decoder is too slow; playing silence to avoid xrun
Oct 17 10:00:52 DietPi mpd[2449]: player: played "mp3/Rockers - OST/07 - Junior Byles - Fade Away.mp3"

Let me know if you need anything else.

Can you show the audio_output block/blocks of your /etc/mpd.conf and:

cat /etc/asound.conf
aplay -l # just in case something changed

mpd.conf

root@DietPi:~# grep -v ^\# /etc/mpd.conf | grep .
music_directory "/mnt/dietpi_userdata/Music"
playlist_directory "/mnt/dietpi_userdata/Music"
db_file "/mnt/dietpi_userdata/.mpd_cache/db_file"
state_file "/mnt/dietpi_userdata/.mpd_cache/state"
sticker_file "/mnt/dietpi_userdata/.mpd_cache/sticker.sql"
bind_to_address			"localhost"
bind_to_address "/run/mpd/socket"
input {
        plugin "curl"
}
decoder {
        plugin                  "hybrid_dsd"
        enabled                 "no"
}
decoder {
        plugin        "wildmidi"
        enabled       "no"
        #config_file "/etc/timidity/timidity.cfg"
}
filesystem_charset		"UTF-8"
audio_output {
	type "alsa"
	format "384000:32:3"
	name "DietPi ALSA"
}
audio_output {
    type "fifo"
    enabled "yes"
    name "CAVA"
    path "/tmp/mpd.fifo"
    format "44100:16:2"
}
samplerate_converter "soxr very high"
audio_output_format "384000:32:3"

asound

root@DietPi:~# cat /etc/asound.conf 
pcm.!default {
	type plug
	slave.pcm {
		type equal
		slave.pcm {
			type plug
			slave.pcm {
				type hw
				card 0
				device 0
			}
		}
		controls "/var/lib/dietpi/dietpi-config/.alsaequal.bin"
	}
}

ctl.eq {
	type equal
	controls "/var/lib/dietpi/dietpi-config/.alsaequal.bin"
}

ctl.!default {
	type hw
	card 0
}

aplay

root@DietPi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: BossDAC [BossDAC], device 0: Boss DAC HiFi [Master] pcm512x-hifi-0 [Boss DAC HiFi [Master] pcm512x-hifi-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Can you try to disable the equalizer?

Another idea, when the equalizer is enabled, try to add the following to the type “alsa” audio_output block in mpf.conf:

mixer_control eq

and in case additionally:

mixer_type software

The error message seems to indicate that the default “PCM” control device is not available for this DAC. The equalizer should be an additional mixer/control device and it shouldn’t matter whether the default ALSA output device invokes it (respecting its config for stream conversion) or not, but still good to rule it out (first suggestion). It is generally possible that a sound card does not support a hardware control device, though unexpected for a DAC, I’d say.

Can you also check whether alsamixer works, without declaring the eq control device (without arguments), so that the default hardware control is used, or does this fail with a similar error message?

Sorry for replying after such a long time, life needed me somewhere else and i was using the Amp to adjust Volume.

I just installed DietPi v8 v7.8.2 with only Boss DAC and O!MPD.
EQ was off and problem remains.

Went ahead and enabled EQ & SOXR to test your new suggestions.

Added to /etc/mpd.conf (scroll down to the bottom)

mixer_control “eq”

rebooted to be sure, no change.
Added
mixer_type “software” also

Simple ALSA output

audio_output {
type “alsa”
name “DietPi ALSA”
mixer_control “eq”
mixer_type “software”
}
samplerate_converter “soxr very high”

et Voila!

You did it Michal! O!MPD allows me to modify Volume again (:

ps just finished backup and run update to beta 7.9.1, Volume still does work with these two added lines, will check out kodi next, thanks again!

Great, many thanks for the feedback :slight_smile:. I guess mixer_control “eq” is then not required anymore, also actually it should have been mixer_device “eq” (https://github.com/MusicPlayerDaemon/MPD/blob/d0f9062/doc/mpdconf.example#L218), but it doesn’t look like the correct way. As far as I understand, ALSA devices are generally only used with mixer_type “hardware”, which is the default as long as the sound device supports it, else “none” is used, which likely leads to the greyed out volume slider in your case: https://github.com/MusicPlayerDaemon/MPD/blob/master/doc/mpd.conf.5.rst#optional-audio-output-parameters

With mixer_type “software”, I guess, the ALSA devices are not touched at all but MPD handles volume/mixer changes internally software-wise.

I didn’t know that the hardware/ALSA mixer does not work with all sound cards, but as this seems to be the case, it makes sense that we add a related toggle to DietPi-JustBoom MPD settings to switch between software mixer and default with a hint to switch to software mixer when MPD is not able to adjust the volume otherwise.

Just verify on another level, can you try to run

alsamixer

And report back whether this shows mixer sliders/toggles or fails somehow with an error message or note?

Now on 7.9.2
alsamixer shows up and i can select BoosDAC and see sliders / toggles.

I had kodi and cava installed and kodi was playing sound but i removed both again to test your suggestions.
Now though i cannot get o!mpd to play anything, i can select the BossDAC and nothing is muted in alsamixer, oddly enough i can move the volume slider in o!mpd.
Prior to removing kodi o!mpd was playing/progressing but there was no sound.
Now after kodi removal, o!mpd doesn’t start to play the file.

I fear that either installing Kodi or any of the changes did make some changes that were not reverted back.
Wish there was a way to see which changes have been made where in regards to audio settings and/or when using dietpi-config.
Places i check for changes are,

/etc/mpd.conf
/boot/config.txt

Is there any other place that i should keep an eye out for changes?

I have to reinstall sdcard now and start from scratch, my backup hygiene got messed up.

After clean install of 7.8.2 i set up Allo BossDAC with,

Sound card          : [allo-boss-dac-pcm512x-audio-eq]
Auto-conversion     : [On] Automatic software conversions
...
EQ Enable        : [On] | Select to toggle EQ 
SOXR Enable      : [Off] | Select to toggle SOXR resampling

the /etc/mpd.conf contained,

# Simple ALSA output
audio_output {
        type "alsa"
        name "DietPi ALSA"
}

Music is playing, Volume slider lets me slide with no effect on Volume.

Enabled SOXR and did a reboot, Volume slider unresponsive as in OP, just dots and cannot be clicked.

Tested with each one below alone only:

mixer_device "eq"

or

mixer_type "hardware"

or

mixer_control "eq"

greyed out as you wrote.

With just,

mixer_type "software"

Volume slider works in o!mpd and increases/reduces Volume.
The /etc/mpd.conf part looks like this now,

# Simple ALSA output
audio_output {
        type "alsa"
        format "*:32:3"
        name "DietPi ALSA"
        mixer_type "software"
}
samplerate_converter "soxr very high"
audio_output_format "*:32:3"

In alsamixer i can see Sliders and toggles, increase / decrease / mute volume with Digital slider.
F6 shows,

- default
0 BossDAC
enter device name...

Max Overclock sliders are at 0 and remain there.

cat /boot/config.txt
#disable_camera_led=1

#-------GPU memory splits-------
gpu_mem_256=192
gpu_mem_512=384
gpu_mem_1024=384

#-------Boot splash screen------
disable_splash=1

#-------Onboard sound-----------
dtparam=audio=off

#-------I2C-------------
#dtparam=i2c_arm=off
#dtparam=i2c_arm_baudrate=100000

#-------SPI-------------
#dtparam=spi=off

#-------Serial/UART-----
# NB: "enable_uart=1" will forcefully set "core_freq=250" on WiFi/BT-capable RPi models, unless "force_turbo=1" is set as well.
enable_uart=0

#-------SD card HPD-----
# Comment to enable SD card hot-plug detection, while booting via USB or network.
# NB: This causes contant CPU load and kernel errors when no SD card is inserted.
dtparam=sd_poll_once

#-------Overclock-------
temp_limit=75
initial_turbo=20

#over_voltage=0
#arm_freq=1500
#core_freq=500

#over_voltage_min=0
#arm_freq_min=300
#core_freq_min=250
#sdram_freq_min=400
arm_64bit=1
dtoverlay=disable-wifi
dtoverlay=allo-boss-dac-pcm512x-audio



root@DietPi:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: BossDAC [BossDAC], device 0: Boss DAC HiFi [Master] pcm512x-hifi-0 [Boss DAC HiFi [Master] pcm512x-hifi-0]
Subdevices: 0/1
Subdevice #0: subdevice #0
root@DietPi:~# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
hw:CARD=BossDAC,DEV=0
BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
Direct hardware device without any conversions
plughw:CARD=BossDAC,DEV=0
BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
Hardware device with all software conversions
sysdefault:CARD=BossDAC
BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
Default Audio Device
dmix:CARD=BossDAC,DEV=0
BossDAC, Boss DAC HiFi [Master] pcm512x-hifi-0
Direct sample mixing device

part of dmesg,

[ 2.227705] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[ 2.227722] [vc_sm_connected_init]: start
[ 2.235715] [vc_sm_connected_init]: installed successfully
[ 2.255106] snd-allo-boss-dac soc:sound: > snd_soc_register_card() failed: -517
[ 2.259523] rpivid-mem feb00000.hevc-decoder: rpivid-hevcmem initialised: Registers at 0xfeb00000 length 0x00010000
[ 2.259844] snd-allo-boss-dac soc:sound: > snd_soc_register_card() failed: -517
[ 2.261877] rpivid-mem feb10000.rpivid-local-intc: rpivid-intcmem initialised: Registers at 0xfeb10000 length 0x00001000
[ 2.262224] snd-allo-boss-dac soc:sound: > snd_soc_register_card() failed: -517
[ 2.267148] rpivid-mem feb20000.h264-decoder: rpivid-h264mem initialised: Registers at 0xfeb20000 length 0x00010000
[ 2.267575] snd-allo-boss-dac soc:sound: > snd_soc_register_card() failed: -517
[ 2.283956] snd-allo-boss-dac soc:sound: > snd_soc_register_card() failed: -517
[ 2.284116] rpivid-mem feb30000.vp9-decoder: rpivid-vp9mem initialised: Registers at 0xfeb30000 length 0x00010000
[ 2.284422] snd-allo-boss-dac soc:sound: > snd_soc_register_card() failed: -517
[ 2.547874] pcm512x 1-004d: supply AVDD not found, using dummy regulator
[ 2.548243] pcm512x 1-004d: supply DVDD not found, using dummy regulator
[ 2.548291] pcm512x 1-004d: supply CPVDD not found, using dummy regulator

Now off for a backup, then i’ll upgrade to beta 7.9.2

Upgraded to beta 7.9.2, o!mpd still plays fine, didn’t see any changes in any config files.

Installed kodi, reboot and o!mpd is unable to play, more details in new thread https://dietpi.com/forum/t/rpi4b-v8-7-9-2-beta-bossdac-mpd-stopped-working-after-kodi-19-3-install/6047/1