cpu
Posts: 18
Joined: Sun Jun 10, 2012 6:47 pm

[Solved] No HDMI audio via extractor without display

Thu May 05, 2016 5:42 pm

Hello all,

In my application the raspi is an embedded device. It uses bluetooth to take an incoming audio stream, WiFi for the control connection, splits the audio stream, puts one stream to an analog amplifier and the second stream is used internally to drive some magnets.

Well, I first used the 3.5mm audio out headphone jack on the raspi to drive the amplifier, but the quality was very poor (as many noticed already). I read in the forums and found two alternatives:
a) a USB sound card
b) using an audio extractor to drive my amplifier (which needs an analog stereo input signal)

Since I already max out the USB interface with WiFi and Bluetooth I decided to use the HDMI output. I bought an HDMI audio extractor and cabled it all up. After a day of tinkering with it I go thus far:

* when I connect a computer monitor (without speakers) to the HDMI out of the extractor, connect the extractor to the raspi, configure alsa and pulse properly, tweak /boot/config.txt, THEN I get crystal clear, loud audio to the speakers. And my magnets are also properly driven.
* the moment I disconnect the monitor from the HDMI out of the extractor, the audio goes silent. It comes back, when I reconnect the monitor.

This is not good enough for me, as this should be embedded and run without a monitor. What do I have to do to make the raspi put audio out the HDMI even if there is no monitor, only the audio extractor, connected to its HDMI output?

Here is what I tried already:
* /boot/config.txt:
hdmi_drive=2
hdmi_force_hotplug=1
hdmi_edid_file=1

* I made a dump of the edit config while audio was working and saved it to /boot/edid.dat, hoping this working config would then be forced onto the raspi

* I changed the audio devices to HDMI in pulse, alsa, bluetooth

What can I do to make the raspi stream HDMI audio even if only the extractor is plugged into its HDMI port and no monitor is connected?

Thanks a lot
Helmut
Last edited by cpu on Sat May 14, 2016 6:24 am, edited 1 time in total.

cpu
Posts: 18
Joined: Sun Jun 10, 2012 6:47 pm

Re: No HDMI audio via extractor without display

Thu May 05, 2016 8:06 pm

In the meantime I tried hello_audio:

root@raspberrypi:/opt/vc/src/hello_pi/hello_audio# /opt/vc/src/hello_pi/hello_audio/hello_audio.bin 1
Outputting audio to hdmi
hello_audio.bin: audio.c:120: audioplay_create: Assertion `error == OMX_ErrorNone' failed.
Aborted

and got this error. Any ideas what to do?

Addendum: I get the same error when I try to use the analog output:

root@raspberrypi:/opt/vc/src/hello_pi/hello_audio# /opt/vc/src/hello_pi/hello_audio/hello_audio.bin 0
Outputting audio to analogue
hello_audio.bin: audio.c:120: audioplay_create: Assertion `error == OMX_ErrorNone' failed.
Aborted
Last edited by cpu on Fri May 06, 2016 7:31 am, edited 1 time in total.

cpu
Posts: 18
Joined: Sun Jun 10, 2012 6:47 pm

Re: No HDMI audio via extractor without display

Fri May 06, 2016 7:26 am

This are the HDMI data with the audio extractor connected, but no TV/monitor connected to the extractor's output:
root@raspberrypi:~# tvservice -n
device_name=ACR-S240HL
root@raspberrypi:~# tvservice -a
PCM supported: Max channels: 8, Max samplerate: 192kHz, Max samplesize 24 bits.
AC3 supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
MPEG1 supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
MP3 supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
MPEG2 supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
AAC supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
DTS supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
ATRAC supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
DSD supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
EAC3 supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
DTS_HD supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
MLP supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
DST supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
WMAPRO supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
Extended supported: Max channels: 8, Max samplerate: 192kHz, Max rate 2040 kb/s.
root@raspberrypi:~# tvservice -s
state 0x12000a [HDMI CEA (4) RGB lim 16:9], 1280x720 @ 60.00Hz, progressive
This are the config.txt settings that are active (in order -- does the order matter?):

Code: Select all

hdmi_force_hotplug=1
hdmi_drive=2
hdmi_edid_file=1
hdmi_force_edid_audio=1
hdmi_group=1
hdmi_mode=4
hdmi_ignore_cec_init=1
hdmi_ignore_cec=1
gpu_mem=16
max_usb_current=1
There is no HDMI sound and the hello_audio gives the previously reported error.
What to do?

cpu
Posts: 18
Joined: Sun Jun 10, 2012 6:47 pm

Re: No HDMI audio via extractor without display

Fri May 06, 2016 8:01 am

OK, I got the error with hello_audio fixed:

One has to give more memory to the GPU:
gpu_mem=128
in config.txt

Now hello_audio no longer gives an error, but still no sound from the hdmi output (via the audio extractor).

cpu
Posts: 18
Joined: Sun Jun 10, 2012 6:47 pm

Re: SOLUTION: No HDMI audio via extractor without display

Sat May 14, 2016 6:20 am

Problem solved!

It was the HDMI Extractor which did not work, not the Raspie.
On HDMI there is a "Hot Plug Detect" line, which needs to be pulled to +5V with 1kOhm to detect the presence of a device. I cut the HDMI plug off a cheap HDMI cable (1€, incl. shipping!) http://www.ebay.de/itm/131513208275 (since I could not find an HDMI plug to buy separately) and connected the orange line (+5V, pin 18) via 1kOhm to the white HotPlugDetect line (pin 19), see here: http://s.hswstatic.com/gif/hdmi-connector-diagram.gif, plugged this dummy plug into the HDMI-out of the extractor, eh voila, the presence detect LED on the extractor lit up and it gave beautiful sound from the Raspie!

In summary: the Raspie probably always output its HDMI sound, but the extractor needs to detect a presence to be enabled.

Return to “General discussion”