Lmms: Audio drops out intermittently

Created on 26 Jan 2014  Â·  33Comments  Â·  Source: LMMS/lmms

I get glitchy audio sound about half of the times I open LMMS. Usually it goes away and everything sounds normal again after tinkering around for 60 seconds or so. I am not yet able to reliably duplicate the problem or make it stop when it occurs.

bug core

Most helpful comment

Old but I may still have this issue on 1.2.0. The sound is incredibly distorted and glitchy (lots of high freq. noise, almost like you took a reverb on master and bitcrushed it), but it always goes away if I adjust the audio volume on my system (arch linux, kde + pulseaudio, sdl as LMMS backend)

All 33 comments

I am using ALSA output in LMMS, and using PulseAudio for my system.

It seems that if you have another program that using audio output, the chance of getting glitchy sound is high.

Work around:

  • Closing the program that using audio output
  • Play some notes while changing the system volume.
  • The sound will no longer be glitchy

Interesting find. I am also using ALSA output with PulseAudio for my system. I'll have to experiment around with this, thanks for the tip.

it seems in general that pulseaudio is glitchy with most programs. i find if i kill pulseaudio and stop it from respawning LMMS will work fine. the way to do this as a user and not system wide is create a file ~/.pulse/client.conf with contents autospawn = no and killall pulseaudio in the terminal.

@mikobuntu Besides LMMS, I did notice that some programs renders glitchy sounds. However, some program render sounds very well with pulse audio.

I suspect this issue is the problem of ALSA compatibility layer for pulse audio. I am not sure tho.

Surprising finding! It seems that this bug is eliminated with the following setting:
In Edit->Audio Setting->Audio Interface , set the combobox to Pulse Audio (bad latency!)

I wonder why it said bad latency. There is no any observable latency for me. Maybe the text bad latency is outdated.

Again, I guess that it could be a bug of ALSA compatibility layer for pulse audio.
Possibly solution: set Pulse Audio as the default audio interface?

When you select ALSA in the settings, you have to edit the "device" textbox to point directly to your sound device (it is "hw:0,0" for me but may vary between systems and soundcards). There's instructions in the old wiki on how to find out your soundcard designation. Otherwise, PA will intercept the ALSA output (this is the compatibility layer in PA), and even though you select ALSA it will be output via PA.

Unless you do this trick, there isn't likely to be much of a difference between choosing PA or ALSA output. The only downside is, that this hogs the soundcard entirely for LMMS, and no other software can output audio. Note - if you use this method, don't try to view youtube videos while LMMS is open! It will hang your browser.

Unless you do this trick, there isn't likely to be much of a difference between choosing PA or ALSA output.
@diizy Somewhat doubtful. By setting the output to PA, the issue is gone here.

On 01/30/2014 11:09 AM, wongcc966422 wrote:

Unless you do this trick, there isn't likely to be much of a
difference between choosing PA or ALSA output.
@diizy <https://github.com/diizy> Somewhat doubtful. By setting
the output to PA, the issue is gone here.

—
Reply to this email directly or view it on GitHub
https://github.com/LMMS/lmms/issues/158#issuecomment-33670760.

How's the latency? For me PA is unusable, it gives a noticeable delay
when you try to play anything...

Wouldnt that be easily fixed by increasing or decreasing buffer size?

On Thursday 30 January 2014 01:42:49 Vesa V wrote:

On 01/30/2014 11:09 AM, wongcc966422 wrote:

Unless you do this trick, there isn't likely to be much of a
difference between choosing PA or ALSA output.
@diizy <https://github.com/diizy> Somewhat doubtful. By setting
the output to PA, the issue is gone here.

—
Reply to this email directly or view it on GitHub
https://github.com/LMMS/lmms/issues/158#issuecomment-33670760.

How's the latency? For me PA is unusable, it gives a noticeable delay
when you try to play anything...


Reply to this email directly or view it on GitHub:
https://github.com/LMMS/lmms/issues/158#issuecomment-33672929

On 01/30/2014 11:54 AM, eagles051387 wrote:

Wouldnt that be easily fixed by increasing or decreasing buffer size?

That doesn't work very well on PA. Causes glitches if you set the buffer
too low. Sound stutters. When you set it high enough, the latency gets
too high for audio work...

That's been my experience at least.

PA is not made for realtime audio, that's it. When I developed the PA backend in LMMS a few years ago I tried everything to mitigate the latency problem but failed, as AFAIR PA dictates the buffer size. So all we can recommend is to continue using ALSA which works best in most cases.

On 01/30/2014 01:40 PM, Tobias Doerffel wrote:

PA is not made for realtime audio, that's it. When I developed the PA
backend in LMMS a few years ago I tried everything to mitigate the
latency problem but failed, as AFAIR PA dictates the buffer size. So
all we can recommend is to continue using ALSA which works best in
most cases.

One thing that I'd like to suggest for making it easier to the user to
use ALSA: make the "device" setting a drop-down menu instead of a
textbox, kind of like it is in audacity. Autodetect all audio devices,
and let the user select it easily from a dropdown. This would make it
much easier to use pure ALSA, not having to look up device names in the
terminal and then input them in manually...

This is implemented in the new setup dialog from the old master branch which is going to be backported for one of the next releases.

