Speaker pHat running under phatbeat software. How to get pivumeter alive?


#1

Hi,

I have tested Speakerphat with phatbeat software ( Stretch Lite version ) to listen to my internet radio streams. I connected FF REW PAUSE VOL+ VOL- buttons directly to GPIO-pins and it works. The only drawback the PivuMeter is dark. How can I get pivumeter alive? Is there a simple modification for this ?

Thanks
calleblyh


#2

You need to edit /etc/asound.conf and replace phat-beat with speaker-phat.


#3

This worked as expected based on Stretch Lite 2017-09-07, I got the pivumeter alive. Yesterday I tried the same but using Stretch Lite 2017-10-29. Audio comes out from loadspeaker, pushbuttons wired to gpio-pins works but pivumeter is dark athou change made to /etc/asound.conf according to above instruction. So to summerize: StretchLite october-29, OneLineInstaller vlcradio and RPiZeroW + Speakerphat and pushbuttons wired to gpio-pins. I have looked at client.conf settings and they seem to be ok, but still pivumeter is dark. What else to check ?


#4

Have flashed a fresh Stretch Lite 2017-11-29 SD card. I’ll see what happens!

Edit: Up and running after what seemed like forever and a day of installing. The VU meter is working out of the box.

It’s possible you could have missed my change last week to the install script, but unlikely.

Could you post the contents of:

/etc/asound.conf
/etc/pulse/default.pa
/etc/pulse/client.conf

And:

sudo systemctl status pulseaudio

The latest default.pa should have a section in it that looks like this:

### Try to load pivumeter if it exists
.nofail
load-module module-alsa-sink device=pivumeter
.fail

#5

Here my asound.conf and client.conf. default.pa contains the .nofail —.fail

my_asound.conf

pcm.!default {
type plug
slave.pcm “softvol_and_pivumeter”
}

ctl.!default {
type hw
card 0
}

pcm.pivumeter {
type meter
slave.pcm "hw:0,0"
scopes.0 pivumeter
}

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

pcm_scope.pivumeter {
type pivumeter
decay_ms 500
peak_ms 400
brightness 128
output_device speaker-phat
}

pcm_scope_type.pivumeter {
lib /usr/local/lib/libpivumeter.so
}

pcm.dsp0 pivumeter

my client.conf

This file is part of PulseAudio.

PulseAudio is free software; you can redistribute it and/or modify

it under the terms of the GNU Lesser General Public License as published by

the Free Software Foundation; either version 2 of the License, or

(at your option) any later version.

PulseAudio is distributed in the hope that it will be useful, but

WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

General Public License for more details.

You should have received a copy of the GNU Lesser General Public License

along with PulseAudio; if not, see http://www.gnu.org/licenses/.

Configuration file for PulseAudio clients. See pulse-client.conf(5) for

more information. Default values are commented out. Use either ; or # for

commenting.

; default-sink =
; default-source =
; default-server =
; default-dbus-server =

; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no
autospawn = no
default-server = unix:/tmp/pulseaudio.socket



#6

Whoops, hopefully you get it …


#7

and finally systemctl status

pi@SD30:~ $ sudo systemctl status pulseaudio
â—Ź pulseaudio.service - PulseAudio Daemon
Loaded: loaded (/etc/systemd/system/pulseaudio.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2017-12-12 13:40:45 UTC; 3min 37s ago
Process: 681 ExecStop=/usr/bin/pulseaudio --kill (code=exited, status=1/FAILURE)
Main PID: 684 (pulseaudio)
CGroup: /system.slice/pulseaudio.service
└─684 /usr/bin/pulseaudio --realtime --disallow-exit --no-cpu-limit --log-target=syslog

Dec 12 13:40:45 SD30 systemd[1]: Started PulseAudio Daemon.
Dec 12 13:40:45 SD30 pulseaudio[684]: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is
Dec 12 13:40:45 SD30 pulseaudio[684]: Using device: speaker-phat
Dec 12 13:40:45 SD30 pulseaudio[684]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSup
Dec 12 13:40:45 SD30 pulseaudio[684]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: U
lines 1-13/13 (END)


#8

I can’t see anything amiss.

Try a simple sound file:

wget http://www.kozco.com/tech/LRMonoPhase4.wav
aplay LRMonoPhase4.wav

#9

Played the file… No VU-meter…


#10

In the meanwhile, I will do a fresh LiteStretch 2017-11-29 download/install and a new Pirateradio OLI installation. I think thats what you did ? Or what do you mean by “It’s possible you could have missed my change last week to the install script, but unlikely.”


#11

That’s what I did. Yes. It looks like nothing was missed, however, your configuration seems as expected.

Could you possibly post a picture of your soldering on the Pi Zero and pHAT BEAT side? This might not necessarily be a software problem. It could be a dry joint or similar.


#12

hi, and thanks for your support.
I hope you mean picture of speakerphat pin soldering. I will do the pictures tomorrow. But honestly I doubt bad soldering, because earlier installation was working with speakerphat Also using another microSD card with speakerphat installation works properly running test.py using the same PIZW. I also did remember to change asound.conf output_device to speaker-phat instead of phat-beat. Very confusing situation indeed…


#13

This is the situation from this morning:

  • Using the same hardware RPiZeroW, phatbeat, speakerphat in all tests.

  • Fresh RaspBian Lite 2017-11-29 installed on 2 microSD-cards. Localisation for Finnish keyboard done on both cards

  • vlcradio installed on one of the SD-card , VU-meter works with RPiZW-phatbeat running tests and internet radio

  • Speakerphat installed on the other SD-card, VU-meter works with same RPiZW-speakerphat running speaker-test wav files

  • Using SD-card with vlcradio, RPiZW-speakerphat, audio is ok on loudspeaker, pushbuttons wired tp gpio-pins works, asound.conf modified for output_device speaker-phat , BUT NO VU-meter. @gadgetiod What did you do ???
    Conclusion: Based on these tests I feel convinced it is not a bad-soldering problem. However I feel there is something in /etc/ asound.conf or /etc/pulse/default.pa or /etc/pulse/client.conf I do miss…but cannot find it


#14

Ooooooh, I wonder if it’s because i2c has not been enabled.

Do you see anything if you ls /dev/i2c*

Try running raspi-config and enabling the i2c interface.


#15

Thnx, You found it. No further questions…


#16

It was your bulleted list that made it click- “steps to reproduce” made me realise you hadn’t run the Speaker pHAT installer which enables i2c automatically. D’oh! Glad you’re up and running!