Pulsesink + ac3 passtrough + need example pipeline

Hi All,

I am trying figure out ways to pass-though ac3 audio frames to tremblaysound audio receiver via gstreamer pipeline. using following command line (but no success)

GST_DEBUG=2 gst-launch-1.0 filesrc location=~/Downloads/unfold.eac3 ! ac3parse disable-passthrough=false ! pulsesink

but getting error

Can someone please guide me ,how to do it correctly?.Thanks in advance

Note - above command is tried on Ubuntu 22.04 and Rocky linux 8.5 , Audio device is connected via HDMI 1.4 .

command
GST_DEBUG=2 gst-launch-1.0 filesrc location=~/Downloads/ac3_6ch.ac3 ! ac3parse disable-passthrough=false ! pulsesink

error logs

Setting pipeline to PAUSED …
0:00:00.010882265 11005 0x5630f19b1e40 WARN basesrc gstbasesrc.c:3688:gst_base_src_start_complete: pad not activated yet
Pipeline is PREROLLING …
0:00:00.011336262 11005 0x5630f1a97d80 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<pulsesink0:sink> caps audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)6, alignment=(string)frame not accepted
0:00:00.011484672 11005 0x5630f1a97d80 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<pulsesink0:sink> caps audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)6, alignment=(string)frame not accepted
0:00:00.011791584 11005 0x5630f1a97d80 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<pulsesink0:sink> caps audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)6, alignment=(string)frame not accepted
0:00:00.012004241 11005 0x5630f1a97d80 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<pulsesink0:sink> caps audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)6, alignment=(string)frame not accepted
0:00:00.012015344 11005 0x5630f1a97d80 WARN baseparse gstbaseparse.c:3681:gst_base_parse_loop: error: Internal data stream error.
0:00:00.012018430 11005 0x5630f1a97d80 WARN baseparse gstbaseparse.c:3681:gst_base_parse_loop: error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstAc3Parse:ac3parse0: Internal data stream error.
Additional debug info:
…/libs/gst/base/gstbaseparse.c(3681): gst_base_parse_loop (): /GstPipeline:pipeline0/GstAc3Parse:ac3parse0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
0:00:00.012224707 11005 0x5630f1a97d80 WARN GST_CAPS gstpad.c:5757:pre_eventfunc_check:<pulsesink0:sink> caps audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)6, alignment=(string)frame not accepted
Freeing pipeline …

Did you ever get this working? I’m having a similar issue.

Have you configured the sink formats on the HDMI card? If you have pavucontrol, you can do this in the “Output Devices” tab, by opening “Advanced” section for the HDMI sink.

Yup I did configure them. I’m trying to get AC3 to passthrough to an LG C1 OLED TV that supports bitstreams. I’ve tried on both windows and ubuntu using two different notebooks both with integrated graphics, one from AMD the other from Intel. They all give the same error. “GST_CAPS gstpad.c:5757:pre_eventfunc_check:pulsesink0:sink caps audio/x-ac3, framed=(boolean)true, rate=(int)44100, channels=(int)2, alignment=(string)frame not accepted” I did confirm that VLC was able to use spdif to passthrough the bitstream successfully under windows, so I know it can work (at least I think it was working based on the VLC debug log files).

Could you post logs with GST_DEBUG=pulse*:5? Also the output of pactl info and pactl list sinks?

Thanks so much for taking the time to help me debug this.
It’s strange it’s giving a slightly different error today.
But I honestly can’t think I changed anything besides rebooting.
Anyways I’ve provided the logs. Also I had another friend test the ac3 file with POTPlayer and he confirmed it worked with his audio receiver in passthrough mode.

Are there any other streams running when you start this playback? pactl list sink-inputs will tell you. That might prevent us being able to set up a passthrough connection.

Hey @arun thanks so much you were spot on (sorry for my late reply I didn’t have time to test your suggestion until afew hours ago)!!! My web browser was also attempting to output which was stopping it from working.

I have one other follow up question for you. I was hoping to make my software cross platform to work for windows as well. It seems like the wasapisink doesn’t support x-dts or x-ac3 input.

Reading further documentation it seems like the only sink plugin that supports passthrough on winows in the deprecated directsoundsink plugin. I attempted to use that to output passthrough ac3 audio and the result was unsuccessful. It wouldn’t work with 44.1 khz, so I transcoded my test sample to 48khz, at which point I could get something to play, but it seemed like it was just playing noise on the TV with a pulsating beat frequency corresponding to to every time there was a log entry as follows.

0:00:00.319566900  4120    1b5524c0e30 DEBUG        directsoundsink gstdirectsoundsink.c:650:gst_directsound_sink_write:<directsoundsink0> length: 6144, FreeBufSiz: 0, sleep_time_ms: 32, bps: 4, rate: 48000

Do you have any idea if the windows directsoundsink passthrough works and/or worked in the past? Here’s the lot from my attempt to use directsoundsink where it output noise.

Glad it worked! The disable-passthrough on your ac3parse might be redundant, btw.

Apparently directsoundsink did support AC3, as well DTS, but I’m honestly not too familiar with that part of the code and it was last touched ~11 years ago.

Maybe @ylatuya who wrote that can weigh in. :slight_smile:

1 Like

No worries! I’m just glad to have it working in Linux with pulseaudio, once again huge thanks for your help! :slight_smile:

1 Like