I cna confirm this issue still exists for me. but ironically when i switched from alsa to pulse audio the issue went away all together.

On 02/01/2014 01:24 AM, eagles051387 wrote:

I cna confirm this issue still exists for me. but ironically when i
switched from alsa to pulse audio the issue went away all together.

Did you have the ALSA device setting pointed directly to your hardware
device, to prevent PulseAudio from intercepting the ALSA output?

I used the default settings that lmms had set

On Friday, January 31, 2014 03:28:31 PM Vesa V wrote:

On 02/01/2014 01:24 AM, eagles051387 wrote:

I cna confirm this issue still exists for me. but ironically when i
switched from alsa to pulse audio the issue went away all together.

Did you have the ALSA device setting pointed directly to your hardware
device, to prevent PulseAudio from intercepting the ALSA output?


Reply to this email directly or view it on GitHub:
https://github.com/LMMS/lmms/issues/158#issuecomment-33853343

On 02/01/2014 02:23 AM, eagles051387 wrote:

I used the default settings that lmms had set

In that case your ALSA output was probably intercepted by PA which
caused the glitchy audio.

Try this:

http://lmms.sourceforge.net/wiki/index.php/Troubleshooting#I_get_lots_of_latency_.28lag.29_when_playing_instruments_in_LMMS

Follow the instructions there to find out your device designation and
set it in the "device" text box. This lets you use ALSA directly,
without interference from PA. I've found LMMS to work best this way.

guys dont forget you can also change your sound server (ubuntu , and probably linux variants) by using "gstreamer-properties" in the terminal :)

I think this is the same bug that in Pulseaudio 4.0 that is now also affecting Skype. The Pulseaudio devs seem to have written about it here, and provided a fix/workaround as well:
http://arunraghavan.net/2013/08/pulseaudio-4-0-and-skype/

Basically you have to run:
env PULSE_LATENCY_MSEC=60
before running LMMS. It seems to fix the problem for me.

60ms is way too much latency. You can easily get to 10ms latency with ALSA/Jack on almost any hardware.

Is this still an issue? I've been using lmms with alsa for over 2 years now and I never encountered this. Can someone still reproduce?

Yes, this is still relevant for me and I can confirm that Apple has these identically described issues. 60 seconds is a bit extreme though. Pausing and playing again after about 5 second fixes it every time.

I have the problem with "glitchy" sounds from time to time when I run LMMS with ALSA in linux mint 17 cinnamon 64bit. The "quick" workaround I have found is to reboot my pc.
Additionally I cannot figure out how to use LMMS with pulseaudio (the pulseaudio package is installed in my system but I cannot find "pulse" in Settings-> Audio interfaces...)

This issue only exists for me when I have additional programs open; but the problem is that I want to livestream my work. I need Firefox open to view stream chat, and OBS to actually stream it, but every time I make a major change to the project, the sound goes kaput. When I open Sound Settings to check, the alsa-plugin for LMMS is rapidly appearing and disappearing from the Applications tab.

Also, the issue is not always present when I have multiple programs open. Sometimes when the issue does present itself, it fixes itself after a while. This does not happen often, though.

@CtrlFreak1337 in addition to PulseAudio you can try using JACK to livestream your work.

AFAIK there are 2 ways to use the JACK backend - directly or via the libsoundio backend. You can try both.

@andrewrk Thanks. I've recently reinstalled LMMS, and the issue doesn't seem to be resurfacing. If it does, though, I'll be sure to look at those alternatives.

I'm having this same issue. Using Mint 17 Cinnamon, LMMS will work fine for a while, then all of a sudden while previewing instruments, the sound goes distorted. I suspected having the browser open at the same time as LMMS caused the issue so i quit doing that. Even when LMMS is the only program open it still does it. Audio settings are set to use the OS card and my speakers selected as the device.

I am unable to get any sound from PulseAudio. Is this still an issue with PulseAudio 8.0?

Yes, it is. The PULSE_LATENCY_MSEC=60 workaround does not work. The glitch mode is triggered by high CPU usage and it may last indefinitely.
The solution would be:

  1. Detect the likely interception (ALSA device set to default and the presence of /usr/share/alsa/alsa.conf.d/pulse.conf).
  2. Switch to the PulseAudio back end.

Would this be OK?

Old but I may still have this issue on 1.2.0. The sound is incredibly distorted and glitchy (lots of high freq. noise, almost like you took a reverb on master and bitcrushed it), but it always goes away if I adjust the audio volume on my system (arch linux, kde + pulseaudio, sdl as LMMS backend)

Also when this issue occurs it affects all system sounds, not just LMMS.

This very easy to trigger, pick one of the default samples/presets available (by hold and click) while playing your track

Now that I come to think of it, I suspect that it could be caused by CPU issue. If the CPU is at 100%, this may happen.

Anyway I'm not going to verify this theory any time soon. I haven't used LMMS for quite a while.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Andrewer11 picture Andrewer11  Â·  3Comments

Wallacoloo picture Wallacoloo  Â·  3Comments

mikobuntu picture mikobuntu  Â·  4Comments

fentras picture fentras  Â·  3Comments

DomClark picture DomClark  Â·  3Comments