ExistentialAudio / BlackHole

BlackHole is a modern macOS audio loopback driver that allows applications to pass audio to other applications with zero additional latency.
GNU General Public License v3.0
14.63k stars 566 forks source link

Can't update #779

Open mbierman opened 3 months ago

mbierman commented 3 months ago

Please Confirm

macOS Version

macOS 13 Ventura

BlackHole Build(s) Affected

Describe the bug

macOS 14.4.1 (23E224) Updating with homebrew is failing

Reproduction Steps

brew update brew outdated brew upgrade --greedy brew cleanup

Expected Behavior

Update using homebrew should work

Screenshots

==> Upgrading blackhole-2ch
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/ef939c438c5519c1dc533f8384691106bc2262d9/Casks/b/blackhole-2ch.rb
Already downloaded: /Users/michael/Library/Caches/Homebrew/downloads/abaf20d208584f623d2627beaa5ae3045b883ebc804c27d35b9bc886a3c6dedd--blackhole-2ch.rb
==> Downloading https://existential.audio/downloads/BlackHole2ch-0.6.0.pkg
Already downloaded: /Users/michael/Library/Caches/Homebrew/downloads/094ac75837aa76e51e9defa1f6623144c5a3b223a1b426cf5ddb42c224e70c4a--BlackHole2ch-0.6.0.pkg
==> Uninstalling packages with sudo; the password may be necessary:
Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted
==> Purging files for version 0.6.0 of Cask blackhole-2ch
Error: blackhole-2ch: Failure while executing; `/usr/bin/sudo -E -- /bin/launchctl kickstart -kp system/com.apple.audio.coreaudiod` exited with 1. Here's the output:
Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted
BetterB0y commented 3 months ago

Uninstall is not working too.

devinroth commented 3 months ago

Kickstart no longer works. We updated this. I suggest opening an issue with home-brew since I think it’s related to older versions using that command.

Devin On Apr 16, 2024 at 12:02 AM -0700, Daniel Pakosz @.***>, wrote:

Uninstall is not working too. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

BetterB0y commented 3 months ago

Okey, I will try contact brew. Still you've got readme to update. There are still kickstart commands.

devinroth commented 3 months ago

Thanks for the reminder. Feel free to @ me on the homebrew issue.

Devin On Apr 16, 2024 at 12:25 AM -0700, Daniel Pakosz @.***>, wrote:

Okey, I will try contact brew. Still you've got readme to update. There are still kickstart commands. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mbierman commented 3 months ago

@devinroth @BetterB0y Sorry you lost me a bit. I don't see anything in the readme about updating. Do I have to uninstall and reinstall? it would be great if homebrew was fixed. I really prefer using that to handle this stuff when possible.

BetterB0y commented 3 months ago

@mbierman Command is still in readme. It's not resolving anything about this issue.

gnattu commented 3 months ago

I found a way to workaround this:

You go to the Caskroom for the cask, on Apple Silicon macs, it is here:

/opt/homebrew/Caskroom/blackhole-2ch/.metadata/0.5.0/

On Intel Macs, it is here:

/usr/local/Caskroom/blackhole-2ch/.metadata/0.5.0/

And you will see a folder with a date, cd into it, you will see the blackhole-2ch.rb

Edit it that file, change

system_command "/bin/launchctl",
                   args:         [
                     "kickstart",
                     "-kp",
                     "system/com.apple.audio.coreaudiod",
                   ],
                   sudo:         true,
                   must_succeed: true

to

system_command "/usr/bin/killall",
                   args:         ["coreaudiod"],
                   sudo:         true,
                   must_succeed: true

Then save the file, and then uninstall should success.

BetterB0y commented 3 months ago

@gnattu it worked for blackhole-2ch. What about blackhole-16ch? Is it okey to just delete blackhole-16ch dir from Caskroom?

gnattu commented 3 months ago

@gnattu it worked for blackhole-2ch. What about blackhole-16ch? Is it okey to just delete blackhole-16ch dir from Caskroom?

No, you do the same for the blackhole-16ch.rb to replace the system_command

BetterB0y commented 3 months ago

There is .pkg file only there. No .rb file

gnattu commented 3 months ago

The .metadata folder is a hidden and you cannot navigate into it using finder directly. You replace the path and cd into it directly.

BetterB0y commented 3 months ago

Thanks. It worked. I used cd but something weird happened and i wasn't in .metadata dir.

rubincc commented 3 months ago

Thanks @devinroth and @gnattu. After brew remove (following your suggestion) I did a brew install and now everything works.

WolfLink commented 3 months ago

To be it clear, you can run "brew upgrade" after editing blackhole-2ch.rb to successfully upgrade to the latest version (which should then upgrade fine in the future).

bevanjkay commented 3 months ago

A potentially easier solution, that makes it less likely to leave the cask file in an unreadable state is to remove the file from the Caskroom and then reinstall it.

This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.

Silicon Mac rm -rfi /opt/homebrew/Caskroom/blackhole-2ch/

Intel Mac rm -rfi /usr/local/Caskroom/blackhole-2ch/

Then reinstall brew reinstall blackhole-2ch

booi commented 2 months ago

A potentially easier solution, that makes it less likely to leave the cask file in an unreadable state is to remove the file from the Caskroom and then reinstall it.

This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.

Silicon Mac rm -rfi /opt/homebrew/Caskroom/blackhole-2ch/

Intel Mac rm -rfi /usr/local/Caskroom/blackhole-2ch/

Then reinstall brew reinstall blackhole-2ch

This oddly didn't work for me as it just downloaded 0.5.0 to run uninstall first which failed. The previous fix of patching the .rb file did work though.

rodrigopait commented 2 months ago

That's the solution at list with 2ch:

Known Issues To improve security and stability, using launchctl kickstart -k is no longer permitted for critical system processes. If a process must be forcefully terminated, it is recommended to use kill instead. (123028502)

https://developer.apple.com/documentation/macos-release-notes/macos-14_4-release-notes#Core-Audio

If remove the -k parameter works fine.

booi commented 2 months ago

If remove the -k parameter works fine.

I don't think that's right. What we need is for coreaudiod to restart which we were doing with launchctl kickstart -k. Merely removing the -k will mean it won't restart coreaudiod.

I think the correct solution is here: https://github.com/ExistentialAudio/BlackHole/issues/779#issuecomment-2058581435 . Since coreaudiod is considered a core service, it will restart if killed.

HaigNalbandian commented 1 month ago

This is not just a homebrew issue, the 2ch uninstaller .pkg in the README fails, and so do the commands provided in that same README

I had originally installed via the 2ch installer .pkg provided through the existential.audio site

devinroth commented 1 month ago

It’s a combination. It depends on which command you use.

To manually uninstall remove BlackHole from Hal and then restart. If that doesn’t work make sure you uninstall Rogue Amoeba’s apps since they mess with CoreAudio.

Devin On Jun 13, 2024 at 10:53 AM -0700, Haig Nalbandian @.***>, wrote:

This is not just a homebrew issue, the 2ch uninstaller .pkg in the README fails, and so do the commands provided in that same README I had originally installed via the 2ch installer .pkg provided through the existential.audio site — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>