knute
Posts: 770
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Pulseaudio and VLC?

Sat Dec 05, 2020 8:09 pm

When vlc starts now it skips audio in the first few seconds of playing. The only thing new is the updates to use pulseaudio. This only happens when I use vlc, if I play sounds with Java it never skips. Any body know how to fix it?

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Sat Dec 05, 2020 11:44 pm

i have observed the exact same issue. audio play back of audio files in the playlist of each entry, VLC player interrupts two or more times in the beginning of each...

it happens to my for all my audio files...

i create an synthetic audio file in audacity with two tones (1000Hz left and 1200Hz right at a level of 0.8) but it did not show up the issue.
but by reducing the level of the tones in the audio file content,
it clearly show up!

here the test tone files.
test-tone-1000Hz-and-1200Hz.zip
(235.45 KiB) Downloaded 35 times
test-tone-1000Hz-and-1200Hz-at-80percent.mp3 (plays back without issues)
test-tone-1000Hz-and-1200Hz-attenuated.mp3 (shows clearly the interruptions in the first few seconds)

EDIT: strange now both files shows that issue... i could swear the first file was playing without issues at the first try... but now both have that issue.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Sun Dec 06, 2020 12:08 am

playing back a tone in audacity at high level and high gain, it sounds that there is some "compression" going on.
(? don't know if "compression" is the right term).
but audacity does not show up the issue with interruptions like VLC media player does!
it simply starts to slightly level down the loudness after the first fraction of the second... is that slightly autoleveling a part of PulseAudio?
on my HDMI TV i have all audio and video features disabled... so it should not be my TV.


EDIT: tried an non-upgraded RPi, and it shows that as well... so this specific behavior is not from the upgrade.
Last edited by beta-tester on Sun Dec 06, 2020 9:53 am, edited 1 time in total.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

knute
Posts: 770
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Pulseaudio and VLC?

Sun Dec 06, 2020 2:18 am

I tried your tone file and it skips in the first couple of seconds of playback. I have noticed that once in a while it doesn't do that but no repeatable and only very rarely.

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Sun Dec 06, 2020 8:11 am

the strange thing is on my RPi, it only happens, when i stop play back and start from beginning.
it also happens when VLC starts a new file of the play list.
but it not happens, when i pause play back and continue play back, or when i just jump into a random position inside the file.
it also not happens at mute and un-mute the audio in VLC.

maybe VLC completely closes and opens an audio stream (or deletes and creates a new one) when it starts a new file but keeps the audio stream open while pause/continue or seeking position and only mute the data streaming to the audio device (PulseAudio).

how i tested:
i opened VLC media player and drag'n'dropped thoses both test-tone files to its play list.
to do not need to fill up the play list with more files, i enabled the "loop all" or "loop one" option
(on the bottom right toggle button group, the middle buttom of the group)
and played the list back by clicking play button [>]. there it happend at least 2 times in the very first seconds,
sometimes 3 times and very very rarely 4 times. where the 4'th time is more an distortion than an interruption.
it also happens when jumping to the next or previous audio file [>>|] or [|<<] button.
but not, when clicking the pause [||] and continue [>] button.
and not when mute and un-mute the audio in VLC.

EDIT: it also shows the interruption issue in VLC media player, when you switch the mode from stereo to left or right channel in the VLC Audio | Stereo Mode menu.

BTW, if you have firefox-esr installed, please ,can you try to play this video from YouTube...
https://www.youtube.com/watch?v=4Wrc4fHSCpw
there are very few videos that plays without sound, but only in firefox-esr. this became an issue after the upgrade with PulseAudio.
maybe this issue is kind of related.
Last edited by beta-tester on Sun Dec 06, 2020 12:23 pm, edited 1 time in total.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

renice123
Posts: 355
Joined: Tue Oct 15, 2019 3:56 pm

Re: Pulseaudio and VLC?

Sun Dec 06, 2020 11:05 am

As far as I know, pulseaudio does not work correctly in RPI. At least that was the case a year ago and the development engineer told me that. Has the situation changed now and the program works? Or are you just installing pulse against the recommendations of the developers? You can tell me the details, this is extremely interesting news. Thank you.

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: Pulseaudio and VLC?

Sun Dec 06, 2020 11:19 am

renice123 wrote:
Sun Dec 06, 2020 11:05 am
As far as I know, pulseaudio does not work correctly in RPI. At least that was the case a year ago and the development engineer told me that. Has the situation changed now and the program works? Or are you just installing pulse against the recommendations of the developers? You can tell me the details, this is extremely interesting news. Thank you.

As of the 04-12-2020 release of Raspberry Pi ARMHF Operating System PulseAudio Software is now used to control all aspects of Audio, though it sits as a layer above ALSA*, previously only the Bluetooth Audio was separated by using BlueAlsa which conflicted with PulseAudio:

https://www.raspberrypi.org/blog/new-ra ... ember-2020


*there were some changes to ALSA in the May 2020 Release
Take what I advise as advice not the utopian holy grail, and it is gratis !!

knute
Posts: 770
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Pulseaudio and VLC?

Sun Dec 06, 2020 10:10 pm

beta-tester wrote:
Sun Dec 06, 2020 8:11 am
BTW, if you have firefox-esr installed, please ,can you try to play this video from YouTube...
https://www.youtube.com/watch?v=4Wrc4fHSCpw
there are very few videos that plays without sound, but only in firefox-esr. this became an issue after the upgrade with PulseAudio.
maybe this issue is kind of related.
I installed firefox-esr and I don't get any audio on that link. I tried a few other sites and found that some didn't have any sound, some had sound on parts or ads but not on the video. There is something screwy here.

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Mon Dec 07, 2020 6:48 am

knute wrote:
Sun Dec 06, 2020 10:10 pm
I installed firefox-esr and I don't get any audio on that link. I tried a few other sites and found that some didn't have any sound, some had sound on parts or ads but not on the video. There is something screwy here.
so, its not only me... thank you for your feedback. i will open an other thread for that.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

knute
Posts: 770
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Pulseaudio and VLC?

Mon Dec 07, 2020 3:51 pm

There was an update this morning with some pulseaudio libraries. After the update I got no sound at all until I discovered that the update had changed the selection to AV Jack instead of HDMI. VLC still has the stutter when it starts playing though.

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Mon Dec 07, 2020 4:19 pm

knute wrote:
Mon Dec 07, 2020 3:51 pm
There was an update this morning with some pulseaudio libraries. After the update I got no sound at all until I discovered that the update had changed the selection to AV Jack instead of HDMI. VLC still has the stutter when it starts playing though.
thank you
yes, i had the same today. switching back to HDMI did not fix the issue with the stutter and not the issue with firefox-esr...
maybe they publish updates step by step.
1'st step was the fix of the mono/stereo profile...
hopefully next step is to fix the stuttering... who knows.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

emma1997
Posts: 1677
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Pulseaudio and VLC?

Mon Dec 07, 2020 6:07 pm

VLC always did that on my setups with both movies and music. Flash-flash for several seconds and then starting late with beginning missing. Not impossible for movies what with the production company credits etc but makes it virtually unusable for songs. Being a music lover it's why I stick with PC, MP3 keyfob, or STB for them.

As a cinema fan it's a major annoyance on Pi but nowhere near as bad for me as the resume defects (no titles on DVD). Not enough for me to switch from the Pi but almost.

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Tue Dec 29, 2020 3:59 am

got audiobooks for xmas.
because of the bug, in RaspiOS, listening to audiobooks in VLC is a tortur if words/action goes lost at switching to the next chapter (audio file).
this is very annoying.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Tue Dec 29, 2020 6:57 pm

thanks to Simon, he found a parameter to tweak for fixing this issue.
see https://github.com/RPi-Distro/repo/issu ... -752043964
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

knute
Posts: 770
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Pulseaudio and VLC?

Wed Dec 30, 2020 2:30 am

Works like a charm for me, thanks for finding that! That video still doesn't have any audio on Firefox_esr but does on Chromium.

User avatar
HawaiianPi
Posts: 6828
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Pulseaudio and VLC?

Wed Dec 30, 2020 3:44 am

Interesting that I don't experience this when using my Bluetooth speakers (only on analog 3.5mm jack). It does seem to be a problem with VLC however, because Audacious works fine as a music player when using 3.5mm analog jack or Bluetooth. I'll have to take a look at that link to see what's going on.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

beta-tester
Posts: 1503
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Pulseaudio and VLC?

Thu Dec 31, 2020 8:16 pm

knute wrote:
Wed Dec 30, 2020 2:30 am
That video still doesn't have any audio on Firefox_esr but does on Chromium.
the parameter does fix only the issue in VLC...
for that video issue i opened a separate issue report:
https://github.com/RPi-Distro/repo/issues/218
https://bugzilla.mozilla.org/show_bug.cgi?id=1682779
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

knute
Posts: 770
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: Pulseaudio and VLC?

Thu Dec 31, 2020 11:37 pm

It's really nice not to have the audio skipping on start. Thanks again for that!

Return to “Troubleshooting”