Emacs flickers periodically

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Emacs flickers periodically

Narendra Joshi
Hi,

I see my Emacs flickering when there is a huge update to the screen. It
happens sometimes without me doing anything at all. Has anyone else
faced similar problem? How did you fix it?

Best,
--
Narendra Joshi

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Emanuel Berg-4
Narendra Joshi <[hidden email]> writes:

> I see my Emacs flickering when there is a huge
> update to the screen. It happens sometimes without
> me doing anything at all. Has anyone else faced
> similar problem? How did you fix it?

O.o?

Do you have an old CRT or do you run Emacs on your TV?

What's the computer system?

Because that shouldn't happen, no.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Dmitry Gutov
In reply to this post by Narendra Joshi
On 6/16/17 7:59 PM, Narendra Joshi wrote:

> I see my Emacs flickering when there is a huge update to the screen. It
> happens sometimes without me doing anything at all. Has anyone else
> faced similar problem? How did you fix it?

Try an Emacs 26 build. It has double buffering on GNU/Linux.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Emanuel Berg-4
Dmitry Gutov <[hidden email]> writes:

>> I see my Emacs flickering when there is a huge
>> update to the screen. It happens sometimes without
>> me doing anything at all. Has anyone else faced
>> similar problem? How did you fix it?
>
> Try an Emacs 26 build. It has double buffering on
> GNU/Linux.

I have

    GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+
    Version 3.22.12) of 2017-04-29 on trouble,
    modified by Debian

and never experienced flickering.

Is it yet another GUI issue unheard of on a tty or
terminal Emacs?

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Dmitry Gutov
On 6/17/17 12:57 PM, Emanuel Berg wrote:

> Is it yet another GUI issue unheard of on a tty or
> terminal Emacs?

Possibly. Terminals do their own synchronization.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Eli Zaretskii
> From: Dmitry Gutov <[hidden email]>
> Date: Sat, 17 Jun 2017 13:10:51 +0300
>
> On 6/17/17 12:57 PM, Emanuel Berg wrote:
>
> > Is it yet another GUI issue unheard of on a tty or
> > terminal Emacs?
>
> Possibly.

Actually, Emacs flickers on a TTY more frequently than in GUI frames,
because certain changes on display require that the entire TTY frame
be redrawn.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Dmitry Gutov
On 6/17/17 1:48 PM, Eli Zaretskii wrote:

> Actually, Emacs flickers on a TTY more frequently than in GUI frames,
> because certain changes on display require that the entire TTY frame
> be redrawn.

Couldn't that actually be beneficial? As long as it's never redrawn in
an inconsistent state.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Emanuel Berg-4
Dmitry Gutov wrote:

>> Actually, Emacs flickers on a TTY more
>> frequently than in GUI frames, because
>> certain changes on display require that the
>> entire TTY frame be redrawn.
>
> Couldn't that actually be beneficial? As long
> as it's never redrawn in an
> inconsistent state.

I have never experienced flickering but now
that I think about it I don't even know the
definition of the word. Perhaps it happens to
me all the time only my eyes and/or brain by
now flickers as well to cancel it out...

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Eli Zaretskii
In reply to this post by Dmitry Gutov
> From: Dmitry Gutov <[hidden email]>
> Date: Sat, 17 Jun 2017 13:51:37 +0300
>
> On 6/17/17 1:48 PM, Eli Zaretskii wrote:
>
> > Actually, Emacs flickers on a TTY more frequently than in GUI frames,
> > because certain changes on display require that the entire TTY frame
> > be redrawn.
>
> Couldn't that actually be beneficial?

Beneficial in what sense?  Users are generally annoyed by flickering,
especially when most or all of the display doesn't change.

> As long as it's never redrawn in an inconsistent state.

AFAIK, Emacs never redraws display in inconsistent state (barring
bugs, of course).

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Narendra Joshi
In reply to this post by Emanuel Berg-4
Emanuel Berg <[hidden email]> writes:

> Dmitry Gutov <[hidden email]> writes:
>
>>> I see my Emacs flickering when there is a huge
>>> update to the screen. It happens sometimes without
>>> me doing anything at all. Has anyone else faced
>>> similar problem? How did you fix it?
>>
>> Try an Emacs 26 build. It has double buffering on
>> GNU/Linux.
>
> I have
>
>     GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+
>     Version 3.22.12) of 2017-04-29 on trouble,
>     modified by Debian
>
> and never experienced flickering.
Earlier I was on Archlinux with XMonad and never experienced this with
Emacs 24 or Emacs 25. Now, I am on Kali Linux and Emacs 25 flickers all
the time.

--
Narendra Joshi

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Narendra Joshi
In reply to this post by Emanuel Berg-4
Emanuel Berg <[hidden email]> writes:

> Dmitry Gutov wrote:
>
>>> Actually, Emacs flickers on a TTY more
>>> frequently than in GUI frames, because
>>> certain changes on display require that the
>>> entire TTY frame be redrawn.
>>
>> Couldn't that actually be beneficial? As long
>> as it's never redrawn in an
>> inconsistent state.
>
> I have never experienced flickering but now
> that I think about it I don't even know the
> definition of the word. Perhaps it happens to
> me all the time only my eyes and/or brain by
> now flickers as well to cancel it out...
:) Makes sense.

