rasmusab / beepr

The package that sounds as it is called.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

beepr crashes R on Windows 10 & 11 machines

nikosGeography opened this issue · comments

Hi, I'd like to mention an issue I encountered when using beepr on a Windows 10 and 11 machines. I should mention that the Windows 11 machine is equipped with 16gb RAM, i7 12th Gen Intel and an RTX 3070. Also, I am using R 4.1.1 on both machines. When performing some analysis (e.g., GWR) and I am using the beepr package after some code chunk, in order to notify me that the chunk completed the analysis, R crashes right after the notification sound of beepr. If I don't use the notifications from beepr ``R continues without any problem. The same happened with other Windows machines (I tried it with my friends laptop). Any ideas of why might that happens? Thanks

commented

I have a similar issue on various Windows 10 machines. It does sometimes happen seemingly at random, but it happens most frequently and almost inevitably when the display is asleep and/or sound is inactive. For example, when used in a remote machine that has wonky sound support, only actually outputting sound about 50% of the time for whatever reason, beepr crashes my R session very frequently. On one of my local machines, when my display is asleep, it uses the laptop's internal speakers instead of the display's speakers and it usually causes a crash. I use beepr to alert me when a process that takes a long time to run is completed. As such, many times when beepr is activated there is some kind of unusual power/availability state with the display/sound or both and that is when I see the most crashes.

I removed the packages entirely, the problem was so annoying and as you said it was happening way to frequently.

commented

Here are some alternatives I'm exploring:

-This one is kind of annoying because it requires some manual setup.
--Install VideoLan (VLC) on the machine
--Add directory to Windows PATH (i.e. C:\Program Files\VideoLAN\VLC) so you can run vlc from the command line
--Logout and log back in
--Get or make a wav file to play (in this case, BEEP.wav)
--Test command line command:
vlc -I dummy --dummy-quiet c:\temp\BEEP.wav vlc://quit
--If it works, add an escape to the path so R will understand it and run with base function system:
system("vlc -I dummy --dummy-quiet c:\\temp\\BEEP.wav vlc://quit",ignore.stdout = TRUE, ignore.stderr = TRUE)

-This approach requires no setup, but is unlikely to be much better as it is almost the same as how beepr works:

library(audio)
fname = "C:\temp\BEEP.wav"
sfx <- load.wave(fname)
play(sfx)

The best thing is to leave this issue open until someone fixes it. Thanks anyway for the recommendation.

I don't believe I will be able to fix this. My guess this is related to the sound package, but it's really hard for me to debug that. I'll get hold of a windows machine to try this out, but If I can't reproduce this then I don't know how to proceed here...