PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.74k stars 321 forks source link

Stuttering audio on RPi 4 #688

Closed CaelThunderwing closed 4 years ago

CaelThunderwing commented 4 years ago

Audio Stutters on RPi4 on Default Samplerate

after manually compiling Pianobar audio playback is stuttering as-if the system cannot handle it. If you open Chromium and load Pandora directly. plays back just fine.

Your environment

Steps to reproduce

loaded after finishing compiling ad making config file.

Expected behaviour

Smooth as buttery silk audio playback

Actual behaviour

audio stutters as if the Raspberry Pi 4 cannot keep up every second (as if its buffering audio every second)

EDIT @10:57PM EST: going thru the sample config in the source, finding about the sample_rate option.. the stutter goes away setting to 48kHz (48,000)

PromyLOPh commented 4 years ago

Hm, weird. What audio output are you using? ALSA, pulseaudio? You can try setting default_driver=pulse in your ~/.libao if you’ve got pulseaudio installed. Afaik libao defaults to ALSA.

CaelThunderwing commented 4 years ago

ALSA (and to HDMI not the analouge out)

‪On Thu, Aug 29, 2019 at 4:53 AM ‫لارس · Lars‬‎ notifications@github.com wrote:‬

Hm, weird. What audio output are you using? ALSA, pulseaudio? You can try setting default_driver=pulse in your ~/.libao if you’ve got pulseaudio installed. Afaik libao defaults to ALSA.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PromyLOPh/pianobar/issues/688?email_source=notifications&email_token=AA452CLVKDUAYOYMKT6BJ53QG6FB7A5CNFSM4IR3B2Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5NYO6Y#issuecomment-526092155, or mute the thread https://github.com/notifications/unsubscribe-auth/AA452CII57CQXDHWRFAEXG3QG6FB7ANCNFSM4IR3B2YQ .

PromyLOPh commented 4 years ago

Best guess right now: Resampling inside pianobar happens before its audio buffer and thus is immune to latency spikes (up to 5 seconds by default). Whatever resampling is happening after pianobar hands off data to libao (which does not resample) should be using larger buffers to compensate for that.

lewisdonofrio commented 4 years ago

I get the same thing, please advise.

lewisdonofrio commented 4 years ago

kael how's you do that I only get " Unrecognized key sampling_rate at /home/pi/.config/pianobar/config:23" when I try sampling_rate=48000 ;(

PromyLOPh commented 4 years ago

sampling_rate != sample_rate

lewisdonofrio commented 4 years ago

facepalm trying now

lewisdonofrio commented 4 years ago

tried and still brokenup way slow "Unrecognized key sample_rate at /home/pi/.config/pianobar/config:24" used "sample_rate=48000" ;(

PromyLOPh commented 4 years ago

Which version are you using? There’s no release with this feature yet, so you have to compile the master branch yourself.

lewisdonofrio commented 4 years ago

standard version in raspbian 2019.02.14

edward-p commented 4 years ago

Use apt search to search packages.

lewisdonofrio commented 4 years ago

is this libgcrypt11-dev older version of libgcrypt20-dev ?

lewisdonofrio commented 4 years ago

k got that but missing:

pi@raspberrypi:~ $ sudo apt-get install libgcrypt20-dev libjson-c-dev libgnutls28-dev libav-tools libao-dev -y Reading package lists... Done Building dependency tree
Reading state information... Done Package libav-tools is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: ffmpeg

E: Package 'libav-tools' has no installation candidate pi@raspberrypi:~ $

lewisdonofrio commented 4 years ago

Still trying to get this to compile, anyone have a newer wiki for rpi3/4's?

*SNIPPED pi@raspberrypi:~ / pianobar $ make Package libavformat was not found in the pkg-config search path. Perhaps you should add the directory containing libavformat.pc' to the PKG_CONFIG_PATH environment variable No package 'libavformat' found Package libavfilter was not found in the pkg-config search path. Perhaps you should add the directory containinglibavfilter.pc' to the PKG_CONFIG_PATH environment variable No package 'libavfilter' found Package libavformat was not found in the pkg-config search path. Perhaps you should add the directory containing libavformat.pc' to the PKG_CONFIG_PATH environment variable No package 'libavformat' found Package libavfilter was not found in the pkg-config search path. Perhaps you should add the directory containinglibavfilter.pc' to the PKG_CONFIG_PATH environment variable No package 'libavfilter' found Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containinglibcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found CC src / main.c In file included from src / main.c:24: src / config.h:14:10: fatal error: libavfilter / version.h: No such file or directory

include <libavfilter / version.h>

      ^~~~~~~~~~~~~~~~~~~~~~~

compilation terminated. make: * [Makefile:108: src / main.o] Error 1 pi@raspberrypi:~ / pianobar $ SNIPPED**

;(

PromyLOPh commented 4 years ago

Sorry, but this is a bug tracker, not a support forum.

lewisdonofrio commented 4 years ago

ok, I'm just trying to compile this goodness..... do I "have" to compile ffmpeg or use OS package if I'm compiling pianobar?

PromyLOPh commented 4 years ago

Either should be fine, but for the latter you usually need to install development files. This depends on the distro though.

lewisdonofrio commented 4 years ago

ok just consider this issue is for rpi's running raspbian that is why we are here....and how to get it to not stutter (or as I call it playing each note so long.....)

lewisdonofrio commented 4 years ago

are you folks on irc.freenode.net?

lewisdonofrio commented 4 years ago

needed libcurl4-gnutls-dev and it sounded great for 30 seconds of playback but now sounds slow again, I'm so confused.....

lewisdonofrio commented 4 years ago

Now its working after i change a station - well see how long it holds out....thank you to all you good folks do...

lewisdonofrio commented 4 years ago

It's playing fine now, still getting these "ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front" but it's at least playing now, have not rebooted just working and enjoying currently.

lewisdonofrio commented 4 years ago

ugh doing it again.....bah

lewisdonofrio commented 4 years ago

and now it's working, do I need to break out gdb ;(

lewisdonofrio commented 4 years ago

very next song stuttering very bad ;( How can I help?

lewisdonofrio commented 4 years ago

so one out of four songs plays fine.....

lewisdonofrio commented 4 years ago

been fine last 12 songs.....just waiting for it to go back to bad sounding....

lewisdonofrio commented 4 years ago

after last four hours nothing changes and next song was messed up I exited, I hope my feedback is good and not unwanted.....

lewisdonofrio commented 4 years ago

so if I run and exit gracefully (q)uit like 20 times it does start working again....

lewisdonofrio commented 4 years ago

ok last post about this am I suppose to be at this version when pulling from git? 2019.02.14-dev?

PromyLOPh commented 4 years ago

Alright, I see you’re frustrated it is not working properly, but this is enough. Right now it does not look like an issue caused by pianobar, so I can’t do anything to fix it. And, as I said before, this is not a generic support forum.

(Yes, 2019.02.14-dev is the current git version.)