[Phoenix OS News, Q&A & Development] ermockler:
Here's how to fix audio over HDMI...

I am running Phoenix OS in a Virtual Machine, it's on an Asrock H77M mini-itx, 16 GB ram, with an Nvidia 750ti and 2 usb controllers passed through via VFIO.

So it's basically an intel 440BX MB with the Nvidia 750ti. I had no audio in either Remix or Phoenix. Fixed it first in Remix, just because root seemed easier at the time.

Under /dev/snd I have:

controlC0

hwC0D0

pcmC0D3p <----alsa trying to use this one

pcmC0D7p

pcmC0D8p <-----this is the one I want

pcmC0D9p

timer

1|x86_64:/ # alsa_aplay -l

**** List of PLAYBACK Hardware Devices ****

card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]

Subdevices: 1/1

Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]

Subdevices: 1/1

Subdevice #0: subdevice #0

Alsa is trying to use pcmC0D3p, which is incorrect

My corrected IEC958 levels are below, all these were off prior to the fix:

127|x86_64:/ # alsa_amixer

Simple mixer control 'IEC958',0

Capabilities: pswitch pswitch-joined penum

Playback channels: Mono

Mono: Playback [on]

Simple mixer control 'IEC958',1

Capabilities: pswitch pswitch-joined penum

Playback channels: Mono

Mono: Playback [on]

Simple mixer control 'IEC958',2

Capabilities: pswitch pswitch-joined penum

Playback channels: Mono

Mono: Playback [on]

Simple mixer control 'IEC958',3

Capabilities: pswitch pswitch-joined penum

Playback channels: Mono

Mono: Playback [on]

You may or may not have the same issue as I had. So you need to try all the pcm"s until you find the right one.

Go into /dev/snd and move the pcmC0D3p to pcmC0D3p.OLD (you probably need root for this)

mv /dev/snd/pcmC0D3p /dev/snd/pcmC0D3p.OLD

Then link one of them to pcmC0D3p:

ln -sf pcmC0D8p /dev/snd/pcmC0D3p

Restart zygote

stop; start

set all the IEC958 to on:

alsa_amixer -c 0 set IEC958 100 unmute

alsa_amixer -c 0 set IEC958,1 100 unmute

alsa_amixer -c 0 set IEC958,2 100 unmute

alsa_amixer -c 0 set IEC958,3 100 unmute

Then play something using alsa_aplay, or try youtube. If you picked the right pcm then you will hear audio. If not, reboot and repeat the above by linking the next pcm --> pcmC0D3p. repeat until you find your correct pcm.

Once you ID your pcm you can make it permanent (switching HDMI outs on your card may break this). You def need root for this, edit /system/etc/init.sh at the alsa section:

esac

mv /dev/snd/pcmC0D3p /dev/snd/pcmC0D3p.OLD

ln -sf pcmC0D8p /dev/snd/pcmC0D3p

# [ -d /proc/asound/card0 ] || modprobe snd-dummy

for c in $(grep '\[.*\]' /proc/asound/cards | awk '{print $1}'); do

f=/system/etc/alsa/$(cat /proc/asound/card$c/id).state

if [ -e $f ]; then

alsa_ctl -f $f restore $c

alsa_amixer -c $c set Speaker 65%

else

alsa_ctl init $c

alsa_amixer -c $c set Master on

alsa_amixer -c $c set Master 100%

alsa_amixer -c $c set Headphone on

alsa_amixer -c $c set Headphone 100%

alsa_amixer -c $c set Speaker 100%

alsa_amixer -c $c set Capture 100%

alsa_amixer -c $c set Capture cap

alsa_amixer -c $c set PCM 100 unmute

alsa_amixer -c $c set SPO unmute

alsa_amixer -c $c set 'Mic Boost' 3

alsa_amixer -c $c set 'Internal Mic Boost' 3

alsa_amixer -c 0 set IEC958 100 unmute

alsa_amixer -c 0 set IEC958,1 100 unmute

alsa_amixer -c 0 set IEC958,2 100 unmute

alsa_amixer -c 0 set IEC958,3 100 unmute

fi