BlackHole icon indicating copy to clipboard operation
BlackHole copied to clipboard

Can't update

Open mbierman opened this issue 10 months ago • 20 comments

Please Confirm

  • [X] I have read the FAQ and Wiki where most common issues can be resolved
  • [X] I have searched Discussions to see if the same question has already been asked
  • [X] This is a bug and not a question about audio routing or configuration, which should be posted in Discussions

macOS Version

macOS 13 Ventura

BlackHole Build(s) Affected

  • [x] 2 channel
  • [ ] 16 channel
  • [ ] 64 channel
  • [ ] other/custom build

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

mbierman avatar Apr 16 '24 06:04 mbierman

Uninstall is not working too.

BetterB0y avatar Apr 16 '24 07:04 BetterB0y

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: @.***>

devinroth avatar Apr 16 '24 07:04 devinroth

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

BetterB0y avatar Apr 16 '24 07:04 BetterB0y

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: @.***>

devinroth avatar Apr 16 '24 07:04 devinroth

@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.

mbierman avatar Apr 16 '24 07:04 mbierman

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

BetterB0y avatar Apr 16 '24 07:04 BetterB0y

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.

gnattu avatar Apr 16 '24 08:04 gnattu

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

BetterB0y avatar Apr 16 '24 09:04 BetterB0y

@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

gnattu avatar Apr 16 '24 09:04 gnattu

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

BetterB0y avatar Apr 16 '24 09:04 BetterB0y

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

gnattu avatar Apr 16 '24 09:04 gnattu

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

BetterB0y avatar Apr 16 '24 09:04 BetterB0y

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

rubincc avatar Apr 16 '24 12:04 rubincc

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).

WolfLink avatar Apr 26 '24 00:04 WolfLink

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

bevanjkay avatar Apr 26 '24 07:04 bevanjkay

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.

booi avatar May 01 '24 18:05 booi

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.

rodrigopait avatar May 02 '24 23:05 rodrigopait

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.

booi avatar May 03 '24 17:05 booi

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

HaigNalbandian avatar Jun 13 '24 17:06 HaigNalbandian

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: @.***>

devinroth avatar Jun 13 '24 19:06 devinroth