Page 1 of 1

Gstreamer with HDMI alsasink too quiet or distorted. KMS scaling issue

Posted: Thu Sep 26, 2019 2:54 pm
by electroteque
Hi, I am still trying to configure a correct command for playback. I was getting no audio until I installed the alsa gstreamer plugin. What is the correct audio sink to use for HDMI output that may work for both RP3 and RP4 ?

The KMS output displays over the boot text and console. But appears top and bottom. How do I make it scale ?

If I make a command like

gst-launch-1.0 playbin video-sink="kmssink" audio-sink="alsasink device=iec958:CARD=vc4hdmi,DEV=0" uri=rtmp://192.168.4.43/live/srt-livestream-720

I get audio but it's too soft. The device info won't work on RP4 I believe ?

Trying adding volume has no effect

gst-launch-1.0 playbin video-sink="kmssink" audio-sink="alsasink device=iec958:CARD=vc4hdmi,DEV=0" volume=10 uri=rtmp://192.168.4.43/live/srt-livestream-720

Doing this produces loud distorted audio

gst-launch-1.0 playbin video-sink="kmssink" audio-sink="alsasink" uri=rtmp://192.168.4.43/live/srt-livestream-720

I get output like this

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPlayBin:playbin0/GstPlaySink:playsink: No volume control found
Additional debug info:
gstplaysink.c(2903): gen_audio_chain (): /GstPlayBin:playbin0/GstPlaySink:playsink:
Volume/mute is not available


My device info is

cat /proc/asound/cards
0 [ALSA ]: bcm2835_alsa - bcm2835 ALSA
bcm2835 ALSA
1 [vc4hdmi ]: vc4-hdmi - vc4-hdmi
vc4-hdmi

cat /proc/asound/devices
0: [ 0] : control
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
32: [ 1] : control


33: : timer
48: [ 1- 0]: digital audio playback

Re: Gstreamer with HDMI alsasink too quiet or distorted. KMS scaling issue

Posted: Mon Sep 30, 2019 9:23 am
by electroteque
I tried pulesink with no device selected. And it produces the same distorted result as alsasink

Re: Gstreamer with HDMI alsasink too quiet or distorted. KMS scaling issue

Posted: Mon Sep 30, 2019 10:52 am
by electroteque
I've gone into alsamixer and I get a message when I change it to vc4-hdmi "This sound device does not have any controls."

Re: Gstreamer with HDMI alsasink too quiet or distorted. KMS scaling issue

Posted: Mon Sep 30, 2019 1:17 pm
by 6by9
vc4-hdmi is the audio side of the KMS driver. It expects to get IEC958 formatted data and nothing else. It has no processing within the block - it's pure pass through.
Alsa's dmix plugin can't apply volume controls to IEC958, therefore it won't show up in the audio mixer.

Discussion already at https://github.com/raspberrypi/linux/issues/2992, https://www.spinics.net/lists/alsa-devel/msg60478.html

Re: Gstreamer with HDMI alsasink too quiet or distorted. KMS scaling issue

Posted: Thu Oct 10, 2019 12:07 pm
by electroteque
I don't know what I am looking for in the discussions. If I don't choose this device I get distorted audio. But if I choose this device it's quiet and I have to set a volume on gstreamer to 10. Is this the correct device to choose ? It's the only way I can get proper output through HDMI at the moment.

alsasink device=iec958:CARD=vc4hdmi,DEV=0