How I Fixed My AirPlay Speaker Not Playing Apple Music From a Mac


Key Takeaways

  • An underlying problem with the “AirPlayXPCHelper” process seems to cause wireless speakers to stop responding on macOS.
  • The solution is to kill the process in Activity Monitor (under the CPU tab) or to use the “killall” command in Terminal to end the process using admin privileges.
  • Better still, create a workflow in the Shortcuts to run the shell command in two clicks and fix it quickly whenever it happens.



AirPlay is amazing when it works. I love streaming Apple Music to my HomePod and simultaneously using my MacBook Pro speakers for a fuller sound. Unfortunately, this feature breaks constantly.


What’s the Problem With AirPlay?

My problem rears its head when I’m using the Apple Music app, and it happens sometimes three or four times a day. A lot of the time it happens when I first log in, or when Apple Music has been dormant for a while.

After clicking the “AirPlay” icon at the top of the app window and checking “HomePod” to stream audio to the speaker on the other side of the room, Apple Music will do nothing and then throw an error that looks like this at me:

An AirPlay speaker error in Apple Music on a Mac.


Checking and unchecking the speaker doesn’t help. Quitting Apple Music won’t fix it either. The problem runs deeper, and is caused by an underlying issue with AirPlay.

Despite these very specific circumstances, the problem could also be affecting other apps that use AirPlay including Spotify or
Rogue Amoeba’s Airfoil
.

How to Fix Unresponsive AirPlay Speakers

After a few months of fiddling in Activity Monitor, I discovered the issue was down to a process called “AirPlayXPCHelper” that seems to go rogue. The easy fix is to kill this process, after which it will immediately restart. Wait a few seconds to ensure the process is running smoothly, and then try and engage the AirPlay speaker again.

You can use two methods to do this, depending on what you’re comfortable with. The first is to use Activity Monitor, which you can launch by hitting Command+Spacebar to bring up Spotlight search and then typing “Activity Monitor” until you see the icon then hitting Return.


On the “CPU” tab use the search box to search for “airplay” and then click the AirPlayXPCHelper process when it appears. Now use the “X” to kill the process, and confirm the action.

Quitting the AirPlayXPCHelper process in Activity Monitor on macOS.

Alternatively, you can kill the process using the Terminal. Launch the Terminal app (use Spotlight again), then type:

sudo killall AirPlayXPCHelper

Enter your password when prompted and the process will quit, then relaunch in the background.

Apple Music streaming to HomePod and MacBook Pro speakers at the same time.


The good news is that this fix works, every single time. At least, it works until the next time AirPlayXPCHelper decides to play up again. Fortunately, there’s a quicker way to restart the process.

Create a Two-Click Fix Using Shortcuts

Since this happens multiple times per day. I got sick of combing through processes and typing commands into Terminal so I made a workflow that I can run from the Mac menu bar instead. Download my Kill AirPlayXPCHelper workflow and add it to Shortcuts.

The Kill AirPlayXPCHelper shortcut laid bare.

The shortcut itself is really simple, and you can make it yourself using the Terminal command above. First, open the Shortcuts app then click Shortcuts > Settings > Advanced and enable the “Allow Running Scripts” option. Next, click the “+” plus icon at the top of the page.


In the sidebar on the right of the screen search for “shell” and double-click the “Run Shell Script” action to add it. Now check the “Run as Administrator” box and paste the following into the text field:

killall AirPlayXPCHelper

Clear your search query (if it’s still up) and click on the “i” information button, then under the “Privacy” tab make sure that “Shell” access is granted. Under “Details” check the “Pin in Menu Bar” option. Give the shortcut a name and icon at the top of the screen.

Now look for the Shortcuts icon in your menu bar at the top of the screen. Click it and select the workflow you just created to run the Terminal command.

Launching a workflow from the Shortcuts menu bar item.



Hopefully Apple will fix whatever issue plagues AirPlayXPCHelper so that this guide will be obsolete before long. But in case they don’t, or you have other problems with AirPlay speakers, at least you can turn the process off and on again quickly

Check out our more interesting Shortcuts workflows for macOS.



Source link