VOLUME CONTROL ISSUES - Volumio1.55 - RPi Zero - DAC pHAT

Hi,

how to make software volume control in Raspberry Pi Zero DAC pHAT http://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install

volumio img from Marco b. comment on site
https://thepihut.com/collections/raspberry-pi-zero/products/dac-phat

root@volumio:~# sudo nano /etc/mpd.conf

sudo nano /boot/config.txt

root@volumio:~# aplay -l

nano /etc/asound.conf


alsamixer.jpg

Thanks a bunch man!! Got my volume control working - Seems like it may be a bug. I referenced your fix in this topic:
https://volumio.org/forum/rc2-volume-options-mixer-available-t4318.html#p20194

Got my Pi2 and Phat DAC working awesome!

Steve

anyone solves the volume control issue on 2.041 (it worked for me on the first 2. versions but not it stopped) Volume Control only runs on “None” if I change to “Software” there is no sound/playback

I got it working in 2.041 albeit using different hardware by the following:

In /volumio/app/volumecontrol.js below the var amixer { … }; block, add the following so we can call mpc:

[code] var mpc = function (args, cb) {

            var ret = '';
            var err = null;
            var p = spawn('mpc', args);

            p.stdout.on('data', function (data) {
                    ret += data;
            });

            p.stderr.on('data', function (data) {
                    err = new Error('MPC Mixer Error: ' + data);
            });

            p.on('close', function () {
                    cb(err, ret.trim());
            });

    };

[/code]
Then also change the self.setVolume { … }; block to use mpc instead of amixer by changing to this:

self.setVolume = function (val, cb) { // if (volumecurve === 'logarithmic') { // amixer(['-M', 'set', '-c', device, mixer, val + '%'], function (err) { // cb(err); // }); // if (devicename == 'PianoDACPlus' || devicename == 'Allo Piano 2.1') { // amixer(['-M', 'set', '-c', device, 'Subwoofer Digital', val + '%'], function (err) { // cb(err); // }); // } // } else { // amixer(['set', '-c', device, mixer, val + '%'], function (err) { // cb(err); // }); // if (devicename == 'PianoDACPlus' || devicename == 'Allo Piano 2.1') { // amixer(['set', '-c', device, 'Subwoofer Digital', val + '%'], function (err) { // cb(err); // }); // } // } mpc(['volume', val], function (err) { cb(err); }); };
Then add the ‘mixer_type’ line to /etc/mpd.conf below the audio_output section so it looks like this:

# Audio Output ################################################################ audio_output { ... ... } mixer_type "software"

Thx, I’ll give it a try later today

Hi,

I’ve got volume problems too.

I’m running Volumio 2, with a raspberry pi zero and phat dac. It plays music and so on, but I cannot control the volume. Do any of you have any advise?

Have you or sombody a solution for the problem? for v2.201