Having trouble streaming audio through gstreamer

I am using raspberry pi 3b+.

I am trying to stream audio with help of gstreamer through UDP and then receive it on my android device. It works fine on dietpi (audio lag is just about 300ms and barely noticable) but when I try to recreate the same on OSMC it just doesn’t work.

If I choose alsasrc as the source then it says “open error on device default: No such file or a directory”. I have already created the same /etc/asound.conf as dietpi. And when I use pulsesrc, I hear no sound. Both of these options work fine on dietpi which is also based on Raspbian.

If audiotestsrc is used as source then it does stream, so problem clearly isn’t that gstreamer isn’t correctly installed. Does OSMC’s use of alsa and pulseaudio differs largely from dietpi?

What could possibly be going wrong?

OSMC doesn’t by default use pulseaudio.

Are you trying to stream Kodi audio?
If so – make sure you use the BCM2835 ALSA sink and not PiSink, which does not use ALSA


Hey thanks for replies.

What would I need to do to get it working?

I’ve tried running “pulseaudio -D” and then restarting kodi, and cycling through all the audio devices listed in Kodi > Settings > System > Audio > Audio Output device. None of that worked

Are you talking about Kodi settings or in gstreamer pipeline? AFAIK there’s no device named PiSink in kodi and it’s probably not an element in gstreamer either.

I am using “ALSA Default(bcm2835 ALSA bcm2835 ALSA)” device right now in Kodi.

Either alsasrc element in gstreamer should start picking default device or kodi should start sending audio to pulse. Don’t know how to get either of those working.

I think i might’ve figured out the issue.

arecord -L


Discard all samples (playback) or generate zero samples (capture)

It doesn’t list any devices except null, but on dietpi the output is

Discard all samples (playback) or generate zero samples (capture)
JACK Audio Connection Kit
PulseAudio Sound Server
bcm2835 ALSA
USB Stream Output

/etc/asound.conf and all the hardware is the same. What could be causing this i wonder :thinking:

Solved - All I had to do was remove and reinstall pulseaudio, that automatically added default device to a record and now gstreamer works without any error :smile: Thank you all for your help and also to this guy.

Edit: Although I still can’t record any audio with arecord.