Extreme Lags with overloaded ABC tunes and the OpenAL audio engine

Bruzo

New member
I am sure you are all experiencing this these days - overloaded ABC tunes cause your client to freeze for seconds when using the OpenAL sound driver, and also the memory footprint of lotro is changing all the time when listening to player music. This indicates that there is a lot of memory allocation/releasing going on.

This might be related to way the OpenAL driver is used by the game - and I think it is related to the reason why we always had a stuttering game when ABC tunes were overloaded.

To go into detail:

In OpenAL a number of "slots" (sound sources) are reserved which are then loaded with samples and fired off when a sound is to be played .. something like this:

std::vector<ALuint> sources(64);
alGenSources((ALuint)64, &sources[0] ); // I know this should be a proper pointer to the data :)

The source has also those 3D positional and volume attributes needed for the playback. Whenever a tone is to be played it is loaded into the soundbuffer of a source and fired off, the rest is handled by the OpenAL driver.

Now the tricky bit comes, the OpenAL driver can be queried if a source is still busy playing or free for something new:

ALint sourcestate;
alGetSourcei(sources[0], AL_SOURCE_STATE, &sourcestate);
if ( sourcestate == AL_PLAYING ) {} // source 0 is still busy ...

If all 64 sources are busy but you want to send something new .. you have 2 options:

1. just let the new tone fall off the wagon and don't bother because the sound system is already full
2. you decide to stop a source that is still busy and send your new sample .. this requires a sequence of commandos ...

Lotro implemented Option 2 ( which can be demonstrated by removing a stuck bagpipe drone by playing an overloaded ABC tune )

Option 1 doesn't cause any issues because instead of doing anything to the audio engine you just let it go, whereas option 2 could mess with things ...

It is my suspicion that this exact issue was always causing the lags for overloaded ABC tunes and that currently this is amplified by something else related to memory allocation.

Maybe one of the Devs could have a look into that?


Cheers,

Bruzo
 
if you can change the audio driver in the settings to generic it make almost no freezing ( tested) and almost no stuttering .. sounds a bit strange but at rehearsals and our last concert it works fine so far for many people... not sure if it works for everyone ..
 

Imladrien

Active member
if you can change the audio driver in the settings to generic it make almost no freezing ( tested) and almost no stuttering .. sounds a bit strange but at rehearsals and our last concert it works fine so far for many people... not sure if it works for everyone ..
Some people can change to generic in 64bit. I am unlucky that I only have that option in 32bit.
Weatherstock is in a few weeks. They really need to fix this.
 

Luventhariel

\m/ >^;^< \m/
I had to switch back to 32bit for Shirefest, which worked, as a temporary fix. Did not have any complete freezes, but was more laggy than normal while playing (music was okay, but animations were stuttering). Immediately switched back the following day so that I could play the game with proper graphics. I'm hoping that they find a more permanent fix.
 

Bruzo

New member
I can only switch to generic on 32-bit as well. Also there is some weird volume interaction of the generic audio driver with the windows sound system. Discord and Lotro running at the same time were affecting each others volumes .. can't tell if it is discord or lotro, but it is really annoying.

I wish they could just fix that sound-stopping issue with the OpenAL driver .. it should not be complicated - and it would get rid of an issue that existed since the beginning of the music system in lotro ...

And while we are on it:

If you could remove the looping playback on the lowest octave of the bagpipes ( the drones ) and just send them like all the other tones?
The ogg-files in the game data for those tones are long enough for that as they are, then we would never again have stuck backpipe drones.

The issue is that those tones are started as a looped sample in OpenAL and then they have to be stopped actively by the game. For some reason that stopping command is not processed/send when the game is lagging at that very moment - and we are left with a tone playing forever ( or until some overload of the sound system knocks that tone out ).


Lol - I wish I could have a look at the source code of that OpenAL-interaction to point out how to fix that, but I am quite certain that could never happen :)
 

Aifel

Well-known member
Discord is classed a communication sound by Windows, so Windows ducking system goes into effect. Plus Discord has its own ducking system also.
That might account for the volume interaction you experience.
You can do 2 things to stop it for good:
1 - In Windows Sounds, Communications tab, select Do nothing.
2 - In Discord settings, Voice & Video, set attenuation slider to 0%.
 

Elamond

Member
It's not just a discord issue, my laptop doesn't auto-launch discord or any other program which interacts with audio and still has this problem. It's not just that sound stutters/freezes, but the game starts dropping frames and freezing overall. See also this thread
 

Pontin_Finnberry

Your Friendly Neighborhood Hobbit
Yeah an update did something with the sound, cause it wasn't like this before a month, now it just freezes for a few seconds when playing music in game.
 

Oghren

Well-known member
@Bruzo : if you want any hope of devs looking into this (and your report is detailed enough to warrant that) you'll need to file a bug. Only some devs read forum posts.
 

MerryBear Roarer

Active member
I finally got rid of all the drop out when playing music. I had to put all the players on non windowed full screen switching with alt tab. The sound turned down on all but the main player. When you switch to other players to sync the next song the sound goes wonky but it is still playing correctly in world and will go back to normal after you get back to the main sound window. But no freezes at all since I started doing this. Also set all but the main window to low graphics, you can set the main window to medium with no issues.
 

bannedfortalkinglore

just wanted to know source material
Two thoughts on this: When lotro runs windowed mode, any window besides the window having focus will be run with lower priority. This is the issue described by MerryBearRoarer. If you turn on FPS counter you will see any non-focus windowed lotro runs with a fraction of FPS of focused window.

The other thought is: has anyone tried configuring OpenAL to performance mode? Default is to use expensive effects in Quality mode. These effects only impact you though. Things like calculating reverb between audio and environment is a waste for producers imho. Other people will hear the audio according to their OpenAL setting.
 
Top