audio skips / stutters through bluetooth

*nix specific usage questions
rebeltaz
New Cone
New Cone
Posts: 9
Joined: 18 Apr 2011 08:41
Operating System: Linux

audio skips / stutters through bluetooth

Postby rebeltaz » 24 Jun 2022 07:42

I don't know of this is a linux issue or a VLC issue, but since nobody on the Ubuntu forums or reddit will answer me, I figured I'd try here.

What I've got going on is I run VLC v3.0.8 under Ubuntu 18.04 LTS. When I watch videos, I speed them up 2x so I can concentrate on them. I've done that for so long that anything slower sounds like it's dragging. Anyway, everything is great until I connect ANY bluetooth sound device - be it headphones, earbuds, a turntable (connected to an amplifier), speakers... anything bluetooth. When I do, the audio begins skipping. If I drop the speed a little - no exact number - it will smooth out and play fine. I can usually ease the speed back up close to 2x and it still plays fine. If I stop the video and start another one (or even the same one) or skip around within that video, I have to go through all of that again to get the audio to smooth back out. Even if I leave the speed alone once it smooths out, I still have to lower it to stop it from skipping if I start/stop/skip videos.

Is there any way that I can fix this?
Derek Tombrello
www.RobotsAndComputers.com

JuanPabloCuervo
Blank Cone
Blank Cone
Posts: 42
Joined: 25 Jun 2010 18:27

Re: audio skips / stutters through bluetooth

Postby JuanPabloCuervo » 24 Jun 2022 18:03

#1. you need to upgrade to 21.10
way faster...
someone found a way to increase efficiency 8000x in one of the kernel modules.

but latest Kernel is a bit strange...
works well up to 5.13.0.34
5.13.0-52-generic is a bit strange...

#2. Bluetooth is Not Bluetooth,
has different versions, the latest is 5.3 and has very advanced Audio features.

https://en.wikipedia.org/wiki/Bluetooth ... d_features

#3. BL has the same 2.4Ghz frequency of Wi-Fi...
but a different encoding...
but signals can overlap, collide, cause interferences...
avoid Wi-Fi + BL

also BL hops/jumps frequency constantly to avoid interferences,
but in a dense busy Wi-Fi area is like jumping in moving sands.
avoid busy Wi-Fi areas.

download a Wi-Fi Analzyer app for Cellphone..
force modem / router to have a fixed frequency band,
Wi-Fi modems also jump.
find the less busy frequency lane.
lower power as low as possible without affecting speedtest.net

#4. Distance,
BL is for close Range.
but 5.3 allows more distance than previous.
BLE is for even closer range.
NFC is even more closer range.

BL frequency cannot be Fixed like Wi-Fi.

#5. BL device must have a stable internal clock to have proper sync with other devices.
low noise powerr supply, proper bypass capacitors.
cheap models cut costs by removing parts or using inferior parts.

#6. Room walls, in a building,
colums are reinforced with steel internally,
Wi-Fi & BL have problems with dense walls.
Reinforced steel work like antenas that capture the signal and drain to ground.
usually those rooms require special / perfect placement to avoid signal loss / dead spots.

#7. VLC has Time Strech Audio options in Advanced.
Spex and other Algorithm quality...
those affect playback.
Higher Quality requires a the fastest single-core CPU.
https://www.cpu-monkey.com/en/cpu_bench ... le_core-15
https://www.cpu-monkey.com/it//cpu_benc ... gle_core-7

VLC also has buffer size, pre load, etc... in miliseconds.
increase to avoid drops,

VLC also has a Analyzer to see how many frames drop.
bit rate.
Ctrl+i

VLC also has jitter correction.

Try to playback from Ram Drive to discard HDD issues.
investigate more.

#8. Complete uninstall / remove VLC,
install again from Snap.

#9. Try other players to see if its a Software or Hardware / Driver issue.

#10. Audio Stutter usually happens with some codecs like h265
when the Audio Playback device Hardware / soundcard / interface has a fixed Sample Rate.
for example: 44.1Khz,
but the Audio file has 48Khz.

that makes a conflict.
PulseAudio may be required to be open at playback to allow the Real Time Sample Rate Converter to work.

reset Pulseaudio, if device is Not detected, with:
$ pulseaudio --kill

but Linux Pulseaudio Sample Rate Converter is only Upwards with Universal USB devices.
HW is 96Khz,
audio can be anything and works OK. 44.1khz, 48k, 88.2khz, 96khz.

