Reputation: 91
I connected my bluetooth headphone to my iMac and started listening to music, After starting Android emulator the sound quality became horrible. I am using macOs Mojave 10.14.6 and running Android 11.0 on the emulator.
Upvotes: 9
Views: 1598
Reputation: 191
Apart from adding
hw.audioInput=no
hw.audioOutput=no
to the config.ini, I had to set up an environment variable (and make it persist the mac reboots) with following commands:
# Define the plist path
PLIST_PATH="$HOME/Library/LaunchAgents/studio.emu.params.plist"
# Create the LaunchAgents directory if it doesn't exist
mkdir -p "$HOME/Library/LaunchAgents"
# Write the plist content using 'cat' and 'tee'
cat <<EOF | tee "$PLIST_PATH"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>studio.emu.params</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>setenv</string>
<string>studio.emu.params</string>
<string>-writable-system,-noaudio</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF
# Load the plist file into launchctl
launchctl load "$PLIST_PATH"
# Verify that the environment variable is set
launchctl getenv studio.emu.params
Upvotes: 0
Reputation: 4963
For me the sound was muffled as soon as I started up the android emulator.
This solution worked for me:
If you don't care about sound on your emulator, you can turn it off:
In the Virtual Device Manager, for the emulator in question, choose "show on disk"
Look for the file
config.ini
and open itAdd these 2 lines at the bottom of the file:
hw.audioInput=no
hw.audioOutput=no
- One of those lines is probably already in the list (with a yes), so make sure to remove it
Upvotes: 6
Reputation: 1072
Start the emulator, and then disconnect your headphone, then reconnect it again.
Upvotes: 12