Comments (8)
Delay issue... yeap, definitely sounds like bluealsa :D
The big number you've seen in the PCM plugin (if you're talking about this line) is to counteract delay, not to cause it. There is a lot of "components" which contribute to the final audio delay. However, not all of them are taken into account right now. So, the audio might be out of sync sometimes. However, this delay should not be bigger than 1 second or so. If you are experiencing bigger delay it is caused by a bug in a synchronization logic within bluealsa server and I'm aware of that.... Unfortunately, right now I don't know how to fix it. To be more specific, the problem is with ALSA software PCM API or my understanding how it works (which is more likely). I need a "signal" which will indicate, that the audio will start and then it will be delivered without any delay, until another signal arrives - audio stop. Right now I'm using pcm_io_start callback as a start signal, however, audio is (or it seems it is) delayed afterwards....
device doesn't get exposed in any of the usual ALSA Apis like /proc/asound/cards
Bluealsa ALSA interface is based on a software plugin, which is a part of asound library. The /proc/asound directory is a part of kernel ALSA module.
from bluez-alsa.
I also have a Huge delay bug right now, more something like 25 seconds.
If I open bluealsa device via my app in c++ (alsa-lib) and set every normal values I would set for regular playback, I get this huge delay.
aplay -D seem to work fine and has only small delay.
Any idea ?
from bluez-alsa.
25 secs is kinda odd... How does your PCM configuration look like (what I mean is HW params and SW params)? The delay should be no more than 0.5s (in most cases).
from bluez-alsa.
from bluez-alsa.
Ok the missing part was a snd_pcm_hw_params_set_buffer_size_near.
For some reason the sound card was only requiring snd_pcm_hw_params_set_period_size_near to work, no snd_pcm_hw_params_set_buffer_size_near was needed.
from bluez-alsa.
Hello, I am experiencing the 500-1000ms delay here, I guess it is normal but we need to lower it to something like 250ms.
In my app I am always sending audio so I may not need to support multiple start/stop it this can help.
You have a suggestion where I should start to look in the code ?
from bluez-alsa.
@dagf2101, it should be possible, however it depends on your usage case.
First of all make sure that your app uses small PCM buffer (or start threshold is small). You might also reduce BT socket buffer. E.g. add something like this:
size_t size = 2 * t->mtu_write;
setsockopt(t->bt_fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size))
I've been testing something similar, however the outcome is not "stable", so this change is not in the master yet.
from bluez-alsa.
A LOT of has changed in bluez-alsa project since 2017. It seems that the issue is not as severe as it was. I'm closing this issue then. For a reference please see these comments: #454 (comment) #454 (comment)
If somehow this problem still occurs please create a new issue.
from bluez-alsa.
Related Issues (20)
- bluealsa.service: Start request repeated too quickly. HOT 15
- build on raspberry pi 4 (Raspbian bullseye) HOT 2
- Broken mSBC on USB devices using Alt-3 (Realtek) and Alt-6 (Intel) HOT 1
- airpods3 failed to connect back HOT 3
- Fail to use google home mini as bluetooth speaker HOT 5
- Illegal Instruction on PiZero HOT 9
- No such device (Bluetooth, IPhone) HOT 2
- Couldn't acquire D-Bus name. HOT 12
- connected airpods pro2, the music is played without sound HOT 5
- [RTL8822CE] SCO with msbc codec enabled requires source code patching to deliver audio to headset HOT 4
- ofono not working anymore HOT 11
- API doc out of date HOT 1
- changing a2dp codec broken HOT 4
- Build error undefined references HOT 3
- Cannot decode mSBC with Realtek USB adapter HOT 1
- LDAC problem after update from 4.0 to 4.1.1 HOT 8
- v4.1.1 fails to build on on Debian buster i386 HOT 8
- No sound from Onkyo receiver HOT 90
- Potential server lockup in PCM drain HOT 2
- Sink producing no audio with aptX codec HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluez-alsa.