Allo Piano 2.1 Sub volume not linked to Master volume (Pi 4B + volumio 3 + Spotify )

So I have done some experimenting with wiring. In dual-stereo, both LR and LR Sub RCA outputs do produce sound but LR Sub volume is fixed while LR is controlled by the master.

So I don’t know. It’s not a board thing I think as when using “Sub” as Mix Control Name, the volume can be controlled but otherwise, in “Master” as Mix Control Name, all modes have the same issue.

Would love to know if I’m the only one with that issue or if that’s just a Volumio 3 driver issue for example.

Thanks in advance!

Hi MightMess, welcome to Volumio. :smiley:

No solution I’m afraid from me I’m afraid, and it’s not something that I use in an inaccessible Piano 2.1. It does sound as though it could well be a bug in your particular use case. Any other Piano 2.1 users here have any experience with the sub RCA outputs? @Josh2000?

1 Like

Thanks for the welcome and the reply. Hopefully, others will be able to help out.

I had a brainwave and my dev mind kicked in. I found the issue :slight_smile:

So the volume works when using Volumio’s volume! I’ve been using the volume in the Spotify App. So it’s an issue with SpotifyConnect Plugin I guess? Where should I report this @chsims1 ?

So happy it works now :slight_smile:

@balbuze and @ashthespy sorry for the tagging, maybe you rather have this somewhere else but thought you might be interested. Maybe it’s not a plugin thing, I don’t know how the Integration work.

Thanks for the heads up, personally I like to know the outcomes of topics that I have posted to. Yes, Balbuze is the correct contact for the Spotify Connect plugin.

1 Like

Perhaps I’m being daft - As far as I can understand from Allo’s docs (and the driver code - linux/allo-piano-dac-plus.c at rpi-5.10.y · raspberrypi/linux · GitHub) you need to choose the Master Playback Volume to change volume for both outputs.

IIRC this might also be related Piano 2.1 left channel broken - #9 by ashthespy

From seeing how Volumio’s volume logic tackles this case (essentially just sets Digital and then checks for this DAC and sets Subwoofer volumio3-backend/volumecontrol.js at 8dc851370bb529cc1e945f7fcc025597bcd7189a · volumio/volumio3-backend · GitHub), using the Master Playback Volume should technically do the same, but at the ALSA driver level which should be much more efficient than the current way. Or am I missing something obvious here?

1 Like

Hi @ashthespy, Thanks a lot for replying.

I agree with you, on paper it should work with using Master as the playback volume.

Maybe I wasn’t very clear in my solution. I’m using “Master” as the playback option. It does work but only when using the Volumio’s volume control. If I use Spotify’s volume control (in the Spotify App), it only changes the first Dac (L/R) . So maybe SpotifyConnect plugin links to Digital volume and not Master? Sounds like you were saying it’s not in that thread below.

Just read this thread properly and sounds like it’s linked although the sub volume doesn’t fade away after a while.

I agree this is weird and it sounds like you believe the plugin is using the correct Volume Mixer automatically.

As you don’t have a piano 2.1, is there a way for me to see what the SpotifyConnect plugin is using?

{"status":"play","title":"Drone Logic","artist":"Daniel Avery","album":"Drone Logic","albumart":"https://i.scdn.co/image/ab67616d0000b273605da02be8e182bc9966bcc2","uri":"spotify:track:7JRN5xOUIrnI4crUMOt6X4","trackType":"spotify","seek":8001,"duration":430,"samplerate":"44.1 KHz","bitdepth":"16 bit","channels":2,"consume":false,"volume":20,"dbVolume":null,"mute":false,"disableVolumeControl":false,"stream":false,"updatedb":false,"volatile":true,"service":"volspotconnect2"}

Not sure if there is anything useful in there, says that it’s using Master :man_shrugging:

