<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>461299</bug_id>
          
          <creation_ts>2022-11-01 20:30:05 +0000</creation_ts>
          <short_desc>elisa: irrtating stutters when playing audio</short_desc>
          <delta_ts>2026-02-19 23:02:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>Elisa</product>
          <component>general</component>
          <version>22.08.2</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Roman Lebedev">lebedev.ri</reporter>
          <assigned_to name="Matthieu Gallien">matthieu_gallien</assigned_to>
          <cc>coucouf</cc>
    
    <cc>florianl.xd</cc>
    
    <cc>lebedev.ri</cc>
    
    <cc>mathispaquet362</cc>
    
    <cc>nate</cc>
    
    <cc>sunwebrw</cc>
          
          <cf_commitlink>https://invent.kde.org/multimedia/elisa/commit/7848ea003340ce1e7269e3fa96396eaf17e3e77d</cf_commitlink>
          <cf_versionfixedin>23.04</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2167748</commentid>
    <comment_count>0</comment_count>
    <who name="Roman Lebedev">lebedev.ri</who>
    <bug_when>2022-11-01 20:30:05 +0000</bug_when>
    <thetext>Sometimes, when playing local audio files, regardless of system&apos;s load level,
the audio playback momentairly stops and then resumes, it takes maybe less than 1s.

This is happening on fully performance tuned Pipewire setup,
and pwtop does not show any issues on pipewire side.

I highly suspect elisa is simply running out of the input to play,
and stutters when fetching next chunk from disk.

Does elisa already have some kind of precaching system?
Would it be acceptable to simply fully prefetch the whole file
before playing, or is the filesize a concern? Something smarter,
like ensuring that N next seconds are always avaliable could be nice, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2169451</commentid>
    <comment_count>1</comment_count>
    <who name="Roman Lebedev">lebedev.ri</who>
    <bug_when>2022-11-05 22:21:57 +0000</bug_when>
    <thetext>Posted minimal fix at https://invent.kde.org/multimedia/elisa/-/merge_requests/397
I don&apos;t know if this fully solves the problem for me, but if it does not,
the next step would be forcing the kernel to prefetch the whole file...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173251</commentid>
    <comment_count>2</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-11-14 17:29:11 +0000</bug_when>
    <thetext>Git commit 7848ea003340ce1e7269e3fa96396eaf17e3e77d by Nate Graham, on behalf of Roman Lebedev.
Committed on 14/11/2022 at 17:29.
Pushed by ngraham into branch &apos;master&apos;.