--
Narendra Joshi

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Narendra Joshi
In reply to this post by Emanuel Berg-4
Emanuel Berg <[hidden email]> writes:

> Narendra Joshi <[hidden email]> writes:
>
>> I see my Emacs flickering when there is a huge
>> update to the screen. It happens sometimes without
>> me doing anything at all. Has anyone else faced
>> similar problem? How did you fix it?
>
> O.o?
>
> Do you have an old CRT or do you run Emacs on your TV?
>
> What's the computer system?
It's a decent laptop. I didn't use to see this on Archlinux. Now, I am
on Kali Linux and something that I am not aware of has changed which is
causing Emacs to flicker.

--
Narendra Joshi

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Emanuel Berg-4
Narendra Joshi <[hidden email]> writes:

> It's a decent laptop. I didn't use to see this on
> Archlinux. Now, I am on Kali Linux and something
> that I am not aware of has changed which is causing
> Emacs to flicker.

Do you experience the same on other applications since
moving between systems?

Not that the Linux distribution should influence this.
The operative system I mean word is "should" tho...

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Emanuel Berg-4
In reply to this post by Dmitry Gutov
Dmitry Gutov <[hidden email]> writes:

> Possibly. Terminals do their own synchronization.

Is there any way to stress Emacs trying to provoke
this kind of state?

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Narendra Joshi
In reply to this post by Emanuel Berg-4
Emanuel Berg <[hidden email]> writes:

> Narendra Joshi <[hidden email]> writes:
>
>> It's a decent laptop. I didn't use to see this on
>> Archlinux. Now, I am on Kali Linux and something
>> that I am not aware of has changed which is causing
>> Emacs to flicker.
>
> Do you experience the same on other applications since
> moving between systems?
No, this happens only with Emacs.

> Not that the Linux distribution should influence this.
> The operative system I mean word is "should" tho...

--
Narendra Joshi

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Dmitry Gutov
In reply to this post by Eli Zaretskii
On 6/17/17 4:56 PM, Eli Zaretskii wrote:

>>> Actually, Emacs flickers on a TTY more frequently than in GUI frames,
>>> because certain changes on display require that the entire TTY frame
>>> be redrawn.
>>
>> Couldn't that actually be beneficial?
>
> Beneficial in what sense?  Users are generally annoyed by flickering,
> especially when most or all of the display doesn't change.

In the "eliminating bugs" sense, bugs to which you referred later. I
can't say I have a clear idea how, except by eliminating certain
optimizations which you refer to in bug#16621).

And also, terminal emulators might have their own display
synchronization logic. Still, I've never tried the test cases for the
two bugs mentioned below in the terminal. Maybe someone should do that
and report back.

>> As long as it's never redrawn in an inconsistent state.
>
> AFAIK, Emacs never redraws display in inconsistent state (barring
> bugs, of course).

But that's the effect that the double-buffering patch brings: limiting
redrawing to consistent states only.

So maybe those were bugs (like 12363 and 16621), but they went unfixed
until Daniel's patch.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Eli Zaretskii
> From: Dmitry Gutov <[hidden email]>
> Date: Sat, 17 Jun 2017 21:21:12 +0300
>
> >> Couldn't that actually be beneficial?
> >
> > Beneficial in what sense?  Users are generally annoyed by flickering,
> > especially when most or all of the display doesn't change.
>
> In the "eliminating bugs" sense, bugs to which you referred later. I
> can't say I have a clear idea how, except by eliminating certain
> optimizations which you refer to in bug#16621).
>
> And also, terminal emulators might have their own display
> synchronization logic.

Flickering is not caused by display synchronization.  It is caused by
constant redrawing of large portions of display with the same content.

> > AFAIK, Emacs never redraws display in inconsistent state (barring
> > bugs, of course).
>
> But that's the effect that the double-buffering patch brings: limiting
> redrawing to consistent states only.
>
> So maybe those were bugs (like 12363 and 16621), but they went unfixed
> until Daniel's patch.

That's not what double-buffering does.  What it does, AFAIU, is let
Emacs redraw however many times it wants, and then bitblt the result
only once to the glass.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Dmitry Gutov
On 6/17/17 9:35 PM, Eli Zaretskii wrote:

> Flickering is not caused by display synchronization.  It is caused by
> constant redrawing of large portions of display with the same content.

Not necessarily large ones. And vice versa, large portions of display
can be redrawn often and the user might be fine with it if only
consistent states are shown. The result might be called "animation".

>>> AFAIK, Emacs never redraws display in inconsistent state (barring
>>> bugs, of course).
>>
>> But that's the effect that the double-buffering patch brings: limiting
>> redrawing to consistent states only.
>>
>> So maybe those were bugs (like 12363 and 16621), but they went unfixed
>> until Daniel's patch.
>
> That's not what double-buffering does.  What it does, AFAIU, is let
> Emacs redraw however many times it wants, and then bitblt the result
> only once to the glass.

Those are implementation details. In effect, the redraw happens once.

But *when* does it happen? If the choice of this moment was not good
enough, bugs 12363 and 16621 would continue occurring.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs flickers periodically

Eli Zaretskii
> From: Dmitry Gutov <[hidden email]>
> Date: Sat, 17 Jun 2017 22:27:56 +0300
>
> But *when* does it happen?

When all the windows of a frame that needed to be updated were
updated.