pHat Speacker - Volume control & Cracks at sound start


#1

Hi !
I have my pHat Speaker now working for some days and Overall I´m happy with that product. But there are two things which are annoying:

  1. There is no volume Control over alsamixer
  2. There are really nasty cracks and plops when the Sound starts

So I would love to see a Little documentation how to get rid of these Problems. For the first one I have no ides what to do. The device is shown in the alsamixer, but the volume still stays at the same Level.
For the second problem I tried to install pulseaudio. If you use it not as a Service it works. The cracks and plops are gone. But if you use it as a Service the cracks come back - I have no idea why.

So guys put together a short description who to handle and eleminate these issues, please. It´s a great product but at the moment it´s only half the fun using it …

Thx for your Support!

regards
Dominik


#2

Agreed. I spent a large amount of time looking into the crack-n-pop problem and it’s a tricky one. When you run pulseaudio directly, it will keep the audio device open permanently and proxy any audio- filling what would be gaps between that audio with silence. Because it only has to open the audio device once, there are none of the cracks/pops caused by opening/closing.

I believe the problem you’re running into is that when you run pulseaudio as a service, however, it shuts off after a short period of inactivity. You can change this in the /etc/pulse/daemon.conf config file IIRC and set exit-idle-time to -1 to disable idle timeout.

The problem I had with Pulse is that it introduced quite a lot of extra load on the Pi Zero- I was experimenting with settings in both VLC and Pulse to try and find the combination of settings that would stress the Zero least.

There should be volume control via alsamixer, though, we have a asound.conf that uses software volume control to achieve this. How did you set up Speaker pHAT?


#3

Hi !
I have the exit… part in my conf file:
exit-idle-time = -1
And I have it in my service config file:

[Unit]
Description=PulseAudio Daemon
After=multi-user.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disable-shm --exit-idle-time=-1
Restart=on-abort

But it didn´t work. I still hear there clracks n plops …
My asound.conf is the following:
pcm.!default {
type plug
slave.pcm “softvol”
}

ctl.!default {
        type hw
        card 0
}

pcm.dmixer {
        type dmix
        ipc_key 1024
        ipc_perm 0666
        slave.pcm 'hw:0,0'
        slave {
                period_time 0
                period_size 1024
                buffer_size 8192
        }
        bindings {
                0 0
                1 1
        }
}

ctl.dmixer {
        type hw
        card 0
}

pcm.softvol {
        type softvol
        slave.pcm "dmixer"
        control {
                name "PCM"
                card 0
        }
}

But this didn´t work, too …

regards Dominik


#4

Hi gadgetoid,
can you give me some additional advise on this topic?
Because for me it´s not working with the above config.

regards
Dominik


#5

Are you sure whatever you’re using to play audio is using pulseaudio and not ALSA directly? It might help to run pulseaudio directly in another terminal/screen session and see what it outputs when you start playing/advance songs.


#6

hi there

i have a similar problem. the speakerPhat all works fine, but ive no idea how to control the volume. is there any way to turn it up/down?

any help appreciated