[SpotifyConnect] Creating VLS config file
info: CoreCommandRouter::executeOnPlugin: alsa_controller , getConfigParam
info: CoreCommandRouter::executeOnPlugin: alsa_controller , getConfigParam
xcb_connection_has_error() returned true
info: CoreCommandRouter::volumioUpdateVolumeSettings
info: Updating Volume Controller Parameters: Device: 2 Name: Allo Piano 2.1 Mixer: Master Max Vol: 60 Vol Curve; logarithmic Vol Steps: 2
info: CoreCommandRouter::getUIConfigOnPlugin
info: CoreStateMachine::resetVolumioState
info: CoreStateMachine::getcurrentVolume
info: CoreCommandRouter::volumioRetrievevolume
xcb_connection_has_error() returned true
info: CoreCommandRouter::executeOnPlugin: i2s_dacs , getI2sOptions
info: CoreCommandRouter::executeOnPlugin: system , getConfigParam
info: CoreCommandRouter::executeOnPlugin: i2s_dacs , getI2sStatus
info: Getting Alsa Cards List without I2S DAC
xcb_connection_has_error() returned true
info: CoreCommandRouter::executeOnPlugin: i2s_dacs , getI2SNumber
info: CoreCommandRouter::executeOnPlugin: system , getConfigParam
xcb_connection_has_error() returned true
xcb_connection_has_error() returned true
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getConfigParam
info: CoreCommandRouter::executeOnPlugin: mpd , getPlaybackMode
xcb_connection_has_error() returned true
info: CoreCommandRouter::executeOnPlugin: system , getAdvancedSettingsStatus
info: VolumeController:: Volume=20 Mute =false
info: CoreStateMachine::pushState
info: CorePlayQueue::getTrack 0
info: CoreCommandRouter::volumioPushState
info: CoreStateMachine::updateTrackBlock
info: CorePlayQueue::getTrackBlock
info: CoreCommandRouter::volumioRetrievevolume
info: VolumeController:: Volume=20 Mute =false
info: CoreStateMachine::pushState
info: CorePlayQueue::getTrack 0
info: CoreCommandRouter::volumioPushState
[SpotifyConnect] Restarting Vollibrespot Daemon
 volumio : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/systemctl restart volspotconnect2.service
pam_unix(sudo:session): session opened for user root by (uid=0)
Stopping Volspotconnect2 Daemon...
volspotconnect2.service: Main process exited, code=killed, status=15/TERM
volspotconnect2.service: Succeeded.
Stopped Volspotconnect2 Daemon.
Started Volspotconnect2 Daemon.
------------------------------------ BT MESSAGE: BT STATUS: running
BT PLUGIN MESSAGE: Playing: false
BT PLUGIN MESSAGE: VOLATILE: undefined
BT PLUGIN MESSAGE: STATE:undefined
pam_unix(sudo:session): session closed for user root
------------------------------------ BT MESSAGE: BT STATUS: waiting
BT PLUGIN MESSAGE: Playing: false
BT PLUGIN MESSAGE: VOLATILE: undefined
BT PLUGIN MESSAGE: STATE:undefined
info: MRS: Updating multiroomSync output
info: MRS: Updating multiroomSync output
[SpotifyConnect] Vollibrespot Daemon service restarted!
vollibrespot v0.2.3 769ce77 2021-06-04 (librespot 08d8bcc 2020-10-07) -- Built On 2021-06-04
Reading Config from "volspotify.toml"
[Vollibrespot] : Using Alsa backend with device: volumio
info: VolumeController:: Volume=20 Mute =false
info: CoreStateMachine::pushState
info: CorePlayQueue::getTrack 0
info: CoreCommandRouter::volumioPushState
info: MRS: Updating multiroomSync output
info: MRS: Updating multiroomSync output
[Vollibrespot] : Failed to register IPv6 receiver: Os { code: 19, kind: Other, message: "No such device" }
info: MRS: Updating multiroomSync output
info: MRS: Updating multiroomSync output
info: VolumeController::SetAlsaVolume20
info: CoreStateMachine::pushState
info: CorePlayQueue::getTrack 0
info: CoreCommandRouter::volumioPushState
info: MRS: Updating multiroomSync output
info: MRS: Updating multiroomSync output

Let me know if I can help find the issue.

Indeed - the volume control logic of Volumio checks (on each Volume change event :open_mouth:) if a Piano DAC is being used, and additionally sets the Subwoofer volume.

The plugin should pickup the Mixer set in Volumio’s settings. But you can confirm by checking what it is configured to use with cat /data/plugins/music_service/volspotconnect2/volspotify.toml Or look into a few more lines from the LiveLog :slight_smile:

A more insightful test would be to run the amixer commands directly as depicted by Allo and check how your sub’s output volume changes when using Master, Digital and Subwoofer i.e to confirm that those 3 controls do as described in their docs.

Ok, so looks good

Output]
device = 'volumio'
initial-volume = 15
mixer = 'alsa' # softvolume or alsa
mixer-name = 'Master'
mixer-card = 'hw:2'
mixer-index = 0
# Disable alsa's mapped volume scale (cubic). Default false
mixer-linear-volume = false
backend = 'alsa'

I’m not sure how alsamixer is supposed to behave in the terminal but changing the master volume doesn’t change the Sub volume. This is so weird! Why would it work in Volumio but not there? I have to select the soundcard at the start otherwise by default it shows me Pulseaudio.

I can change the sub volume on it own and that is reflected in the sound but when using the Master volume it does nothing to the sub. I have no idea!


The two in the middle are set to 0 because I did that to see what happen.

I guess this is it, can’t find the needle and will have to use Volumio’s volume instead of Spotify. Maybe I will have another go later this week at looking into Allo documentation.

Thanks again for pointing me in the right direction, SpotifyConnect is a great plugin and I use it on all my other devices

