没有声音安卓x86

问题描述 投票:0回答:1

我目前已在我的 HP Pavilion dv2617us 笔记本电脑上安装了 Android x86。根本没有声音,但静音按钮时常会从蓝色变成红色,反之亦然(基本上是静音和取消静音)。发生这种情况时,扬声器会发出爆裂声,这非常烦人。如果我尝试使用按钮增加声音,它会导致我当前所在的应用程序崩溃。

这是驱动程序问题吗?我已经执行了以下命令。

root@x86 # alsa_ctl init
Found Hardware: "HDA-Intel" "Conexant CX . . . .
Hardware is initialized using a generic method

它检测到声卡,这是朝着正确方向迈出的一步。

我也尝试过将

alsa_amixer set PCM 100 unmute
添加到
init.sh
中,但没有成功。我已经没有主意了。

有人有建议吗?

注意:在物理计算机上,不是在 Virtualbox 中。

android alsa android-x86
1个回答
0
投票

这为我解决了问题https://hernaaan.wordpress.com/2018/02/08/how-to-fix-hdmi-audio-in-android-x86-if-it-doesnt-work-out-of -盒子/

How to fix HDMI audio in Android-x86 if it doesn’t work out of the box
 hernaaan  General  08/02/2018 2 minutos
Okay. I’m writing this mini tutorial after several hours of reading and trying different things. I hope it works for you too.

Let’s say you have a laptop and boot Android-x86 from there. Maybe from HDD or maybe from USB, I think it doesn’t matter. And you connect your TV to it. You modify Grub to set HDMI-only output (‘video=LVDS-1:d’ did for me), and you get video.

If you then notice you have no sound at all, try this. Oh, and beforehand, have a short WAV file stored in the system.

1) Open a terminal (from Android menu) and ask for root access with ‘su’.

2) Check what number your HDMI card is:
# cat /proc/asound/cards

Generally, «0» is onboard audio and «1» is HDMI.

3) Check which devices are associated to your HDMI card:
# ls -l /dev/snd/

Here you have you take note of all the pcmC*D*p values, where C* is the number of the card from step 2.

4) Activate sound for the card with the following commands:
# alsa_amixer -c1 set 'IEC958',0 on
# alsa_amixer -c1 set 'IEC958',1 on
# alsa_amixer -c1 set 'IEC958',2 on
# alsa_amixer -c1 set 'IEC958',3 on

Anuncio publicitario

In this example, I’m using card «1» (check step 2 for yours).

5) Then, testing. To check which is the correct device you’ll need the WAV file mentioned before:
# alsa_aplay -Dplughw:1,3 /storage/path_to_file/sample.wav
# alsa_aplay -Dplughw:1,7 /storage/path_to_file/sample.wav
# alsa_aplay -Dplughw:1,8 /storage/path_to_file/sample.wav
# alsa_aplay -Dplughw:1,9 /storage/path_to_file/sample.wav

In this example, I checked devices «3», «7», «8» and «9» from card «1» (check step 2 for your card, and step 3 for its devices). You’ll hear sound in the right one.

6) When you get the correct device, proceed to edit the boot script to make the changes permanent:
# vi /system/etc/init.sh

Add these lines in the «function init_hal_audio()» section, right below «esac»:
alsa_amixer -c1 set 'IEC958',0 on
alsa_amixer -c1 set 'IEC958',1 on
alsa_amixer -c1 set 'IEC958',2 on
alsa_amixer -c1 set 'IEC958',3 on
mv /dev/snd/pcmC1D3p /dev/snd/pcmC1D3p.original
ln -sf /dev/snd/pcmC1D7p /dev/snd/pcmC1D3p

Where:
«c1» is your HDMI card (step 2),
«pcmC1D7p» is your audible device (step 5),
and «pcmC1D3p» is the FIRST one of the card (as seen in step 3).

This will allow you to keep the onboard sound if you choose to boot without HDMI video.

7) Reboot to check if you did everything okay.
© www.soinside.com 2019 - 2024. All rights reserved.