olavfosse / eradio

The simple radio player for GNU Emacs
GNU General Public License v3.0
62 stars 6 forks source link

Audio stops and starts when emacs is in the background #7

Closed j-minster closed 4 years ago

j-minster commented 4 years ago

Describe the bug Whenever I go to another workspace and go away from emacs, the audio from radio starts and stops intermittently. The issue stops once I go back to emacs and it is the main window.

To Reproduce Do M-x eradio-play, and choose any station. Make emacs 'fullscreen', then switch to another workspace. Wait 10 seconds. This happens with all stations I have tried (around 8)

Expected behavior Radio should continue playing normally in the background.

Operating Systems I am running macOS Catalina, yabai wm, emacs is from homebrew, running doom emacs.

Config I am using the exact config suggested in the README. I am using mpv as the back-end with the --no-video flag.

j-minster commented 4 years ago

This start-stop behaviour is also occurring when emacs is tiled, but out of focus, and I am operating on another window in the same workspace.

I am not trying to complain, it is free software, and it is EXCELLENT besides this. I just thought there may be an easy fix and I would love to know. Thanks

olavfosse commented 4 years ago

Thanks for the bug report. I normally use VLC which does not have this issue, so the obvious workaround is to just use that. Anyways I was able to reproduce it on my Mac setup (see appendix). All eradio does is run the player command and eventually kill the process. Therefore I believe the solution has to be a change of the mpv command list somehow.



$ mpv --version
mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Tue Jun 16 15:58:50 BST 2020
ffmpeg library versions:
   libavutil       56.31.100 (runtime 56.51.100)
   libavcodec      58.54.100 (runtime 58.91.100)
   libavformat     58.29.100 (runtime 58.45.100)
   libswscale      5.5.100 (runtime 5.7.100)
   libavfilter     7.57.100 (runtime 7.85.100)
   libswresample   3.5.100 (runtime 3.7.100)
ffmpeg version: 4.3.1$ mpv --version
mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Tue Jun 16 15:58:50 BST 2020
ffmpeg library versions:
   libavutil       56.31.100 (runtime 56.51.100)
   libavcodec      58.54.100 (runtime 58.91.100)
   libavformat     58.29.100 (runtime 58.45.100)
   libswscale      5.5.100 (runtime 5.7.100)
   libavfilter     7.57.100 (runtime 7.85.100)
   libswresample   3.5.100 (runtime 3.7.100)
ffmpeg version: 4.3.1
$ uname -a
Darwin Yui 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
olavfosse commented 4 years ago

b2766b5b4540e507e35a0a35f61f0a0402881d41 seems to fix the issue. This has not been tested very extensively, but I was unable to reproduce it from 30 minutes~ of usage with the new version. Either way using --no-terminal is the correct way of invoking mpv. Feel free to reopen if the issue reoccurs.

Thanks for the kinds words and describing the bug.

Good night.

j-minster commented 4 years ago

Working perfectly now! Thank-you so much!