HermesApp / Hermes

Compact macOS Pandora client that doesn’t use Flash
http://hermesapp.org/
MIT License
381 stars 99 forks source link

Hermes crashes on sleep 10.11.2 #251

Open dhrowe opened 8 years ago

dhrowe commented 8 years ago

Hermes_2015-12-25-222038_Herb-Rowes-iMac-2.crash.zip

Crashes either on sleep or when it wakes up, pretty much every time.

rowdyruckus commented 8 years ago

+1 yes for me as well

arraylabs commented 8 years ago

I see it crashing often as well after wake with segmentation fault 11.

nriley commented 8 years ago

Can you attach a crash log? Thanks

NewsView commented 7 years ago

I have the same problem for which I have posted logs over on the Apple Community forums. I have been trying to troubleshoot the issue for a couple of weeks. The thread refers to both Hermes (current version) and HD Radio for Pandora under OS X El Capitan because I tried alternating (uninstalling/reinstalling) apps when I couldn't prevent them from crashing every 7-12 minutes. At this point I am leaning toward it being sleep related. The topic is titled "Two Different Pandora Apps Hang on MacBook (Crashlog Help)":

https://discussions.apple.com/thread/7805488

My crashlogs refer to the System "Audio Toolbox" and to a call for a sharing/remote function of some sort that doesn't appear to correspond to any of my system/library preference files. I'm at a total loss and about to reinstall the OS to see if I can fix it because I've tried everything else, including network diagnostics, renewing the DHCP lease, turning off file sharing and trashing power management, bluetooth preferences, etc.

Since I am rather new to Hermes one of my questions when running it on a MacBook Pro (mid-2012) is whether or not disconnect-on-sleep is inevitable short of totally disabling HD sleep in Energy Saver? A couple of times I had the app remain active, just suspended with the dialog that it requires an "active Internet connection" but most of the time the app just crashes outright on sleep, always at the conclusion of a song (before it's time to load more into the buffer, presumably). Most of the time the only feedback I get is a System message asking if I want to report the issue to Apple, which I have done numerous times.

I don't have any other wi-fi problems. I've tested it on and off ethernet. And I have another Mac running El Capitan with no issues during sleep on the same network, so not likely to be my network at issue.

I hope filling in this information (along with the logs on the Apple forum) can help get to the bottom of this!

Thank you & Happy New Year!

NewsView commented 7 years ago

Here are the extracted portions of my latest Hermes/System crashlog that seems relevant; however, I do not know how to fix it. Will someone PLEASE jump in and tell me what this process is hanging up on?

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: EXC_I386_GPFLT Exception Note: EXC_CORPSE_NOTIFY

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.audio.toolbox.AudioToolbox 0x00007fff995be285 MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) + 1527 1 com.apple.audio.toolbox.AudioToolbox 0x00007fff995a2630 AudioFileStreamObject::ParseBytes(unsigned int, AudioFileStreamContinuation&) + 108 2 com.apple.audio.toolbox.AudioToolbox 0x00007fff995a1ebf AudioFileStreamWrapper::ParseBytes(unsigned int, void const*, unsigned int) + 97

Thread 0 crashed with X86 Thread State (64-bit): rax: 0xa00007fb3c8c4d69 rbx: 0x0000000000000688 rcx: 0x0000000000000000 rdx: 0x0000000000000688 rdi: 0x00007fb3c904c200 rsi: 0x0000000109908c5f rbp: 0x00007fff56326a80 rsp: 0x00007fff563269a0 r8: 0x0000000000000006 r9: 0x0000000000000000 r10: 0x00007fb3c983ba00 r11: 0x00000001099263a8 r12: 0x0000000000000688 r13: 0x0000000000000004 r14: 0x00007fb3c8ca03e0 r15: 0x00007fb3c8ca03e8 rip: 0x00007fff995be285 rfl: 0x0000000000010246 cr2: 0x0000000105462000

Logical CPU: 0 Error Code: 0x00000000 Trap Number: 13

NewsView commented 7 years ago

UPDATE

Good news…

Over at "AskDifferent" I was told to check for third-party audio drivers. Turns out there was a "Soundflower" extension loaded and when I removed that I resolved the Hermes "unexpectedly quit" app crashes upon wake. Now the app simply suspends when it loses wi-fi until I wake the MacBook (at which point I can resume playback).

