I'm converting about 2000 flac-files to mp3. After about 400-500 files, sometimes more, soundconverter crashes with "Cannot open file for Writing" in its logs (see below), also a dialog window pops up and displays the same message. The application hangs and output some gstreamer-errors before crashing out. I am deleting the original files, the problem also occurs after about the same number of files without deleting the source files.
I guess there is a close-call missing and you run into ENFILE or EMFILE, but I am not sure.
I am using Soundconverter 4.0 on Arch Linux.
I've changed the filenames.
```
ERROR: gst-resource-error-quark: Die Ressource konnte nicht zum Schreiben geöffnet werden. (6): 5 filename.flac
converted '1 filename.flac' to '1 filename.mp3'
deleting: '1 filename.flac'
ERROR: gst-resource-error-quark: Die Ressource konnte nicht zum Schreiben geöffnet werden. (6): 6 filename.flac
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.737: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.738: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.738: Creating bus watch failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.738: Could not add signal watch to bus bus10410
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.739: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.739: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.739: Creating bus watch failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.739: Could not add signal watch to bus bus10413
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.740: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.740: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.740: Creating bus watch failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.740: Could not add signal watch to bus bus10416
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.741: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.742: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.742: Creating bus watch failed
(soundconverter:225141): GStreamer-CRITICAL **: 12:13:33.742: Could not add signal watch to bus bus10419
(soundconverter:225141): GLib-ERROR **: 12:13:33.742: Creating pipes for GWakeup: Zu viele offene Dateien
^C^C^Cfish: Job 1, 'soundconverter' terminated by signal SIGTRAP (Verfolgungs- oder Haltepunkt erreicht)
```
with `--debug`, again I removed the file names.
```
ERROR: ui.py, line 120, gst-resource-error-quark: Die Ressource konnte nicht zum Schreiben geöffnet werden. (6): .flac
DEBUG: converter.py, line 367, .mp3
INFO: converter.py, line 407, converted '.flac' to '.mp3'
INFO: converter.py, line 442, deleting: 'file:///.flac'
DEBUG: converter.py, line 321, launching: 'giosrc location="file:///.flac" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=0 ! xingmux ! id3mux ! giosink location="file:///.flac_623214_SC_"'
ERROR: ui.py, line 120, gst-resource-error-quark: Die Ressource konnte nicht zum Schreiben geöffnet werden. (6): file.flac
DEBUG: converter.py, line 321, launching: 'giosrc location="file:///.flac" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=0 ! xingmux ! id3mux ! giosink location="file:///.flac_983381_SC_"'
DEBUG: converter.py, line 321, launching: 'giosrc location="file:///.flac" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=0 ! xingmux ! id3mux ! giosink location="file:///.flac_362721_SC_"'
//..
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.161: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.161: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.161: Creating bus watch failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.161: Could not add signal watch to bus bus5614
DEBUG: converter.py, line 321, launching: 'giosrc location="file:///...flac" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=0 ! xingmux ! id3mux ! giosink location="file:///...flac_556567_SC_"'
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.163: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.163: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.163: Creating bus watch failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.163: Could not add signal watch to bus bus5617
DEBUG: converter.py, line 321, launching: 'giosrc location="file:///file%20%28Deluxe%20Mix%29.flac" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=0 ! xingmux ! id3mux ! giosink location="file:///file__Deluxe_Mix_.flac_712597_SC_"'
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.165: gst_poll_get_read_gpollfd: assertion 'set != NULL' failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.165: gst_bus_create_watch: assertion 'bus->priv->poll != NULL' failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.165: Creating bus watch failed
(soundconverter:230564): GStreamer-CRITICAL **: 12:58:54.165: Could not add signal watch to bus bus5620
(soundconverter:230564): GLib-ERROR **: 12:58:54.165: Creating pipes for GWakeup: Zu viele offene Dateien
fish: Job 1, 'soundconverter --debug' terminated by signal SIGTRAP (Verfolgungs- oder Haltepunkt erreicht)
```
I'm not observing fds that are not being closed in /proc. As soundconverter finishes off its running tasks the number of open fds there is being reduced on my system. Is that the case for you as well?
I also think closing and opening files would be gstreamers job, since soundconverter is really just creating pipelines for gstreamer to execute.
The error might originate from here: https:/ /github. com/kassoulet/ soundconverter/ blob/py3k/ soundconverter/ gstreamer/ converter. py#L545 which stops the whole pipeline. Maybe soundconverter should continue converting and ignore that error?