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

Guides to let you easily discover and enjoy Volumio

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

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

Postby MZP » Thu Jul 07 2016 20:17

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
I nice Dac for Zero, but a little difficult and tedious to put Volumio on it.
I have done all the steps of this forum:
https://volumio.org/forum/volumio-rpi-zero-t3797.html
And after about six hours of work in Raspi A+ (update, upgrade ,dist-upgrade,...,install binutils and rpi-update), and put this SD on the Zero (with phat Dac), it boots perfectly.
Now in Zero, i did the installation:
http://learn.pimoroni.com/tutorial/phat ... ac-install
And Zero runs volumio 1.55 with Jessie.
I have let a copy of this image sd in my drive:
https://drive.google.com/open?id=0BxkNJU-R-TAlM2JrZlRGa2ZRZzA

You need only to put this image on a SD (2Gigas minimun) with dd command,boot Zero with this SD, setup a wifi Access Point with ssidname "volumio" and no password, for example with the your mobile, then go to with the mobile navigator (ie Opera) to 192.43.2.44:80 (change the IP for your raspi IP), and you have Volumio local web is on your navigator.
Now you can change the network config Volumio, to your home wifi, and finish.



root@volumio:~# sudo nano /etc/mpd.conf
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
db_file "/var/lib/mpd/tag_cache"
sticker_file "/var/lib/mpd/sticker.sql"
log_file "/var/log/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
state_file "/var/lib/mpd/state"
user "mpd"
bind_to_address "any"
port "6600"
zeroconf_enabled "yes"
zeroconf_name "volumio"
samplerate_converter "Fastest Sinc Interpolator"
volume_normalization "no"
audio_buffer_size "2048"
buffer_before_play "20%"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
gapless_mp3_playback "yes"
auto_update "no"
group "audio"
max_connections "20"

decoder {
plugin "ffmpeg"
enabled "yes"
}

input {
plugin "curl"
}
audio_output {

type "alsa"
name "Output"
# device "hw:0,0"
device "softvol"
mixer_control "Master"
# mixer_control "MPC"
# mixer_device "hw:0"
# mixer_index "0"
dop "no"

}


sudo nano /boot/config.txt
gpu_mem=16
hdmi_drive=2
dtoverlay=hifiberry-dac




root@volumio:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0



nano /etc/asound.conf

#pcm.!default {
# type hw card 0
#}
#ctl.!default {
# type hw card 0
#}
pcm.!default {
type plug
slave.pcm "softvol"
}

pcm.softvol {
type softvol
slave {
pcm "plughw:0"
}
control {
name "Master"
card 0
}
}
ctl.!default {
type hw
card 0
}


Image
Attachments
alsamixer.jpg
alsamixer.jpg (61.24 KiB) Viewed 6905 times
User avatar
MZP
Fresh off the boat
Fresh off the boat
 
Posts: 4
Joined: Thu Jul 07 2016 19:50

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


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

Postby steveb1475 » Wed Aug 03 2016 03:09

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
Random avatar
steveb1475
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Tue Aug 02 2016 03:32


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

Postby shaDNfro » Fri Jan 06 2017 08:47

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
Random avatar
shaDNfro
Serious Listener
Serious Listener
 
Posts: 60
Joined: Tue Oct 25 2016 15:14


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

Postby roX0r » Fri Jan 13 2017 07:41

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: Select all
        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());
                });

        };

Then also change the self.setVolume { ... }; block to use mpc instead of amixer by changing to this:
Code: Select all
        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:
Code: Select all
# Audio Output ################################################################
audio_output {
...
...
}
mixer_type      "software"
Random avatar
roX0r
Fresh off the boat
Fresh off the boat
 
Posts: 1
Joined: Fri Jan 13 2017 07:21


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

Postby shaDNfro » Mon Jan 16 2017 11:38

Thx, I'll give it a try later today
Random avatar
shaDNfro
Serious Listener
Serious Listener
 
Posts: 60
Joined: Tue Oct 25 2016 15:14


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

Postby DarkovicDK » Mon Jan 16 2017 12:05

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?
Random avatar
DarkovicDK
Fresh off the boat
Fresh off the boat
 
Posts: 2
Joined: Mon Jan 16 2017 12:02


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

Postby zomtec » Wed Jul 05 2017 17:11

DarkovicDK wrote: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
User avatar
zomtec
Fresh off the boat
Fresh off the boat
 
Posts: 3
Joined: Wed Jul 05 2017 17:04


Return to Guides

Who is online

Users browsing this forum: No registered users and 1 guest