but when HW is fixed at 44.1Khz and does Not change when receives an Internal Clock Change to 48khz.
Goes crazy.
driver S.R.C. is Not activated to compensate.

---

i bet the problem is option #10.
your BL USB device does Not have 48KHz.

if thats the problem.... 3 options:

Option A)
Use handbrake, or MKToolNix GUI, or VLC to extract the audio file from the .mp4 .mkv or .mov
convert the audio file from 48khz to 44.1khz,

VLC can play multiple files at same time,
and allows to change sync in miliseconds to properly lip-sync audio & video.
compensate for Sound latency and Video Latency.
In Tools / Track Syncronization.

the 44.1khz file will appear as secondary Audio, Not Default.
In Audio / Audio Track

Option B)
install jackd audio plugin for VLC,
Qjackctl,
select Jack as Audio Output module in VLC Advanced.

Jack its a different audio driver.
.mp4 .mkv .mov .mp3 .ac3 .aac .ogg .flac etc. --> VLC -->jack --> QjackCtl --> jackd2 --> Alsa.

there is a nice jkmeter module for jack, and a jkmixer if want to downmix 5.1 7.1 to Stereo.
but jkmixer needs manual install, Not from Repo.
h t t p s : / / github . com/jack-mixer/jack_mixer/releases/

jack is more advanced,
but Firefox does Not work, unless is recompiled again from source with the option in config to activate jack.

or try OSS driver.
http://www.4front-tech.com/oss.html

Downward SRC side-effects:
http://src.infinitewave.ca/

Option C)
buy a better BL device.

---
Turtle vs. Rabbit race.
https://youtu.be/PWcEgIkKmbE
https://youtu.be/A1GNBB61GmY
https://www.dailymotion.com/video/x7xhsrd
Last edited by JuanPabloCuervo on 24 Jun 2022 19:18, edited 21 times in total.

rebeltaz
New Cone
New Cone
Posts: 9
Joined: 18 Apr 2011 08:41
Operating System: Linux

Re: audio skips / stutters through bluetooth

Postby rebeltaz » 24 Jun 2022 18:22

#3. BL has the same 2.4Ghz frequency of Wi-Fi...
but a different encoding...
but signals can overlap, collide, cause interferences...
avoid Wi-Fi + BL
Quite possibly this! I didn't think of this, but I did have a set of bluetooth speakers once that, anytime I used them, the wifi signal would go crazy, so I knew that bluetooth could interfere with wifi. It didn't dawn on me that the reverse could be the issue - that wifi was interefering with bluetooth!
VLC also has buffer size, pre load, etc... in miliseconds.
increase to avoid drops,

VLC also has a Analyzer to see how many frames drop.
bit rate.

VLC also has jitter correction.
The video doesn't skip. It's just the audio. I've tried adjusting several buffer settings, but nothing I did seemed to help. Any setting in particular I could look at?
I'll take a look at those tonight. Thanks.
Derek Tombrello
www.RobotsAndComputers.com

Rémi Denis-Courmont
Developer
Developer
Posts: 15271
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: audio skips / stutters through bluetooth

Postby Rémi Denis-Courmont » 24 Jun 2022 19:20

There could be many reasons and it is probably a combination of multiple factors (audio device, source audio codec, VLC buffers, etc).

One obvious problem is that BT has higher latency and tighter buffering requirements than wired so you might simply be hitting the bottlenecks "faster".
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

rebeltaz
New Cone
New Cone
Posts: 9
Joined: 18 Apr 2011 08:41
Operating System: Linux

Re: audio skips / stutters through bluetooth

Postby rebeltaz » 27 Jun 2022 07:57

Derek Tombrello
www.RobotsAndComputers.com

JuanPabloCuervo
Blank Cone
Blank Cone
Posts: 42
Joined: 25 Jun 2010 18:27

Re: audio skips / stutters through bluetooth

Postby JuanPabloCuervo » 17 Jul 2022 23:37

found the source of the problem and a permanent sollution, last week... :idea:
:mrgreen:
:D
tested so many things, for so long, i almost go crazy... LOL
the sollution was so simple... i cant believe it.

DrumRoll....
.
.
.
.
.
.
.
.
.
there is a small error in the default pulseaudio configuration file...
its forced to 44.1Khz,
Not Auto, Nor 0, Nor 48Khz...

that small error creates a chain reaction of problems.
a waterfall of problems.

more here:
https://github.com/juanpc2018/-SOLVED-P ... io-problem


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 19 guests