Martchus / dbus-soundrecorder

Records sound from Pulse Audio with ffmpeg while watching D-Bus to determine tracks and meta information
GNU General Public License v2.0
6 stars 1 forks source link

Failed to start ffmpeg: Process crashed; FFmpeg finished with exit code 15 #1

Open redfast00 opened 1 year ago

redfast00 commented 1 year ago

I"m trying to use this application to save audio played by Chromium on Linux. I get the following error:

Watching MPRIS service of the specified application "chromium.instance19990" ...
Playback started
Next song: Just Didn't Need To Know (2019 Version)
Started ffmpeg: ffmpeg -f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo -t 220.009 -metadata title=Just Didn't Need To Know (2019 Version) -metadata artist=The Shivers /home/user/Music/downloaded/The Shivers/Just Didn't Need To Know (2019 Version).m4a
ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
alsa_output.pci-0000_00_1f.3.analog-stereo: Input/output error
Playback stopped
FFmpeg finished with exit code 1
Playback started
Playback stopped
Playback started
Next song: Friday Night Big Screen
Playback stopped
Started ffmpeg: ffmpeg -f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo -metadata title=Friday Night Big Screen -metadata artist=girli /home/user/Music/downloaded/girli/Friday Night Big Screen.m4a
Failed to start ffmpeg: Process crashedFFmpeg finished with exit code 15

dbus-soundrecorder seems to immediately stop the stream, and I have to manually restart it before it plays again, after which it goes to the next song, which has the same problem (but a slightly different error message). The alsa_output... sink are my headphones, the chromium.instance... was the application name found from dbus-monitor. I think this might have something to do with the fact that there are multiple consumers of the same sink.

redfast00 commented 1 year ago

I also have this error when playing to a null sink, it might be unrelated that there are two consumers of the same sink

Martchus commented 1 year ago

I've never tried it with Chromium and also generally haven't used the recorder for ages.

Normally the "workflow" was creating a huge playlist on $music_service. Then one started the recorder (while nothing is playing yet). Then one starts the playback. A few days later (when the playlist was completed) the server this setup ran on had a huge music collection on the HD. Unfortunately it ceased to the because $music_service added random delays between the feedback from the D-Bus interface and the actual playback. That's when I've lost interest in this project. I've never tried it with two consumers. Normally this whole setup ran on a server (except for the initial experimenting).

It took me some initial tweaking to get it working with $music_service. Most likely you'll have to do the same. The code isn't hard to understand (although also maybe not very thought through - I've coded this at university while waiting for the next lecture).