Well, cause Volumio hardcodes for this quirk –

 if (volumecurve === 'logarithmic') {
        amixer(['-M', 'set', '-c', device, mixer, 'unmute', val + '%'], function (err) {
          cb(err);
        });
        if (devicename === 'PianoDACPlus' || devicename === 'Allo Piano 2.1' || devicename === 'PianoDACPlus multicodec-0') {
          amixer(['-M', 'set', '-c', device, 'Subwoofer', 'unmute', val + '%'], function (err) {
            if (err) {
              self.logger.error('Cannot set ALSA Volume: ' + err);
            }
          });
        }

Essentially, on every volume change event that is registered, it checks if the devicename is a PianoDAC, and if so, also additionally sets the Subwoofer mixers volume to match.

This is what I don’t get – perhaps reach out to the Allo people to confirm if there is something amiss here? This shouldn’t be how their documentation reads?

1 Like

Ok Cool, I will find time this week to contact them with this. Hopefully, they will be able to clarify and help

Looking again at the driver code, Master Playback Volume will work only in Dual Mono mode. i.e in this case, the left channel volume value is sent to DAC0, and the right to DAC1.

In all other modes, Master seems to just set the left and right volume levels only for DAC0.
I reckon this might be a regression caused in Update Allo Piano Plus dac driver by paul-1 · Pull Request #3943 · raspberrypi/linux · GitHub - but I could very well be wrong.
Prior to this (linux/allo-piano-dac-plus.c at 01d5eea0c847d3c337acf00dedcceaa1e5b8a548 · raspberrypi/linux · GitHub) left and right values were assigned to both dacs, just which channel DAC0 and 1 were assigned depending on dual mono or not.

I would have thought that since the hardware has registers for both left and right channels, that the Master Playback Volume would be a bit smarter depending on the current mode and assign the left and right volume levels accordingly:

for e.g in dual stereo and 2.2 modes
l,r → Dac0(l,r) & Dac1(l,r)
and in dual mono
l,r → Dac0(l,l) & Dac1(r,r)
Not sure how 2.1 would be handled, do you take the higher of the l,r values and map it to the mono sub output? ¯\_ (ツ)_/¯
l,r → Dac0(l,r) & Dac1(max(l,r))

At the end - best to reach of Allo, the driver “fixes” should be very trivial.

2 Likes

That is true! Didn’t think about that. That’s how I was using it at first. Allo support is only on their forum and didn’t get much love there initially. I have a busy week but will reach through other channels as well.

I brought up the possible regression the that PR, lets see if someone responds there :slight_smile:

Summary: ec0dcf3 is current, 01d5eea previous behaviour.

SHA dual_mode codec_dais[0] - L codec_dais[0] - R codec_dais[1] - L codec_dais[1] - R
ec0dcf3 ==1 left_val right_val
01d5eea ==1 left_val right_val
ec0dcf3 !=1 left_val right_val
01d5eea !=1 right_val left_val

Have also proposed a more appropriate (in my understanding) mapping?

dual_mode codec_dais[0] - L codec_dais[0] - R codec_dais[1] - L codec_dais[1] - R
==1 left_val right_val
!=1 left_val right_val left_val right_val
1 Like

Cool, I imagine PR will be the best place. That would be amazing if they could fix it, I imagine loads of people are using Volumio/SpotityConnect/Piano2.1

Thanks a lot

Hey Just read the conversation in the PR, sounds like it’s not going to happen. Sounds like a real headache. Might get myself a remote for this setup to manage the volume.

This driver will make your head hurt. If I recall, (2021 seems forever ago :slight_smile: The Master volume control really never worked properly in all modes. So I made a decision to try to make the Master control not make a wild volume swing. In Dual mode, master will keep Dac0 and Dac1 in volume sync. But when in non-Dual mode, Master only controls Dac0 and Sub volume controls Dac1 I would imagine the driver could be re-written to provide a true Master Volume. But it would need to handle relative volume adjustments for each DAC, Since you may not want them at the same volume. That’s not something I want to take on. Perhaps you can talk with @allocom.

I don’t have the hardware, so also don’t have much motivation to touch the driver, sorry!

Haha, that’s fair! I don’t have the skills to do this. I love my new setup, especially since adding the Kali into the mix. Maybe one day (@allo or someone will have a go at it)

Thanks again for the help.

Hi Chsims1,

All my setups are dual mono + kali - i do not like that subwoofer stuff but prefer decent speakers with bass chassis that are able to deliver deep bass without having some extra cabinet in the rooms. (nearly all speakers i use are made by Dynaudio btw.). So i did not have that issue.
Unfortunately i am short of time currently for doing tests on that, but there seems to be progress as i see here :-).

I am sure this could be a good thing for some small solutions to drive active - would be even more attractive to me for driving active 2 way speakers (with 4 amps) than that subwoofer stuff. But that is not designed by Allo - and tricking the firmware is only possible with an active TI account which.one get’s only as a commercial TI customer, to get their software… So for me it will stay at the Dual Mono solution that is doing very good for my use case.

Best Regards
Josef