Set libvlc playback cache size to 10 seconds (#461299)

The most common use-case for Elisa is to start playing something, and let it play
without jumping around. libvlc defaults to 1 seconds of cache; let&apos;s increase it
to 10 seconds to cut down on the potential for audio stutters.
23.04

M  +7    -0    src/audiowrapper_libvlc.cpp

https://invent.kde.org/multimedia/elisa/commit/7848ea003340ce1e7269e3fa96396eaf17e3e77d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176679</commentid>
    <comment_count>3</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-11-23 10:50:58 +0000</bug_when>
    <thetext>I’ve added the patch to the Debian package on top of 22.08.3 but it doesn’t solve the issue. It makes it less frequent but I still have occasional sound cuts on an otherwise idle modern machine.

I’ve not looked at the code but if the stutter is due to the playback directly waiting for the data to load from the disk, the correct solution is not to make the buffer bigger, it’s only going to make it less frequent.
Also loading complete files in memory is not the solution either. I have a couple of albums that are a single FLAC file of a couple hundres of MBs and it seems overkill to load these entirely into memory.

If the issue is really the playback buffer becoming empty, the real fix would be to ensure the prefetch is done in the background so the playback never ends up waiting for the data to be there.


Thanks for looking into this !</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176693</commentid>
    <comment_count>4</comment_count>
    <who name="Roman Lebedev">lebedev.ri</who>
    <bug_when>2022-11-23 12:50:34 +0000</bug_when>
    <thetext>(In reply to Aurélien COUDERC from comment #3)
&gt; I’ve added the patch to the Debian package on top of 22.08.3 but it doesn’t
&gt; solve the issue. It makes it less frequent but I still have occasional sound
&gt; cuts on an otherwise idle modern machine.
&gt; 
&gt; I’ve not looked at the code but if the stutter is due to the playback
&gt; directly waiting for the data to load from the disk, the correct solution is
&gt; not to make the buffer bigger, it’s only going to make it less frequent.
&gt; Also loading complete files in memory is not the solution either. I have a
&gt; couple of albums that are a single FLAC file of a couple hundres of MBs and
&gt; it seems overkill to load these entirely into memory.
&gt; 
&gt; If the issue is really the playback buffer becoming empty, the real fix
&gt; would be to ensure the prefetch is done in the background so the playback
&gt; never ends up waiting for the data to be there.
&gt; 
&gt; 
&gt; Thanks for looking into this !

I have not analysed *all* the remaining issues i heard, but at least some of them were artifacts in the audio itself.
Are you sure that is not the case for you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176715</commentid>
    <comment_count>5</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-11-23 14:58:12 +0000</bug_when>
    <thetext>After more testing it seems to be limited to some files and the stuttering is reproducible for the same file and timestamp with all VLC-based apps.

Mplayer doesn’t choke on the same files.

I will do more testing and report but I guess from an Elisa standpoint you can close the bug.


Thanks !</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176720</commentid>
    <comment_count>6</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-11-23 15:25:53 +0000</bug_when>
    <thetext>Sounds like a libvlc issue, perhaps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176771</commentid>
    <comment_count>7</comment_count>
    <who name="Roman Lebedev">lebedev.ri</who>
    <bug_when>2022-11-23 20:53:11 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #6)
&gt; Sounds like a libvlc issue, perhaps.

You know what, why don&apos;t we just switch to libvlc backend?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176772</commentid>
    <comment_count>8</comment_count>
    <who name="Roman Lebedev">lebedev.ri</who>
    <bug_when>2022-11-23 20:53:32 +0000</bug_when>
    <thetext>(In reply to Roman Lebedev from comment #7)
&gt; (In reply to Nate Graham from comment #6)
&gt; &gt; Sounds like a libvlc issue, perhaps.
&gt; 
&gt; You know what, why don&apos;t we just switch to libvlc backend?

Err. Of course, i meant libmpv.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2177695</commentid>
    <comment_count>9</comment_count>
    <who name="Roman Lebedev">lebedev.ri</who>
    <bug_when>2022-11-25 23:05:45 +0000</bug_when>
    <thetext>(In reply to Roman Lebedev from comment #8)
&gt; (In reply to Roman Lebedev from comment #7)
&gt; &gt; (In reply to Nate Graham from comment #6)
&gt; &gt; &gt; Sounds like a libvlc issue, perhaps.
&gt; &gt; 
&gt; &gt; You know what, why don&apos;t we just switch to libvlc backend?
&gt; 
&gt; Err. Of course, i meant libmpv.

https://invent.kde.org/multimedia/elisa/-/merge_requests/400
Testing welcomed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2181270</commentid>
    <comment_count>10</comment_count>
    <who name="Aurélien COUDERC">coucouf</who>
    <bug_when>2022-12-04 21:17:40 +0000</bug_when>
    <thetext>For reference there’s an upstream bug referencing the FLAC stuttering issue in VLC/libvlc here :
https://code.videolan.org/videolan/vlc/-/issues/27454

And a fix :
https://code.videolan.org/videolan/vlc/-/merge_requests/2918/diffs

That we’ve applied to the Debian sources on top of 3.0.18 with a minor fix here :
https://salsa.debian.org/multimedia-team/vlc/-/commit/c5289e84e17421c1e40ef9f0953b6c0f96a20cb2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2181449</commentid>
    <comment_count>11</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-12-05 18:37:56 +0000</bug_when>
    <thetext>Oh great!

Roman, can you try to patch your VLC sources (if your distro isn&apos;t already offering that fix, of course) and see if it fixes the issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2214472</commentid>
    <comment_count>12</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2023-03-06 22:38:39 +0000</bug_when>
    <thetext>*** Bug 466735 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2264499</commentid>
    <comment_count>13</comment_count>
    <who name="">sunwebrw</who>
    <bug_when>2023-11-09 20:48:42 +0000</bug_when>
    <thetext>I have the same issue. Version 23.08.2
Mpv plays flac well, Elisa stutters(sometimes way too often).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2264503</commentid>
    <comment_count>14</comment_count>
    <who name="">sunwebrw</who>
    <bug_when>2023-11-09 20:53:56 +0000</bug_when>
    <thetext>I forgot to update vlc, now everything is good, sorry.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2494871</commentid>
    <comment_count>15</comment_count>
    <who name="Mathis Paquet">mathispaquet362</who>
    <bug_when>2026-02-15 18:36:24 +0000</bug_when>
    <thetext>I get a similar problem where Elisa will randomly cut playback once or twice at the beginning of a file, for less than a second. 
Does not happen on any other media player.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2494905</commentid>
    <comment_count>16</comment_count>
    <who name="Mathis Paquet">mathispaquet362</who>
    <bug_when>2026-02-15 19:59:44 +0000</bug_when>
    <thetext>I think it might be this bug: https://code.videolan.org/videolan/vlc-ios/-/issues/1339
which is supposedly fixed in vlc 4 (which has been in development for years).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2496422</commentid>
    <comment_count>17</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2026-02-19 22:58:42 +0000</bug_when>
    <thetext>If you&apos;re using the Flatpak packaging, this is tracked with Bug 512972, which, yeah indeed looks like https://code.videolan.org/videolan/vlc-ios/-/issues/1339. Well spotted!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2496424</commentid>
    <comment_count>18</comment_count>
    <who name="Mathis Paquet">mathispaquet362</who>
    <bug_when>2026-02-19 23:00:05 +0000</bug_when>
    <thetext>I am using the version from the Arch repository. Also, it happens only with Bluetooth headphones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2496426</commentid>
    <comment_count>19</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2026-02-19 23:01:02 +0000</bug_when>
    <thetext>Mm, maybe I was mistaken and the packaging isn&apos;t relevant here, and it&apos;s only about which backend library is in use.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2496427</commentid>
    <comment_count>20</comment_count>
    <who name="Mathis Paquet">mathispaquet362</who>
    <bug_when>2026-02-19 23:02:48 +0000</bug_when>
    <thetext>Indeed, the report you linked for the flatpak version is the exact same issue I have.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>