简体   繁体   English

Android模拟器在ubuntu中没有声音

[英]Android emulator no sound in ubuntu

I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,我在 ubuntu-19.10 中运行 android 模拟器,我尝试了以下解决方案但没有结果,

Link-1 链接 1

Link-2 链接 2

Link-3 链接 3

Error,错误,

1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

Some notes on solution I tried,关于我尝试过的解决方案的一些说明,

When trying Link-1 i don't see "Qemu-system" in settings.尝试Link-1 时,我在设置中看不到“Qemu-system”。 Also created many different versions of AVDs but does seem to work.还创建了许多不同版本的 AVD,但似乎确实有效。

After trying Link-2 pulseaudio -D command errors out.尝试Link-2 pulseaudio -D命令后出错。

I have also tried Link-3 which looks like widely suggested solution in multiple blog posts.我也尝试过Link-3 ,它看起来像是多篇博文中广泛推荐的解决方案。 But still I find the same error on emulator startup.但我仍然在模拟器启动时发现同样的错误。 I would like to note that I am not smart enough understand this solution.我想指出的是,我不够聪明,无法理解此解决方案。

Thanks in advance for helping out.提前感谢您的帮助。

I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,我在ubuntu-19.10中运行android模拟器,并且尝试了以下没有结果的解决方案,

Link-1 链接1

Link-2 链接2

Link-3 链接3

Error,错误,

1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

Some notes on solution I tried,关于我尝试过的解决方案的一些说明,

When trying Link-1 i don't see "Qemu-system" in settings.尝试Link-1时,我在设置中看不到“ Qemu系统”。 Also created many different versions of AVDs but does seem to work.还创建了许多不同版本的AVD,但似乎可以正常工作。

After trying Link-2 pulseaudio -D command errors out.尝试Link-2 pulseaudio -D命令错误后。

I have also tried Link-3 which looks like widely suggested solution in multiple blog posts.我还尝试了Link-3 ,它看起来像是多个博客文章中广泛建议的解决方案。 But still I find the same error on emulator startup.但是我在模拟器启动时仍然发现相同的错误。 I would like to note that I am not smart enough understand this solution.我想指出的是,我对这个解决方案还不够聪明。

Thanks in advance for helping out.在此先感谢您的帮助。

I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,我在ubuntu-19.10中运行android模拟器,并且尝试了以下没有结果的解决方案,

Link-1 链接1

Link-2 链接2

Link-3 链接3

Error,错误,

1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

Some notes on solution I tried,关于我尝试过的解决方案的一些说明,

When trying Link-1 i don't see "Qemu-system" in settings.尝试Link-1时,我在设置中看不到“ Qemu系统”。 Also created many different versions of AVDs but does seem to work.还创建了许多不同版本的AVD,但似乎可以正常工作。

After trying Link-2 pulseaudio -D command errors out.尝试Link-2 pulseaudio -D命令错误后。

I have also tried Link-3 which looks like widely suggested solution in multiple blog posts.我还尝试了Link-3 ,它看起来像是多个博客文章中广泛建议的解决方案。 But still I find the same error on emulator startup.但是我在模拟器启动时仍然发现相同的错误。 I would like to note that I am not smart enough understand this solution.我想指出的是,我对这个解决方案还不够聪明。

Thanks in advance for helping out.在此先感谢您的帮助。

I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,我在ubuntu-19.10中运行android模拟器,并且尝试了以下没有结果的解决方案,

Link-1 链接1

Link-2 链接2

Link-3 链接3

Error,错误,

1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

Some notes on solution I tried,关于我尝试过的解决方案的一些说明,

When trying Link-1 i don't see "Qemu-system" in settings.尝试Link-1时,我在设置中看不到“ Qemu系统”。 Also created many different versions of AVDs but does seem to work.还创建了许多不同版本的AVD,但似乎可以正常工作。

After trying Link-2 pulseaudio -D command errors out.尝试Link-2 pulseaudio -D命令错误后。

I have also tried Link-3 which looks like widely suggested solution in multiple blog posts.我还尝试了Link-3 ,它看起来像是多个博客文章中广泛建议的解决方案。 But still I find the same error on emulator startup.但是我在模拟器启动时仍然发现相同的错误。 I would like to note that I am not smart enough understand this solution.我想指出的是,我对这个解决方案还不够聪明。

Thanks in advance for helping out.在此先感谢您的帮助。

