The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Allo Piano 2.1 and Digital volume
#1
Using a Rpi 3B+, withe Allo Kali reclocker and Allo Piano 2.1 I noticed in the output of "moodeutl -l " that the volume control was set to "Digital" and an errormessage : amixer: Unable to find simple control 'Digital',0

Code:
pi@moode:~ $ moodeutl -l
20230201 171323 worker: --
20230201 171323 worker: -- Start moOde 8 series
20230201 171323 worker: --
20230201 171323 worker: Successfully daemonized
20230201 171326 worker: File check (OK)
20230201 171327 worker: Session vacuumed
20230201 171327 worker: Session loaded
20230201 171327 worker: Debug logging (OFF)
20230201 171327 worker: --
20230201 171327 worker: -- Audio debug
20230201 171327 worker: --
20230201 171327 worker: ALSA cards: (0:PianoDACPlus | 1:empty | 2:empty | 3:empty
20230201 171327 worker: MPD config: (0:Allo Piano 2.1 Hi-Fi DAC | mixer:(Digital) | card:0)
20230201 171328 worker: ALSA mixer actual (Digital)
20230201 171328 worker: ALSA Digital volume set to (amixer: Unable to find simple control 'Digital',0)
20230201 171328 worker: --
20230201 171328 worker: -- System
20230201 171328 worker: --
20230201 171330 worker: Host      (moode)
20230201 171330 worker: moOde     (8.2.5 2023-01-20)
20230201 171330 worker: RaspiOS   (11.6)
20230201 171330 worker: Kernel    (5.15.84-v7+ #1613)
20230201 171330 worker: Platform  (Pi-3B+ 1.3 1GB)
20230201 171330 worker: ARM arch  (armv7l, 32-bit)
20230201 171330 worker: MPD ver   (0.23.11)
20230201 171330 worker: CPU gov   (ondemand)
20230201 171330 worker: USB boot  (enabled)
20230201 171330 worker: File sys  (expanded)
20230201 171330 worker: HDMI port (Off)
20230201 171330 worker: Sys LED0  (Off)
20230201 171330 worker: Sys LED1  (Off)
20230201 171330 worker: --
20230201 171330 worker: -- Network
20230201 171330 worker: --
20230201 171330 worker: eth0 adapter exists
20230201 171330 worker: eth0 check for address (Off)
20230201 171330 worker: IP addr (192.168.1.185)
20230201 171330 worker: Netmask (255.255.255.0)
20230201 171330 worker: Gateway (192.168.1.1)
20230201 171331 worker: Pri DNS (192.168.1.177)
20230201 171331 worker: Domain  ()
20230201 171331 worker: wlan0 adapter does not exist
20230201 171331 worker: apd0 router mode (Off)
20230201 171331 worker: --
20230201 171331 worker: -- Software update
20230201 171331 worker: --
20230201 171331 worker: Automatic check (Off)
20230201 171331 worker: --
20230201 171331 worker: -- Audio config
20230201 171331 worker: --
20230201 171331 worker: MPD conf updated
20230201 171331 worker: ALSA card number (0)
20230201 171331 worker: MPD audio output (Allo Piano 2.1 Hi-Fi DAC)
20230201 171331 worker: Audio formats (S16_LE, S24_LE, S32_LE)
20230201 171331 worker: ALSA mixer name (Digital)
20230201 171331 worker: MPD mixer type (fixed 0dB)
20230201 171331 worker: Hdwr volume controller not detected
20230201 171331 worker: ALSA output mode (Default: plughw)
20230201 171331 worker: ALSA loopback (Off)
20230201 171332 worker: Piano 2.1 output mode (2.0)
20230201 171336 worker: Piano 2.1 initialized
20230201 171336 worker: Reset renderer active flags
20230201 171337 worker: CamillaDSP (off)
20230201 171337 worker: --
20230201 171337 worker: -- File sharing
20230201 171337 worker: --
20230201 171337 worker: SMB file sharing (On)
20230201 171337 worker: NFS file sharing (Off)
20230201 171337 worker: --
20230201 171337 worker: -- MPD startup
20230201 171337 worker: --
20230201 171345 worker: MPD started
20230201 171345 worker: MPD accepting connections
20230201 171345 worker: MPD output 1 ALSA Default (On)
20230201 171345 worker: MPD output 2 ALSA Bluetooth (Off)
20230201 171345 worker: MPD output 3 HTTP Server (Off)
20230201 171345 worker: MPD crossfade (off)
20230201 171345 worker: MPD ignore CUE files (yes)
20230201 171345 worker: --
20230201 171345 worker: -- Music sources
20230201 171345 worker: --
20230201 171345 worker: USB sources
20230201 171345 worker: No drives found
20230201 171345 worker: NAS sources
20230201 171345 worker: None configured
20230201 171345 worker: --
20230201 171345 worker: -- Feature availability
20230201 171345 worker: --
20230201 171345 worker: Input select (available)
20230201 171345 worker: Input (MPD)
20230201 171345 worker: Output (Allo Piano 2.1 Hi-Fi DAC)
20230201 171345 worker: Bluetooth (available)
20230201 171345 worker: AirPlay renderer (available)
20230201 171345 worker: Spotify renderer (available)
20230201 171345 worker: Squeezelite (available)
20230201 171345 worker: RoonBridge renderer (not installed)
20230201 171345 worker: Multiroom sender (available)
20230201 171345 worker: Multiroom receiver (available)
20230201 171345 worker: UPnP renderer (available)
20230201 171345 worker: DLNA server (available)
20230201 171345 worker: GPIO button handler (available)
20230201 171345 worker: Stream recorder (n/a)
20230201 171345 worker: HTTPS-Only mode (n/a)
20230201 171345 worker: --
20230201 171345 worker: -- Other
20230201 171345 worker: --
20230201 171345 worker: USB volume knob (Off)
20230201 171345 worker: USB auto-mounter (udisks-glue)
20230201 171345 worker: Saved MPD vol level (0)
20230201 171345 worker: Preamp volume level (0)
20230201 171345 worker: MPD volume level (0) restored
20230201 171345 worker: ALSA volume level (None)
20230201 171345 worker: Auto-play (On)
20230201 171345 worker: Auto-playing id (1)
20230201 171345 worker: LocalUI (Off)
20230201 171345 worker: Automatic CoverView (Off)
20230201 171345 worker: On-screen keyboard (Off)
20230201 171345 worker: Library scope (all)
20230201 171345 worker: View reset to playback
20230201 171345 worker: Maintenance interval (360 minutes)
20230201 171345 worker: Screen saver activation (Never)
20230201 171345 worker: Session permissions (OK)
20230201 171345 worker: Mount monitor (Off)
20230201 171345 worker: Watchdog started
20230201 171345 worker: Ready

Issuing the command "amixer scontrols" gives the following result:
Code:
pi@moode:~ $ amixer scontrols
Simple mixer control 'Master',0
Simple mixer control 'Dual Mode',0
Simple mixer control 'Lowpass',0
Simple mixer control 'Main Analogue',0
Simple mixer control 'Main Analogue Playback Boost',0
Simple mixer control 'Main DSP Program',0
Simple mixer control 'Main Deemphasis',0
Simple mixer control 'Sub Analogue',0
Simple mixer control 'Sub Analogue Playback Boost',0
Simple mixer control 'Sub DSP Program',0
Simple mixer control 'Sub Deemphasis',0
Simple mixer control 'Subwoofer',0
Simple mixer control 'Subwoofer mode',0


Notice that the simple control "Digital" is not mentioned, apparently not a valid control.
I did make a request to "allo" for explanation and I did receive the following answer: 
"recent  RPI kernel  updates the piano 2.1 driver modified to make compatible with recent kernel updates,  uses volume control Master." 
So indeed "Digital is not valid anymore.

Digging through the Moode files I found 2 places where "Digtal is used"

1. /var/www/daemon/worker.php lines 566 - 588
Code:
// Configure Allo Piano 2.1
if ($_SESSION['i2sdevice'] == 'Allo Piano 2.1 Hi-Fi DAC') {
    $dualMode = sysCmd('/var/www/util/sysutil.sh get-piano-dualmode');
    $subMode = sysCmd('/var/www/util/sysutil.sh get-piano-submode');
    // Determine output mode
    if ($dualMode[0] != 'None') {
        $outputMode = $dualMode[0];
    } else {
        $outputMode = $subMode[0];
    }
    // Used in mpdcfg job and index.php
    $_SESSION['piano_dualmode'] = $dualMode[0];
    workerLog('worker: Piano 2.1 output mode (' . $outputMode . ')');

    // Workaround: bump one of the channels to initialize volume
    sysCmd('amixer -c0 sset "Digital" 0');
    sysCmd('speaker-test -c 2 -s 2 -r 48000 -F S16_LE -X -f 24000 -t sine -l 1');
    // Reset Main vol back to 100% (0dB) if indicated
    if (($_SESSION['mpdmixer'] == 'software' || $_SESSION['mpdmixer'] == 'none') && $_SESSION['piano_dualmode'] != 'None') {
        sysCmd('amixer -c0 sset "Digital" 100%');
    }
    workerLog('worker: Piano 2.1 initialized');
}

In the line "sysCmd('amixer -c0 sset "Digital" 0')" the word "Digital" can be replaced to "Master"
and also in the lines "if (($_SESSION['mpdmixer'] == 'software' || $_SESSION['mpdmixer'] == 'none') && $_SESSION['piano_dualmode'] != 'None') {
sysCmd('amixer -c0 sset "Digital" 100%');
}

2. /var/www/inc/alsa.php lines 37-60
Code:
    } else {
        // I2S devices
        // Mixer name exceptions
        if ($i2sDevice == 'HiFiBerry Amp(Amp+)') {
            $mixerName = 'Channels';
        } else if ($i2sDevice == 'HiFiBerry DAC+ DSP') {
            $mixerName = 'DSPVolume';
        } else if ($_SESSION['i2soverlay'] == 'hifiberry-dacplushd') {
            $mixerName = 'DAC';
        } else if ($i2sDevice == 'Allo Katana DAC' || $i2sDevice == 'Allo Boss 2 DAC' ||
            ($i2sDevice == 'Allo Piano 2.1 Hi-Fi DAC' && $_SESSION['piano_dualmode'] != 'None')) {
            $mixerName = 'Master';
        } else {
            // No mixer defined or use default mixer name "Digital"
            $result = sysCmd('/var/www/util/sysutil.sh get-mixername');
            if ($result[0] == '') {
                // Mixer name not defined => no actual mixer exists
                $mixerName = 'none';
            } else {
                // Mixer name defined => use default mixer name "Digital"
                $mixerName = 'Digital';
            }
        }
    }

in  the lines "} else if ($i2sDevice == 'Allo Katana DAC' || $i2sDevice == 'Allo Boss 2 DAC' ||
($i2sDevice == 'Allo Piano 2.1 Hi-Fi DAC' && $_SESSION['piano_dualmode'] != 'None')) {
$mixerName = 'Master';
} else {"
the section "($i2sDevice == 'Allo Piano 2.1 Hi-Fi DAC' && $_SESSION['piano_dualmode'] != 'None')" can be replaced by
"($i2sDevice == 'Allo Piano 2.1 Hi-Fi DAC')

Sorry for the lengthy explanation. To me this looks like a simple solution to avoid errormessages and off course to make sure that the alsavolume is set to 100% as sometimes this is not the case.
regards
Wim
Reply


Messages In This Thread
Allo Piano 2.1 and Digital volume - by Sunfish - 02-02-2023, 09:16 AM

Forum Jump: