Help with Speaker Phat clicks and pops

Hi, I am running a virgin installation 2017-04-10-raspbian-jessie.img on a Pi Zero W.

[Full details below, but TL:DR is: why the clicks? and why must I stop pulseaudio?]

I followed the instructions on the Github page, and then installed VLC as per Steps 1 and 2 on the /tutorial/tanya/say-anything-with-a-speaker-phat webpage

I could only get any sounds if I followed the advice in the support topic "Speaker PHAT no sound or light"
that is, to enter “sudo systemctl stop pulseaudio” at the command line.

At all times, at the end of the boot process, the speaker emits a loud click. When I play the bilge tank tune, a rapid double-click sound is emitted before and after the tune.

Questions:

  1. Why should I need to stop pulseaudio, when the GIT Readme says, (under Uninstalling)

“And if you want pulseaudio back (if you’re using Raspbian < Stretch) you can (if it exists):
sudo mv /etc/xdg/autostart/pulseaudio.disabled /etc/xdg/autostart/pulseaudio.desktop”

(Do I need to be running a higher version?)

  1. How do I stop the dratted clicks?

Thanks

Brian

I forgot to say, that the default response for an attempt to play with aplay is
"aplay: main:722: audio open error: Device or resource busy"

I have the same issue with my pHat Beat running Pirate Radio (VLC radio), a loud pop when changing channels etc. Currently running Jessie full. I do believe the pop issue is being worked on, non of the solutions I’ve found here have worked for me though?
I also had to stop pulse audio to do a speaker test on my pHat Beat. But only for that. VLC Radio runs fine without stopping pulse audio manually.

I’m currently imaging a fresh Jessie card to see what the problem might be.

You should try Raspbian Stretch in the interim.

Normally Pulse Audio runs continuously in the background to keep the speaker device open, and avoid the pop. The pop happens when ALSA starts/stops the i2s signal. By running Pulse Audio this only happens once on startup.

If you play directly to the device using aplay, the pops are unavoidable.

If I get a chance, I’ll do up a fresh install using Stretch latter today. I have a few things on the go at the moment.

@gadgetoid I have a couple of questions.
Is there any advantage to, and is it required to run the pHat Beat installer, then the Pirate radio installer?
What happens if you run either of the above on a Pi that doesn’t have a pHat Beat attached? Installation wise?
I ask because my Pirate Radio Pi has to be removed from my custom case to connect a keyboard mouse monitor etc. If I could run the setup on another Zero W, then just swap the SD card over it would make things a lot easier and quicker.

Is there any advantage to, and is it required to run the pHat Beat installer, then the Pirate radio installer?

The Pirate Radio installer runs the pHAT BEAT installer automatically IIRC, so this wouldn’t make any difference.

What happens if you run either of the above on a Pi that doesn’t have a pHat Beat attached? Installation wise?

The Pi doesn’t know if there’s a pHAT BEAT there or not, so it makes no difference.

That’s good news. It makes installs a lot easier for me, I have a spare Zero W. I’ll do my install and just swap the SD card over to my Pirate Radio. My current case doesn’t have room to connect an HDMI cable etc. I’ll post back when I’m done, how it worked out.

Fresh install of Raspbian Jessie, doing nothing but running:

curl get.pimoroni.com/speakerphat

and;

  • Audio out works for me using speaker-test -c 2 -t wav
  • LEDs also work fine

This is with Pulse Audio running.

I can also tell ALSA to explicitly use Pulse with: speaker-test -c 2 -t wav -D pulse and it still works fine.

This has only made me more baffled about the issues people are reporting- because they seem plentiful. I used Jessie Lite, so perhaps the difference lies somewhere there?

Last time I tried to do fresh install I got nada, no sound other than one pop, and no VU meter. That was with full Jessie. I ended up refreshing an image I had made some time before that. That worked OK and it was Jessie Full also. The last thing I do once my setup is finished is set it to boot to command line. I just find full Jessie so much easier to setup, WIFI wise etc. No having to sudo nano and maybe making a typo.

Just imaged my card with the full Stretch. I’m doing the update upgrade as I type this.

Thanks for that. It looks like with the version of Jessie and the GIT software that I’m using, pulseaudio needs disabling to work. Until that problem is fixed, I won’t know if it fixes the pops.

What did you run to set up Speaker pHAT?

What did you run to set up Speaker pHAT?

Everything that I could find - needed a bit of hunting - all explained in the first entry here. The curl, the install of vlc, the failure, stopping pulseaudio etc. Did I miss something?.

