Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure on Raspberry Pi B+ #16

Closed
ericpardee opened this issue Aug 4, 2021 · 4 comments
Closed

build failure on Raspberry Pi B+ #16

ericpardee opened this issue Aug 4, 2021 · 4 comments

Comments

@ericpardee
Copy link

Architecture: armv7l

pi@raspBplus-api:~/Development/goplay2 $ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

pi@raspBplus-api:~/Development/goplay2 $ go version
go version go1.16.6 linux/arm

pi@raspBplus-api:~/Development/goplay2 $ ./goplay2 -i eth0 -n pitunes

2021/08/04 23:38:56 pitunes/config.json is not valid - at new file will be created at program exit
2021/08/04 23:38:56 Starting goplay for device Pi: 24e650f4-3d3f-4832-ad39-6a1c3bff81a6, guid: 24e650f4-3d3f-4832-ad39-6a1c3bff81a6, Psi: 24e650f4-3d3f-4832-ad39-6a1c3bff81a6
2021/08/04 23:38:56 dial unix /run/user/1000/pulse/native: connect: no such file or directory
2021/08/04 23:38:56 Warning : impossible to store config file pitunes/config.json
panic: dial unix /run/user/1000/pulse/native: connect: no such file or directory

goroutine 1 [running]:
log.Panic(0x293deb0, 0x1, 0x1)
	/usr/local/go/src/log/log.go:354 +0x84
goplay2/codec.NewStream(0x2f8f00, 0x64)
	/home/pi/Development/goplay2/codec/pulseaudio.go:45 +0x80
goplay2/audio.NewPlayer(0x289a828, 0x28980c0, 0x147ae)
	/home/pi/Development/goplay2/audio/player.go:32 +0x40
main.main()
	/home/pi/Development/goplay2/main.go:71 +0x950

What am I missing?

@AlbanSeurat
Copy link
Member

AlbanSeurat commented Aug 5, 2021

Hello,

The build seems ok as you have the binary.

Goplay connect to pulseaudio to play the music.
This error occurs when pulseaudio is not installed or if you have a specific setup.

You can also try to install it with apt.

Also, Raspian has introduced pulseaudio as default audio system in version 12.

Then, you could try to upgrade your distribution.

Some reference on pulseaudio on raspian:
https://www.raspberrypi.org/blog/new-raspberry-pi-os-release-december-2020/

@ericpardee
Copy link
Author

Hi, thanks for responding.

I do already have pulseaudio installed, sorry, should have included that info.

pi@raspBplus-api:~ $ sudo apt install pulseaudio
Reading package lists... Done
Building dependency tree
Reading state information... Done
pulseaudio is already the newest version (12.2-4+deb10u1+rpi3).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

It's running

pi@raspBplus-api:~/Development/goplay2 $ pulseaudio --check
pi@raspBplus-api:~/Development/goplay2 $ echo $?
1
pi@raspBplus-api:~/Development/goplay2 $ pulseaudio -D
pi@raspBplus-api:~/Development/goplay2 $ pulseaudio --check
pi@raspBplus-api:~/Development/goplay2 $ echo $?
0

Here are the sinks:

2 sink(s) available.
    index: 0
	name: <alsa_output.platform-bcm2835_audio.digital-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9000
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	fixed latency: 59.95 ms
	card: 0 <alsa_card.platform-bcm2835_audio>
	module: 6
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "bcm2835 HDMI 1"
		alsa.id = "bcm2835 HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "bcm2835 HDMI 1"
		alsa.long_card_name = "bcm2835 HDMI 1"
		alsa.driver_name = "snd_bcm2835"
		device.bus_path = "platform-bcm2835_audio"
		sysfs.path = "/devices/platform/soc/3f00b840.mailbox/bcm2835_audio/sound/card0"
		device.form_factor = "internal"
		device.string = "hw:0"
		device.buffering.buffer_size = "10576"
		device.buffering.fragment_size = "2640"
		device.access_mode = "mmap"
		device.profile.name = "digital-stereo"
		device.profile.description = "Digital Stereo"
		device.description = "Built-in Audio Digital Stereo"
		alsa.mixer_name = "Broadcom Mixer"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card"
	ports:
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: unknown)
			properties:
				device.icon_name = "video-display"
	active port: <hdmi-output-0>
  * index: 1
	name: <alsa_output.platform-bcm2835_audio.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9009
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 1
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	fixed latency: 59.95 ms
	card: 1 <alsa_card.platform-bcm2835_audio.2>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "bcm2835 Headphones"
		alsa.id = "bcm2835 Headphones"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "bcm2835 Headphones"
		alsa.long_card_name = "bcm2835 Headphones"
		alsa.driver_name = "snd_bcm2835"
		device.bus_path = "platform-bcm2835_audio"
		sysfs.path = "/devices/platform/soc/3f00b840.mailbox/bcm2835_audio/sound/card1"
		device.form_factor = "internal"
		device.string = "hw:1"
		device.buffering.buffer_size = "10576"
		device.buffering.fragment_size = "2640"
		device.access_mode = "mmap"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Built-in Audio Analog Stereo"
		alsa.mixer_name = "Broadcom Mixer"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card"
	ports:
		analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
			properties:

	active port: <analog-output>

@AlbanSeurat
Copy link
Member

AlbanSeurat commented Aug 6, 2021

Usually the other raison why this happens is because pulseaudio isn’t started for your user (or when running goplay2 as root or with sudo ) but in your report you seems to be running goplay with pi user and pulseaudio seems started.

Are you connected thru ssh or are you trying to run it from a terminal desktop ?

If you can try to run Gooplay2 from a desktop terminal, you should have pulseaudio started.

The error in any case means pulseaudio socket is not found. If you find where he is located on your OS, it might help resolve the issue ( and I can add a parameter to the program).

you can start looking at systemd unit file for pulseaudio (service and/or socket)

@ericpardee
Copy link
Author

Thanks for your message. Yes, this is a raspberry pi headless.

Success!
I was running pulse in daemon mode like pulseaudio -D but instead I needed to run it like pulseaudio --start and add as a systemd service.

Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants