Skip to content

Commit

Permalink
Enforce minimum bufferDuration of 50ms (#674)
Browse files Browse the repository at this point in the history
* Enforce minimum of 50ms due to unexpected behaviour

* Allow exactly 50ms.

* Minimum should be divisible by 20 due to 20ms packet times.

* Lower to 40ms, mention possibility of stuttering

* 'more' is redundant, under ideal conditions there are no pauses.
  • Loading branch information
devoxin authored Jun 24, 2022
1 parent 8b8b3ea commit 560615f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LavalinkServer/application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lavalink:
vimeo: true
http: true
local: false
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses. Minimum of 40ms, lower values may introduce pauses.
frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class KoeConfiguration(val serverConfig: ServerConfig) {
if (nasSupported) {
log.info("Enabling JDA-NAS")
var bufferSize = serverConfig.bufferDurationMs ?: UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
if (bufferSize <= 0) {
if (bufferSize < 40) {
log.warn("Buffer size of {}ms is illegal. Defaulting to {}",
bufferSize, UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION)
bufferSize = UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
Expand Down

0 comments on commit 560615f

Please sign in to comment.