Closed CV8R closed 1 year ago
Hello, please try with:
-e "ALSA_OUTPUT_MIXER_CONTROL=D10s "
Let me know please if this helps!
Hi, didn't work unfortunately. I just tried it now.
Can you also post the contents of
cat /proc/asound/cards
so I can add two presets for these DACs
Hi, didn't work unfortunately. I just tried it now.
Did you include the space before the closing quote symbol? Can you please post the complete docker run command so I can try? I have a similar D10, which has the same trailing space in the mixer device, so I can probably replicate the issue.
No problem, happy to help!
cat /proc/asound/cards
0 [D10s ]: USB-Audio - D10s
Topping D10s at usb-0000:01:00.0-1.2, high speed
0 [Balanced ]: USB-Audio - D10 Balanced
Topping D10 Balanced at usb-0000:01:00.0-1.2, high speed
Unfortunately this does not show spaces. Maybe send the contents of:
amixer -c 0 amixer -c 0 scontrols amixer -c 1 amixer -c 1 scontrols
Apologies that I haven't put it on newlines with \ Helps whilst testing to up arrow through the history.
docker run -d --restart unless-stopped --name=mpd-alsa --device /dev/snd -p 6600:6600 -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_CREATE='yes' -e ALSA_OUTPUT_DEVICE='hw:0' -e ALSA_OUTPUT_AUTO_RESAMPLE='no' -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
Hi, didn't work unfortunately. I just tried it now.
As an alternative try setting
-e ALSA_OUTPUT_AUTO_FIND_MIXER=yes
the script should automatically find the mixer control
Apologies that I haven't put it on newlines with \ Helps whilst testing to up arrow through the history.
docker run -d --restart unless-stopped --name=mpd-alsa --device /dev/snd -p 6600:6600 -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_CREATE='yes' -e ALSA_OUTPUT_DEVICE='hw:0' -e ALSA_OUTPUT_AUTO_RESAMPLE='no' -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
Does this mean that it worked?
Also it would be useful to post the container logs with:
docker logs mpd-alsa
thank you
family-room:~$` amixer -c 0
Simple mixer control 'D10s ',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 127
Mono: Playback 127 [100%] [0.00dB] [on]
family-room:~$
family-room:~$
family-room:~$ amixer -c 0 scontrols
Simple mixer control 'D10s ',0
family-room:~$
family-room:~$
family-room:~$ amixer -c 1
Invalid card number '1'.
family-room:~$
family-room:~$
family-room:~$ amixer -c 1 scontrols
Invalid card number '1'.
family-room:~$
family-room:~$
Apologies that I haven't put it on newlines with \ Helps whilst testing to up arrow through the history.
docker run -d --restart unless-stopped --name=mpd-alsa --device /dev/snd -p 6600:6600 -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_CREATE='yes' -e ALSA_OUTPUT_DEVICE='hw:0' -e ALSA_OUTPUT_AUTO_RESAMPLE='no' -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
So did that work?
nope.
Ok thank you for the info. Please post the container logs. Maybe try with ALSA_OUTPUT_AUTO_FIND_MIXER=yes instead of ALSA_OUTPUT_MIXER_CONTROL
My settings on the D10:
-e ALSA_OUTPUT_CREATE=yes
-e ALSA_OUTPUT_ENABLED=yes
-e ALSA_OUTPUT_DEVICE=hw:D10
-e"ALSA_OUTPUT_MIXER_CONTROL=D10 "
-e ALSA_OUTPUT_MIXER_TYPE=hardware
-e ALSA_OUTPUT_NAME=d10
From the other DAC - it's plugged into another Pi.
Actually this one is running DietPi. The D10s is plugged into an Pi running Alpine Linux. Not sure if that's related.
amixer -c 0
Simple mixer control 'D10 Balanced',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 127
Mono: Playback 72 [57%] [-55.00dB] [on]
amixer -c 0 scontrols
Simple mixer control 'D10 Balanced',0
From the other DAC - it's plugged into another Pi.
Actually this one is running DietPi. The D10s is plugged into an Pi running Alpine Linux. Not sure if that's related.
amixer -c 0 Simple mixer control 'D10 Balanced',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 127 Mono: Playback 72 [57%] [-55.00dB] [on] amixer -c 0 scontrols Simple mixer control 'D10 Balanced',0
I don't believe that using dietpi should make any difference...
Don't bother with the ALSA_OUTPUT_AUTO_FIND_MIXER because there is a bug anyway on that part. Maybe try my d10 config and adapt to your D10s... let me know
I tried this config and audio level not changing or "dB gain:" to be specific.
docker run -d --restart unless-stopped --name=mpd-alsa --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:0" -e ALSA_OUTPUT_AUTO_FIND_MIXER="yes" -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_MIXER_TYPE="hardware" -e ALSA_OUTPUT_NAME="d10-4x-nodsd" -e ALSA_OUTPUT_INTEGER_UPSAMPLING="yes" -e ALSA_OUTPUT_ALLOWED_FORMATS_PRESET="4x-nodsd" -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
also tried
-e "ALSA_OUTPUT_MIXER_CONTROL=D10s "
and
-e ALSA_OUTPUT_DEVICE=hw:D10
with hw:D10 there was no playback so had to use hw:0
The output works okay but when changing the volume alsamixer doesn't reflect the change in level (and the actual DAC output level). It is fixed at whatever it was last playing at - with a device that can control the level.
your dac is D10s, so you should replace hw:D10 with hw:D10s
Let's get some stuff out of the way (upsampling...) Maybe try this...
docker run -d --restart unless-stopped --name=mpd-alsa --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:D10s" -e ALSA_OUTPUT_AUTO_FIND_MIXER="yes" -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_MIXER_TYPE="hardware" -e ALSA_OUTPUT_NAME="d10-4x-nodsd" -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
container logs
Build mode: [full]
MPD from repo is available at [/usr/bin/mpd]
Integer upsampling supported: [yes]
Compiled mpd binary: [/app/bin/compiled/mpd]
Compiled mpd ups binary: [/app/bin/compiled/mpd-ups]
MAX_OUTPUTS=[20]
Selected binary: [/app/bin/compiled/mpd]
Loading built-in alsa_presets...
Loading preset [dac.device]=[hw:DAC]
Loading preset [x20.device]=[hw:x20]
Loading preset [aune-s6-sw.name]=[Aune S6 USB DAC]
Loading preset [aune-s6-sw.device]=[hw:DAC]
Loading preset [aune-s6-sw.mixer-type]=[software]
Loading preset [aune-s6.name]=[Aune S6 USB DAC]
Loading preset [aune-s6.device]=[hw:DAC]
Loading preset [aune-s6.mixer-type]=[hardware]
Loading preset [aune-s6.mixer-device]=[hw:DAC]
Loading preset [aune-s6.mixer-control]=[S6 USB DAC Output]
Loading preset [gustard-x12-sw.name]=[Gustard X12 USB DAC]
Loading preset [gustard-x12-sw.device]=[hw:x20]
Loading preset [gustard-x12-sw.mixer-type]=[software]
Loading preset [gustard-x12.name]=[Gustard X12 USB DAC]
Loading preset [gustard-x12.device]=[hw:x20]
Loading preset [gustard-x12.mixer-type]=[hardware]
Loading preset [gustard-x12.mixer-device]=[hw:x20]
Loading preset [gustard-x12.mixer-control]=[xCORE USB Audio 2.0 Output]
Loading preset [gustard-u12-sw.name]=[Gustard U12 USB DDC]
Loading preset [gustard-u12-sw.device]=[hw:x20]
Loading preset [gustard-u12-sw.mixer-type]=[software]
Loading preset [gustard-u12.name]=[Gustard U12 USB DDC]
Loading preset [gustard-u12.device]=[hw:x20]
Loading preset [gustard-u12.mixer-type]=[hardware]
Loading preset [gustard-u12.mixer-device]=[hw:x20]
Loading preset [gustard-u12.mixer-control]=[xCORE USB Audio 2.0 Output]
Loading preset [topping-d10-sw.name]=[Topping D10]
Loading preset [topping-d10-sw.device]=[hw:D10]
Loading preset [topping-d10-sw.mixer-type]=[software]
Loading preset [topping-d10.name]=[Topping D10]
Loading preset [topping-d10.device]=[hw:D10]
Loading preset [topping-d10.mixer-type]=[hardware]
Loading preset [topping-d10.mixer-device]=[hw:D10]
Loading preset [topping-d10.mixer-control]=[D10 ]
Loading preset [hifiberry-dac-plus.name]=[Hifiberry DAC]
Loading preset [hifiberry-dac-plus.device]=[hw:sndrpihifiberry]
Loading preset [fiio-e18-sw.name]=[FiiO E18]
Loading preset [fiio-e18-sw.device]=[hw:DACE18]
Loading preset [fiio-e18-sw.mixer-type]=[software]
Loading preset [fiio-e18.name]=[FiiO E18]
Loading preset [fiio-e18.device]=[hw:DACE18]
Loading preset [fiio-e18.mixer-control]=[PCM]
Loading preset [fiio-e18.mixer-type]=[hardware]
Loading preset [fiio-e18.mixer-device]=[hw:DACE18]
Loading preset [yulong-d200.name]=[Yulond D200 USB DAC]
Loading preset [yulong-d200.device]=[hw:DAC]
Loading preset [aune-x1s.name]=[Aune X1S]
Loading preset [aune-x1s.device]=[hw:DAC]
Loading preset [peachtree-dacit.name]=[PeachTree DacIt]
Loading preset [peachtree-dacit.device]=[hw:DAC]
Loading preset [pi-headphones.name]=[Raspberry Pi Headphones]
Loading preset [pi-headphones.device]=[hw:Headphones]
Loading preset [ifi-zen-dac.name]=[Ifi Zen USB DAC]
Loading preset [ifi-zen-dac.device]=[hw:Audio,0]
Loading preset [topping-dx5.name]=[Topping DX5 USB DAC]
Loading preset [topping-dx5.device]=[hw:DX5]
Loading preset [gustard-x16.name]=[Gustard X16 USB DAC]
Loading preset [gustard-x16.device]=[hw:G20]
Loading preset [topping-e30.name]=[Topping E30 USB DAC]
Loading preset [topping-e30.device]=[hw:E30]
Finished loading built-in alsa_presets
No additional preset file found
There are [60] available alsa_presets
ANY_PULSE=[0]
ANY_ALSA=[1]
Pulse packages not needed.
User mode disabled
Processing HOST_PERMISSIONS index 0
HOST_PERMISSIONS at index 0 is set to
Processing HOST_PERMISSIONS index 1
HOST_PERMISSIONS at index 1 is set to
Processing HOST_PERMISSIONS index 2
HOST_PERMISSIONS at index 2 is set to
Processing HOST_PERMISSIONS index 3
HOST_PERMISSIONS at index 3 is set to
Processing HOST_PERMISSIONS index 4
HOST_PERMISSIONS at index 4 is set to
Processing HOST_PERMISSIONS index 5
HOST_PERMISSIONS at index 5 is set to
Processing HOST_PERMISSIONS index 6
HOST_PERMISSIONS at index 6 is set to
Processing HOST_PERMISSIONS index 7
HOST_PERMISSIONS at index 7 is set to
Processing HOST_PERMISSIONS index 8
HOST_PERMISSIONS at index 8 is set to
Processing HOST_PERMISSIONS index 9
HOST_PERMISSIONS at index 9 is set to
Processing HOST_PERMISSIONS index 10
HOST_PERMISSIONS at index 10 is set to
Processing PASSWORD index 0
PASSWORD at index 0 is set to
Processing PASSWORD index 1
PASSWORD at index 1 is set to
Processing PASSWORD index 2
PASSWORD at index 2 is set to
Processing PASSWORD index 3
PASSWORD at index 3 is set to
Processing PASSWORD index 4
PASSWORD at index 4 is set to
Processing PASSWORD index 5
PASSWORD at index 5 is set to
Processing PASSWORD index 6
PASSWORD at index 6 is set to
Processing PASSWORD index 7
PASSWORD at index 7 is set to
Processing PASSWORD index 8
PASSWORD at index 8 is set to
Processing PASSWORD index 9
PASSWORD at index 9 is set to
Processing PASSWORD index 10
PASSWORD at index 10 is set to
Qobuz Plugin Enabled: []
Creating Alsa output for output [0]
Alsa preset for ALSA Out [0] is []
Searching alsa preset value for PresetName [device] Key []
Not found alsa preset value for PresetName [device] Key []
Searching alsa preset value for PresetName [mixer-type] Key []
Not found alsa preset value for PresetName [mixer-type] Key []
Searching alsa preset value for PresetName [mixer-device] Key []
Not found alsa preset value for PresetName [mixer-device] Key []
Searching alsa preset value for PresetName [mixer-control] Key []
Not found alsa preset value for PresetName [mixer-control] Key []
Searching alsa preset value for PresetName [mixer-index] Key []
Not found alsa preset value for PresetName [mixer-index] Key []
ALSA OUTPUT [0] requires INTEGER_UPSAMPLING []
No additional outputs provided
# mpd configuration file
database {
plugin "simple"
path "/db/tag_cache"
}
music_directory "/music"
playlist_directory "/playlists"
state_file "/db/state"
state_file_interval "10"
sticker_file "/db/sticker"
bind_to_address "0.0.0.0"
port "6600"
log_file "/log/mpd.log"
zeroconf_enabled "no"
decoder {
plugin "wildmidi"
enabled "no"
}
input {
plugin "curl"
}
audio_output {
type "alsa"
name "alsa"
device "hw:0"
mixer_control "D10s"
auto_resample "no"
}
replaygain "off"
replaygain_preamp "0"
replaygain_missing_preamp "0"
replaygain_limit "yes"
volume_normalization "no"
filesystem_charset "UTF-8"
Removing player state information from state file [/db/state]
CMD_LINE=[/app/bin/compiled/mpd --stderr --no-daemon /app/conf/mpd.conf]
mixer: Failed to read mixer for 'alsa': no such mixer control: D10s
This one mixer_control "D10s" still does not have a space...
Stupid question, does it work if you remove ALSA_OUTPUT_MIXER_CONTROL and set ALSA_OUTPUT_MIXER_TYPE to "software"?
Let's get some stuff out of the way (upsampling...) Maybe try this...
docker run -d --restart unless-stopped --name=mpd-alsa --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:D10s" -e ALSA_OUTPUT_AUTO_FIND_MIXER="yes" -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_MIXER_TYPE="hardware" -e ALSA_OUTPUT_NAME="d10-4x-nodsd" -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
I tried this too, cut n paste and it still did not work.
not sure if this is the correct part of the container log but still drops the trailing space.
audio_output {
type "alsa"
name "d10-4x-nodsd"
enabled "yes"
device "hw:D10s"
mixer_type "hardware"
mixer_control "D10s"
}
There is definitely an issue here with reading variables if there are trailing spaces. Also the ALSA_OUTPUT_AUTO_FIND_MIXER does not work as it should after I switched to the new way of declaring outputs. So while I try to fix this, you can do two thing in alternative:
a) try with software volume with ALSA_OUTPUT_MIXER_TYPE=software, then skip device, mixer etc -> a simpler config b) remove the output and put the desider config in the additional-outputs.txt file (see doc for how to do this)
Above makes sense, will try the additional-outputs.txt approach tomorrow.
I just tried the software mixer type and that allows the audio level to change but obviously not changing the DAC level which is reflected in alsamixer.
Thanks so much for all the cool work - very helpful and thanks for the support today.
Getting late here so signing out.
Cheers, CV8R
So this works for me on my D10:
docker run -it --rm --name mpd-delete-me --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE=hw:D10 -e ALSA_OUTPUT_MIXER_TYPE=software -e ALSA_OUTPUT_NAME="d10-4x-nodsd" giof71/mpd-alsa:local
So trying to adapt to your settings, it should become:
docker run -d --name mpd-alsa --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE=hw:D10s -e ALSA_OUTPUT_MIXER_TYPE=software -v ${HOME}/Music:/music:ro -v ${HOME}/.mpd/playlists:/playlists -v ${HOME}/.mpd/db:/db giof71/mpd-alsa
At least this should be a stop-gap solution. Let me know when you can try it!
Hello @CV8R, everything should work now.
I have also created four new presets, topping-d10s
, topping-d10s-sw
, topping-d10-balanced
, topping-d10-balanced-sw
.
The non -sw
version will setup hardware volume.
Apart from using the presets (I cannot test those myself unfortunately), the following are my two alternative test docker run commands. The second uses ALSA_OUTPUT_AUTO_FIND_MIXER which does the work of selecting the mixer for us.
docker run -it --rm --name mpd-d10-ephemeral --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:D10" -e "ALSA_OUTPUT_MIXER_CONTROL=D10 " -e ALSA_OUTPUT_MIXER_DEVICE="hw:D10" -e ALSA_OUTPUT_MIXER_TYPE="hardware" giof71/mpd-alsa:latest
docker run -it --rm --name mpd-d10-ephemeral --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:D10" -e ALSA_OUTPUT_AUTO_FIND_MIXER="yes" giof71/mpd-alsa:latest
So considering your dac D10s, those should become (let's hope I got it right):
docker run -it --rm --name mpd-d10s-ephemeral --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:D10s" -e "ALSA_OUTPUT_MIXER_CONTROL=D10s " -e ALSA_OUTPUT_MIXER_DEVICE="hw:D10s" -e ALSA_OUTPUT_MIXER_TYPE="hardware" giof71/mpd-alsa:latest
docker run -it --rm --name mpd-d10s-ephemeral --device /dev/snd -p 6600:6600 -e ALSA_OUTPUT_CREATE="yes" -e ALSA_OUTPUT_ENABLED="yes" -e ALSA_OUTPUT_DEVICE="hw:D10s" -e ALSA_OUTPUT_AUTO_FIND_MIXER="yes" giof71/mpd-alsa:latest
Let me know if this helps!
HI @GioF71,
Thank you! It's now working as it should. I can even quote it like this -e ALSA_OUTPUT_MIXER_CONTROL="D10s ".
Hardware and Software control works too.
Cheers.
Hello @CV8R, I am so happy to hear it is working. Would you like to test the presets?
you might use the variable ALSA_OUTPUT_PRESET and set it to "topping-d10s", then you can skip ALSA_OUTPUT_DEVICE, ALSA_OUTPUT_MIXER_TYPE, ALSA_OUTPUT_MIXER_DEVICE, ALSA_OUTPUT_MIXER_CONTROL and let the preset do the work for you. Also there is another preset for "topping-d10-balanced", it works the same way.
Let me know, enjoy you now working mpd container :-)
I gave it a quick go and appeared to work as expected but I need to do some reading on how the work.
Hello, I am changing the status of this bug to Closed. However, if you try the presets and find any problem, please open another issue. In any case, we can continue on this issue if there are further relevant considerations. Thank you.
This issue is closed and almost a year old but commenting anyway...
Through the blur of searching issues in other repos, audio related, I am near certain I came upon a discussion very closely related, if not exactly related to what I've gleaned from above.
I believe the solution was to reference as "d10\ "
Note the anchor escaping the space.
Looks like there are commits applied to this issue as well so may not be needed. But if I can remember/find the reference I'm thinking of I'll add it here.
Hello @ezekieldas, feel free to open a new issue if you think the issue still stands and/or something can be improved.
Hi, I have two Topping D10 DACs. A D10s and a D10 Balanced.
The amixer name for the D10s is actually "D10s " i.e. has a space at the end. I haven't been able to pass an env var with the trailing space which is preventing me from controlling the DAC.
alsamixer shows the level change for the D10 Balanced but not the D10s.
amixer outputs are below along with the env vars I am setting. Tried "D10s " and 'D10s ' double quoting and what not.