<div><br></div><div>For reference I found that adding the following to the lplayer.py stopped the file descriptor leaks.<br></div><div><br></div><div>    def set_filename(self, filename, jack_name):<br></div><div>        if self.player is not None:<br></div><div>            self.player.set_state(Gst.State.NULL)<br></div><div><br></div><div>        bus = self.player.get_bus()<br></div><div>        bus.remove_signal_watch()<br></div><div>        self.player = self.get_player(jack_name)<br></div><div>        self.player.get_by_name('urisrc').set_property('uri', 'file://' + filename)<br></div><div><br></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Saturday, January 23, 2021 11:10 AM, Patrick Shirkey <patrickshirkey@protonmail.com> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div>Thanks Mattieu.  <br></div><div><br></div><div>That was the hint I needed. Seems that the lplayer method with Gst instead of GstPlayer is leaking the stream file descriptor. In case anyone has the inclination to look into it further, I noticed it increments by three at play() and decrements by two at stop(). <br></div><div><br></div><div><a href="https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py">https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py</a><br></div><div><br></div><div><br></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div>On Friday, January 22, 2021 10:10 PM, Mathieu Duponchelle <mathieu@centricular.com> wrote:<br></div><div><br></div><blockquote class="protonmail_quote" type="cite"><div>GstPlayer can be used from python, and probably fits your use case
    :)<br></div><div><br></div><pre> meh   master  ~  devel  gst-build  ipython3<br></pre><pre>Python 3.8.6 (default, Sep 25 2020, 00:00:00) <br></pre><pre>Type 'copyright', 'credits' or 'license' for more information<br></pre><pre>IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.<br></pre><pre>In [1]: from gi.repository import Gst                                                                                                                                                                                                                                                     <br></pre><pre><ipython-input-1-4132414128eb>:1: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.<br></pre><pre>  from gi.repository import Gst<br></pre><pre>In [2]: Gst.init(None)                                                                                                                                                                                                                                                                    <br></pre><pre>Out[2]: []<br></pre><pre>In [3]: from gi.repository import GstPlayer                                                                                                                                                                                                                                               <br></pre><pre><ipython-input-3-b10918504373>:1: PyGIWarning: GstPlayer was imported without specifying a version first. Use gi.require_version('GstPlayer', '1.0') before import to ensure that the right version gets loaded.<br></pre><pre>  from gi.repository import GstPlayer<br></pre><pre>In [4]: p = GstPlayer.Player()                                                                                                                                                                                                                                                            <br></pre><pre>In [5]: p.set_uri('<a>file:///home/meh/Music/chaplin.wav</a>')                                                                                                                                                                                                                                   <br></pre><pre>In [6]: p.play()                                                                                                                                                                                                                                                                          <br></pre><pre>In [7]: p.set_uri('<a>file:///home/meh/Music/biggie.wav</a>')                                                                                                                                                                                                                                    <br></pre><pre>In [8]: p.play()                                                                                                                                                                                                                                                                          <br></pre><pre><br></pre><div class="moz-cite-prefix">On 1/22/21 7:27 PM, Patrick Shirkey
      wrote:<br></div><blockquote type="cite"><div><br></div><div>Yes, I am using python for this project and this script meets all
      of my requirements except for the file descriptor leak.<br></div><div><br></div><div>Is there a specific step required before/after loading a new audio
      file with:<br></div><div>self.player.get_by_name('urisrc').set_property('uri', '<a>file://</a>' +
      filename)<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>-------- Original Message --------<br></div><div>On Jan 22, 2021, 7:04 PM, Mathieu Duponchelle < <a href="mailto:mathieu@centricular.com">mathieu@centricular.com</a>> wrote: <br></div><blockquote class="protonmail_quote"><div><br></div><div>Hey, are you aware of the existence of gst-player?<br></div><div><br></div><div><a href="https://gstreamer.freedesktop.org/documentation/player/gstplayer.html?gi-language=c">https://gstreamer.freedesktop.org/documentation/player/gstplayer.html?gi-language=c</a><br></div><div><br></div><div>Cheers,<br></div><div><br></div><div><br></div><div><div>-- <br></div><div>Mathieu Duponchelle · <a href="https://www.centricular.com">https://www.centricular.com</a><br></div></div><div><br></div><div class="moz-cite-prefix">On 1/22/21 5:01 PM, Patrick Shirkey
          wrote:<br></div><blockquote type="cite"><div>Hi,<br></div><div><br></div><div>I am using this simple python script to play audio files:<br></div><div><br></div><div><a href="https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py">https://github.com/atareao/lplayer/blob/master/src/lplayer/player.py</a><br></div><div><br></div><div>specifically <br></div><div><br></div><div>85: get_player()<br></div><div>135: play()<br></div><div>172: stop()<br></div><div><br></div><div><br></div><div>Any ideas on why I get 2 additional STREAM file
            descriptors every time I play a new track eventually
            resulting in "Too many open files" error and segfault?<br></div><div><br></div><div>ex.  44u     unix 0x000000008179a133       0t0  100262669
            type=STREAM<br></div><div><br></div><div><br></div><div>--<br></div><div>Patrick Shirkey<br></div><div><br></div><div><br></div><div><br></div><pre wrap>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br></pre></blockquote></blockquote><div><br></div><pre wrap>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br></pre></blockquote></blockquote><div><br></div></blockquote><div><br></div>