On that, regarding your earlier reply:

  1. Is curl get.pimoroni.com/speakerphat definitely the same as
    curl -sS https://get.pimoroni.com/speakerphat | bash ?

if the result is the same, why are there two ways to do it?

  1. Which version of Jessie are you running? (Apart from it being the lite version)

When I do your tests, I get
a) for “speaker-test -c 2 -t wav”

speaker-test 1.0.28

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -16,Device or resource busy

and

b) for speaker-test -c 2 -t wav -D pulse

speaker-test 1.0.28

Playback device is pulse
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Playback open error: -111,Connection refused
"

Do those error messages give a clue?

I’m willing to try Stretch, but it would be nice if the product description could specify which versions are required in order for it to work.

To be fair when you read this:
“Our software does not support Raspbian Wheezy.” it kind of implies that anything above Wheezy, (lite or no), should work.

I get the impression that this device has only been tested on Jessie Lite. Would that be fair? Could someone at Pimoroni try getting it to work with the full version, please?

Thanks,

Brian

Everything above Wheezy should work, and seems to every time I test it (which should be great, but unfortunately you’re not the only one with these issues).

If you run curl get.pimoroni.com/speakerphat then nothing will be installed.

The | bash is crucial, since this is the part that executes the install script. curl just fetches it.

Specifically:

pi@raspberrypi:~/Pimoroni $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie

pi@raspberrypi:~/Pimoroni $ uname -a
Linux raspberrypi 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux

pi@raspberrypi:~/Pimoroni $ pulseaudio --version
pulseaudio 5.0

Output devices:

pi@raspberrypi:~/Pimoroni $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Playback/recording through the PulseAudio sound server
pivumeter
softvol_and_pivumeter
sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dac,
    Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dac,
    Hardware device with all software conversions

At the end of /boot/config.txt:

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on
dtoverlay=i2s-mmap
dtoverlay=hifiberry-dac

Great success here. Just to recap,
I did a fresh install of full Stretch. Set keyboard, local, WIFI etc.
Did the sudo apt-get update upgrade.
Ran the one line installer for VLC radio on the pHat Beat. curl https://get.pimoroni.com/vlcradio | bash
All done on a Pi Zero W with no pHat Beat attached. Set Raspbian to boot to CLI and shut down.
Swapped my card over to my Pi Zero with the pHat Beat on it and booted it up.
Sound was at max volume, but no pops or clicks when changing channels. One happy camper here now. =)
Time to make a new image for backup. ;)

1 Like

One issue that’s plagued me is not being able to find the pip | on my keyboard in Jessie lite. And running the raspi-config brings up the old interface. Finding the correct keyboard layout from that interface is a PITA, if your using a US keyboard. I tried several and eventually gave up and went to the full Raspbian. .

My enthusiasm with my new install was short lived. Sound quality is terrible. Its scratchy, noisy, distorted or something?. One station was just terrible to listen too. Swapped my other card back in with my old install and its back to being good quality again. Noticed the VU meter acts weird on boot up too. Just one side lights up instead of the normal both sides fully lit for an instant. Plus, its not playing on boot up? More often than not I have to change stations to get it to start playing?

I’m probably going to have one more go, but this time I’ll do it all on the PI with the pHat Beat attached. Won’t be tonight though. Sometime tomorrow.

Hi Gadgetoid,

  1. I only mentioned the curl thing because your example above did not include the “| bash” and I was confused.

  2. Can you confirm that you or someone has successfully used the speaker phat with a full version of Jessie before Stretch, and if so, which?

My feeling is that a virgin installation from a hitherto unused img file burned onto an sdcard following the instructions to the letter should work without disabling pulseaudio, unless there is a minimum version/date of Jessie required. I really do not want to use Jessie Lite.

Thanks

Brian

PS, is Phat Speaker identical “under the hood” to Phat Beat? If not, shouldn’t we have two separate discussion threads to avoid confusion?

Brian
AS far as I understand SpeakerpHat use one MAX98357 amplifier and pHatBeat use two amplifiers. Hence pHatBeat is suitable for stereo reception. speakerphat doesn’t have provision for button control.
I am running three RPiZeroW all three using the same Stretch Full version and pHatBeat sw to receive different kind of internet radio streams.
To use SpeakerpHat my RPiZeroW is using a header expander to get access to buttons control, volume control and station selection. and furthermore you need to edit the asound.conf file to redirect pivumeter to speakerphat according to advice from @gadgetoid .