HDMI audio from chromium-mir-kiosk on Ubuntu Core on a Raspberry Pi

I’ve built a Raspberry Pi 2 with Ubuntu Core and installed chromium-mir-kiosk. This kiosk works fine and displays web pages exactly as it should. However, I don’t get audio when the page plays an mp3. In pulsemixer I only see one output, “built in analogue audio”; HDMI isn’t mentioned. How might I go about debugging this? I don’t know where the problem may lie; in chrome, in pulseaudio, in mir, in Ubuntu Core. There are lots of questions about this on the web but they all suggest adding an HDMI setting in /boot/config.txt, which doesn’t exist in Ubuntu Core. snap logs chromium-mir-kiosk does show

2019-10-06T19:28:05Z chromium-mir-kiosk.chromium-mir-kiosk[3351]: ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM plug:default
2019-10-06T19:28:05Z chromium-mir-kiosk.chromium-mir-kiosk[3351]: [3682:3703:1006/192805.506637:ERROR:alsa_util.cc(204)] PcmOpen: plug:default,No such file or directory

which might be relevant and might not.

i’m not sure it is easily possible to access the HDMI audio port without using the proprietary driver … i know HDMI audio works fine with my omxplayer-pi snap but this is shipping the vc4 driver libs inside and the app is linked against them, perhaps coyping the vc4-libs part from there and just shipping the libs works (but i doubt that)…

oh. If the answer is “Ubuntu Core on a Raspberry Pi doesn’t do HDMI audio” then that would certainly explain why it doesn’t work, but that’s a bit disappointing :slight_smile:
(I don’t know much about this stuff, so I don’t really know what vc4 is, but I would assume that those libraries would need to be in the chromium-mir-kiosk snap if they were to work at all? and that isn’t my snap.)

Well, I might be wrong, I haven’t used HDMI audio in any other context before on a pi…

I also missed the config.txt bit in your question, in UbuntuCore config.txt lives in /boot/uboot…

Also, do you have the pulseaudio snap installed and the kiosk snap connected to it…

and now it works! I edited /boot/uboot/config.txt and uncommented the line hdmi_drive=2 and now I have HDMI audio! Thank you!

It’s super stuttery, but that’s my problem to resolve by writing more efficient code, I suspect :slight_smile:

1 Like

one sidenote here … the chromium-mir-kiosk snap is rather unmaintained, for a web kiosk i’d rather recommend https://snapcraft.io/wpe-webkit-mir-kiosk

(or maintain your own chromium kiosk build, based on the old code)

yup. I didn’t use that because it doesn’t seem to have the gstreamer audio stuff compiled into it, and I need audio. But… it seems that full chromium playing audio might be a bit too heavy for my little Pi 2 anyway, so I’m installing wpe, and then I’ll play audio in some other process. Cheers!

wpe-webkit-mir-kiosk maintainer here :blush: I’m planning to add proper audio support, several gstreamer libraries are already in stage-packages. Do let me know what’s missing, not really my field of expertise. Also, the snapcraft.yaml needs the proper interface plugs for audio to work on Core. Merge requests appreciated!

1 Like

I don’t really know what’s missing, I’m afraid – how wpe-webkit works is not my field at all :slight_smile: What I want is for the HTML5 <audio> element to work with an mp3, so a fairly easy test is just to drop <audio src="whatever.mp3" controls></audio> into an html page being shown by the kiosk and try clicking the play button and see if you get sound… :slight_smile: