SoundQueues

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by zorg »

raidho36 wrote:Maximum queued buffers right now is defined as 8, that means maximum buffered sound length would be just under 6 milliseconds, and you'll need to run at least as fast as ~170 updates per second just to keep the buffer filled.
The FFI one had a limit of 16 (on my pc, and a few others, anyway), though for what it's worth, i'm fairly certain i saw something like a loop trying to add buffers until it errors or something, somewhere in the codebase... it might have been something else.
raidho36 wrote:You probably haven't paid attention to that but many audio software have buffer length adjustable and it's usually in tens to hundreds of milliseconds long, and those that don't expose such option have a sensible default in thereabouts of same figures.
I know they are adjustable, though people prefer buffer sizes as small as possible... and to be fair, without heavy computational load, the 2.9 ms of buffer filling is still so fast it approaches the fast-end of ASIO latencies.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: "Questions that don't deserve their own thread" thread

Post by raidho36 »

If you want smaller latency you'll just have to run at a faster update rate. If you can make source's update loop run at 1000 fps, you can have buffer length as low as 1 ms. It's probably more than doable using threads but don't quote me on that.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by zorg »

raidho36 wrote:If you want smaller latency you'll just have to run at a faster update rate. If you can make source's update loop run at 1000 fps, you can have buffer length as low as 1 ms. It's probably more than doable using threads but don't quote me on that.
Nix on irc is trying the latter, but my premise was already not using vsync and having an "atomic" update callback that basically ran as fast as it could... everything i said before, i meant it with those rates. :o:
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: "Questions that don't deserve their own thread" thread

Post by raidho36 »

Well yea making main loop run at 1000 fps is one option, but it's probably a smarter idea to use threads: you'll have to put game logic and rendering in there somewhere, while even tiniest hiccup will result in buffer underrun at that buffer length.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: SoundQueues

Post by Nixola »

This is my threaded demo! It uses a fast loop anyway though, since it's meant to be played and I want responsive input.
Github repo
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: SoundQueues

Post by Dr. Peeps »

Nixola wrote:This is my threaded demo! It uses a fast loop anyway though, since it's meant to be played and I want responsive input.
Github repo
This demo doesn't produce any sound for me (0.11). I assume that's what it's meant to do when the keyboard is pressed?
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: SoundQueues

Post by zorg »

Dr. Peeps wrote:
Nixola wrote:This is my threaded demo! It uses a fast loop anyway though, since it's meant to be played and I want responsive input.
Github repo
This demo doesn't produce any sound for me (0.11). I assume that's what it's meant to do when the keyboard is pressed?
I know you wrote 0.11, but just to make sure, 0.11 is not yet released, the latest löve release is 0.10.2, so if you do have 0.11, the only ways you could have it is if you either built it from source yourself, or have checked out one of the nightlies.

Now, even if you do have a nightly, it may be old (or new) enough for that code to not work anymore.

...And lo, and behold, i just tried it out with my 0.11 nightly, which is quite recent, and it's silent here as well. :3

So basically, nixola didn't update his code to a later nightly that changed something he was using.
OR, he started to refactor, pushed, and now it's in a limbo state where it doesn't produce sound, without löve changing anything under the hood, that'd have been relevant.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Dr. Peeps
Citizen
Posts: 57
Joined: Sat May 28, 2016 12:57 am
Location: British Columbia, Canada

Re: SoundQueues

Post by Dr. Peeps »

zorg wrote:
Dr. Peeps wrote:This demo doesn't produce any sound for me (0.11). I assume that's what it's meant to do when the keyboard is pressed?
I know you wrote 0.11, but just to make sure, 0.11 is not yet released, the latest löve release is 0.10.2, so if you do have 0.11, the only ways you could have it is if you either built it from source yourself, or have checked out one of the nightlies.
Yep, I'm using a nightly build from yesterday. I understand the risks involved. :)
zorg wrote:...And lo, and behold, i just tried it out with my 0.11 nightly, which is quite recent, and it's silent here as well. :3
Great! It's not just me then. :crazy: Thanks for checking.

Speaking of nightly builds, I noticed today that the Windows one now says 0.10.2, when yesterday it was 0.11. What's going on there?
User avatar
slime
Solid Snayke
Posts: 3161
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: SoundQueues

Post by slime »

Dr. Peeps wrote:Speaking of nightly builds, I noticed today that the Windows one now says 0.10.2, when yesterday it was 0.11. What's going on there?
LOVE's source repository has two branches: one for the current release cycle (0.10.x right now), and one for the next major version (0.11). The latter will be merged into the former once we're sure we don't plan to have more releases in the current cycle, but for now there are two branches.

The absolute latest build from appveyor might be from either one of those branches depending on whether the most recent commit to the repository was in the 0.10.x branch (named 'default') or the 0.11 branch (named 'minor').

There are branch-specific appveyor URLs so you can just get the latest build from a specific branch though.

default (0.10.x): https://ci.appveyor.com/project/AlexSzp ... /artifacts
minor (0.11): https://ci.appveyor.com/project/AlexSzp ... /artifacts

The URL at https://love2d.org/builds/ points to the default (0.10.x) branch.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: SoundQueues

Post by Nixola »

That was my fault. I kind of pushed in the middle of a small refactor and I did not notice I didn't include another change. It should work now.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests