Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MatthewCawley

macrumors newbie
May 23, 2016
2
0
Same problem! (retina mbp + ATV3).

Killing coreaudio fixed it for me without a reboot:
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`

Worked perfect, thanks :)
[doublepost=1463996528][/doublepost]
Thanks, -rhys-. Created an account just to thank you, only your solution worked for me! Thanks again!
I created an account just to thank him too :D
 

zpro

macrumors newbie
May 19, 2016
10
0
For someone interested in a small automation of this workaround, I have written a small apple script that toggles between internal speakers and Airplay - taking into account that from time-to-time it is not possible to switch because of the Apple Bug. In this case, the script asks for the Admin password and restarts core audio before continuing.

It is mainly based on the small C program to toggle airplay found here :
http://whoshacks.blogspot.de/2009/01/change-audio-devices-via-shell-script.html

And a proposal applescript that implements it:
http://www.macuser.de/forum/f30/applescript-um-airplay-672797/

Just copy the C programme into the user folder, paste the code below into the AppleScript Editor and save it there as a program.

Code:
property audiodeviceOutputExecutable : "~/audiodevice output "
property internalAudioDevices : "Internal Speakers"
property airplayDevice : "Airplay"
property kill_audio : "pkill coreaudio"


set currentDevice to do shell script audiodeviceOutputExecutable
if currentDevice is airplayDevice then
    do shell script audiodeviceOutputExecutable & quoted form of internalAudioDevices
   
    set currentDevice to do shell script audiodeviceOutputExecutable
    if currentDevice is airplayDevice then
        do shell script kill_audio with administrator privileges
        do shell script audiodeviceOutputExecutable & quoted form of internalAudioDevices
    end if
else
    do shell script audiodeviceOutputExecutable & quoted form of airplayDevice
    set currentDevice to do shell script audiodeviceOutputExecutable
    if currentDevice is internalAudioDevices then
        do shell script kill_audio with administrator privileges
        do shell script audiodeviceOutputExecutable & quoted form of airplayDevice
    end if
   
end if

For me this is working fine and it is much quicker to change to airplay via the dock.

Fantastic solution.

Thank you.
 

gctwnl

macrumors regular
Jan 4, 2005
219
139
The Netherlands
For someone interested in a small automation of this workaround, I have written a small apple script that toggles between internal speakers and Airplay - taking into account that from time-to-time it is not possible to switch because of the Apple Bug. In this case, the script asks for the Admin password and restarts core audio before continuing.

It is mainly based on the small C program to toggle airplay found here :
http://whoshacks.blogspot.de/2009/01/change-audio-devices-via-shell-script.html

And a proposal applescript that implements it:
http://www.macuser.de/forum/f30/applescript-um-airplay-672797/

Just copy the C programme into the user folder, paste the code below into the AppleScript Editor and save it there as a program.

Code:
property audiodeviceOutputExecutable : "~/audiodevice output "
property internalAudioDevices : "Internal Speakers"
property airplayDevice : "Airplay"
property kill_audio : "pkill coreaudio"


set currentDevice to do shell script audiodeviceOutputExecutable
if currentDevice is airplayDevice then
    do shell script audiodeviceOutputExecutable & quoted form of internalAudioDevices
   
    set currentDevice to do shell script audiodeviceOutputExecutable
    if currentDevice is airplayDevice then
        do shell script kill_audio with administrator privileges
        do shell script audiodeviceOutputExecutable & quoted form of internalAudioDevices
    end if
else
    do shell script audiodeviceOutputExecutable & quoted form of airplayDevice
    set currentDevice to do shell script audiodeviceOutputExecutable
    if currentDevice is internalAudioDevices then
        do shell script kill_audio with administrator privileges
        do shell script audiodeviceOutputExecutable & quoted form of airplayDevice
    end if
   
end if

For me this is working fine and it is much quicker to change to airplay via the dock.
Whatever this is, it's not a C program. AppleScript maybe?
 

Many Bugs

macrumors newbie
Nov 17, 2019
1
0
Whoa, 2019 and this "Cannot select Airplay" bug / problem still lingers.

Two Macbooks, one iphone and one iPAD were all stuck.

Airplay is in use (Mac), and, Someone else is using Airplay (iphone)

My solution was completely different than the ones above: I had to reset my router.

Sign...it took me many, many hours to resolve... ;-(
 

Ahmet Can

macrumors newbie
May 6, 2020
1
0
Hi,
I have same problem. But just in iTunes player airplay working normal.
On sound preferences and in audio midi setup, i can't select my airplay output device!!
somebody can help?
yesterday everything was normal?
I tried all that was written in the previous messages

MacOS Mojave 2015 macbook pro 15''
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.