I still need assistance (please, anyone… Help?):

Current problem is, I want an option in Hermes (and apps like it) to "keep awake" the network connection while active, and yet that checkbox/preference doesn't appear to exist.

One suggestion was to use "Wimoweh" or "Amphetamine" from the App Store to selectively "keep alive" wi-fi connectivity for Hermes (current version). Therein lies my question. Per the Wimoweh FAQ, there is a way to program apps like Hermes to make "assertions" that will allow the wi-fi network to remain active. The app has to be programmed to convey to OS X that it is indeed busy (streaming Pandora) and not to sleep the computer while running (at least not to the point where wi-fi disconnects). Here's the quote from the FAQ:

"If you’re using Wimoweh to stop the system sleeping to handle one specific app it might be worth asking the developer to check out IOPMAssertionCreateWithDescription in Apple’s developer documentation. In just a few lines of code they can have their application inform OS X when the application is busy and then you, in the best possible way, will no longer need to use Wimoweh. "

Now I wish that Apple had seen fit at any time in the history of OS X to place a tick-box in the Energy Saver pane to prompt the user to "decide" whether to sleep Internet connections (yes/no). A "no" would mean that sleep settings apart from the Internet connection are enforced but wi-fi connectivity does not terminate with sleep. But since Apple doesn't encode the OS this way, and the "Wake for Network Activity" is actually counterproductive — meaning the confusion is amplified by the fact that "Wake for Network Activity" is apparently NOT designed to address wi-fi drop-outs that terminate downloads, mail pickup or, as in this case, audio streaming — I do believe that it is ultimately Apple's "bad" not to have made this setting user-configurable within the OS (short of messing around in Terminal to execute a TCP/IP "keepalive" function).

Although coming straight from Snow Leopard to El Capitan I didn't appreciate as much, apparently it is well established that with the introduction of Mountain Lion OS X more aggressively enforced sleep settings. So either A) Apple needed to allow OS X to present the user with the option to sleep (or not sleep) active Internet connections, or B) Hermes and apps similar to it, such as HD Radio for Pandora, need to encode ASSERTIONS to keep wi-fi/network connections OPEN as long as the audio streaming is active at the time the computer attempts to enter sleep.

It would appear that "Hermes" isn't actively maintained from some of the other messages I've read here on GitHub (which is sad). But SURELY a still-current user/fan can help me understand why Hermes has all these nifty features of being able to "pause" for screen saver or "pause" for screen lock" — and yet best I can tell there's nothing in the app or user-preferences to implicitly tell the OS to keep the wi-fi/network connection active?????

I am seeing from my previous crashlogs that audio streams terminate at sleep. So more than just being a conflict with some outdated third-party Audio driver, the audio-stream disconnects trace back to a timeout. Hermes would appear to be calling for the next batch of Pandora content to enter the buffer but because OS X (El Cap) has slept the network connection it can't reach the Pandora sever and then the disconnect error comes up (and in some cases this also triggers a wholesale crash of the app). It seems like a no-brainer that either the Assertion needs to be encoded per the Wimoweh developer advice or, if I am mistaken and the app should be able to keep running in the background even at idle than at least let me know that much (so that I can conclude that my OS X install is at issue rather than some inherent shortcoming of the Assertion encodings in the app).

To recap the above in less technical terms:

Hermes may not be actively maintained but surely there are people using the current version who can tell me if THEIR Macs lose the audio stream between Pandora/Hermes every time the system enters sleep.

nriley commented 7 years ago

Thanks for the research but I'm still having a bit of trouble understanding this.

Hermes doesn't do anything to prevent system sleep. The issue you saw which resolved when you removed Soundflower is likely an OS bug and nothing to do with Hermes specifically.

I don't ever listen to Hermes when I'm not otherwise using my Mac so I haven't ever had this problem. Hermes doesn't keep a network connection open to Pandora constantly, instead it downloads a few songs at a time; this is just how Pandora works.

From reading your post on the Apple Support site, it seems you may actually be running into another issue (#285), which appears to be specific to some changes Apple made in 10.12, and unfortunately which I can't reliably reproduce to see if there's a way for Hermes to work around the problem. I do have some vacation time next week and will try once again to see if I can reproduce it, but if anyone else is able to do some digging on how I can reproduce the crash/stutter reliably, that would be really appreciated.