HOWTO: Audio Line out when using HDMI

Started by deskwizard, September 18, 2014, 10:52:36 PM

Previous topic - Next topic

deskwizard

Good afternoon everyone,
For developpement purposes, I am using an HDMI monitor which, when connected becomes the default audio device.

If like me you want to use the line out jack with an HDMI monitor connected, use this very simple line I figured out completely by accident:

setprop audio.routing 2

2 being Line out, 1024 being HDMI.

This will work until reboot/HDMI reconnection if disconnected.

I am working on a modified audio HAL that will check for a HDMI audio bypass property and output on the selected device accordingly that would work on reboots and HDMI connect/disconnect.

I'll keep you guys/gals posted.

DW



deskwizard

Thanks for the heads up man, wish I saw that lol

deskwizard

I noticed I forgot to specify I was using Android.

There is no such file under Android.
I will go back to my first idea, at least for my own project.

DW

deskwizard

Modified HAL @

http://pastebin.com/nrpFaPmb


Uses the property audio.hdmi_bypass to direct audio output to either HDMI monitor or Line out jack

Add to init.sun7i.rc:

setprop audio.hdmi_bypass 1

1 for bypass HDMI and output to line out
0 for HDMI audio

Default is 0, so no need to set the prop to 0 to use HDMI audio out by default.

Survives HDMI cable connection/deconnection.

DW