On Ubuntu, is possible open the emulator with terminal and change the sound in System Preferences.在 Ubuntu 上,可以使用终端打开模拟器并在系统偏好设置中更改声音。 Works with the instant version of Android Studio.适用于 Android Studio 的免安装版本。 It works with the snap version of Android Studio.它适用于 Android Studio 的 snap 版本。

First is needed to add the emulator command to the PATH .首先需要将emulator命令添加到PATH

This can be done by editing .bashrc or .zshrc .这可以通过编辑.bashrc.zshrc来完成。 Preferably these lines should be placed at the end of the file.最好将这些行放在文件的末尾。

export ANDROID_SDK_PATH=$HOME/Android/Sdk
export ANDROID_NDK_PATH=$HOME/Android/Sdk/ndk
export PATH="$PATH:$HOME/Android/Sdk/platform-tools"
export PATH="$PATH:$HOME/Android/Sdk/emulator"

The PATH variable needs to be reloaded. PATH 变量需要重新加载。 This can be done manually, as shown below, or simply by opening another terminal:这可以手动完成,如下所示,或者只需打开另一个终端:

source ~/.bashrc
# OR
source ~/.zshrc

Another way is to add adb and android-sdk-platform-tools-common packages to have the emulator command available.另一种方法是添加adbandroid-sdk-platform-tools-common包以使emulator命令可用。 Package names may vary depending on the Ubuntu version.软件包名称可能因 Ubuntu 版本而异。

After that, the emulator command can be used to list available emulators:之后,可以使用emulator命令列出可用的模拟器:

emulator -list-avds

Example of output:输出示例:

Pixel_4_API_30
Pixel_C_API_30

Then can be opened one of the available emulators:然后可以打开可用的模拟器之一:

emulator @Pixel_4_API_30

Finally, the emulator probably will appear at the System Preferences:最后,模拟器可能会出现在系统偏好设置中:

Ubuntu 上的声音设置

I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,我在ubuntu-19.10中运行android模拟器,并且尝试了以下没有结果的解决方案,

Link-1 链接1

Link-2 链接2

Link-3 链接3

Error,错误,

1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

Some notes on solution I tried,关于我尝试过的解决方案的一些说明,

When trying Link-1 i don't see "Qemu-system" in settings.尝试Link-1时,我在设置中看不到“ Qemu系统”。 Also created many different versions of AVDs but does seem to work.还创建了许多不同版本的AVD,但似乎可以正常工作。

After trying Link-2 pulseaudio -D command errors out.尝试Link-2 pulseaudio -D命令错误后。

I have also tried Link-3 which looks like widely suggested solution in multiple blog posts.我还尝试了Link-3 ,它看起来像是多个博客文章中广泛建议的解决方案。 But still I find the same error on emulator startup.但是我在模拟器启动时仍然发现相同的错误。 I would like to note that I am not smart enough understand this solution.我想指出的是,我对这个解决方案还不够聪明。

Thanks in advance for helping out.在此先感谢您的帮助。

This one worked for me:这个对我有用:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386须藤 apt-get 安装 libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

I am running android emulator in ubuntu-19.10 and I have attempted following solutions with no results,我在ubuntu-19.10中运行android模拟器,并且尝试了以下没有结果的解决方案,

Link-1 链接1

Link-2 链接2

Link-3 链接3

Error,错误,

1:10 PM Emulator: pulseaudio: pa_context_connect() failed
1:10 PM Emulator: pulseaudio: Reason: Connection refused
1:10 PM Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver

Some notes on solution I tried,关于我尝试过的解决方案的一些说明,

When trying Link-1 i don't see "Qemu-system" in settings.尝试Link-1时,我在设置中看不到“ Qemu系统”。 Also created many different versions of AVDs but does seem to work.还创建了许多不同版本的AVD,但似乎可以正常工作。

After trying Link-2 pulseaudio -D command errors out.尝试Link-2 pulseaudio -D命令错误后。

I have also tried Link-3 which looks like widely suggested solution in multiple blog posts.我还尝试了Link-3 ,它看起来像是多个博客文章中广泛建议的解决方案。 But still I find the same error on emulator startup.但是我在模拟器启动时仍然发现相同的错误。 I would like to note that I am not smart enough understand this solution.我想指出的是,我对这个解决方案还不够聪明。

Thanks in advance for helping out.在此先感谢您的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM