Page 1 of 1

Sound input via Pulse choppy

Posted: 27 Aug 2010 07:43
by simonb
If I run the command

Code: Select all

vlc alsa://pulse
then I get broken, choppy audio. If I look at the "Recording" tab in pavucontrol (the Pulse volume control applet) then the meter for Alsa plug-in [vlc] keeps flickering as if it is only recognised intermittently.

VLC version

Code: Select all

VLC version 1.1.2 The Luggage (exported) Compiled by plf on delta.onse.fi (Jul 30 2010 10:45:41) Compiler: gcc version 4.4.3 (GCC)


OS is Mandriva 2010.1 64-bit.

Pulse version, pulseaudio 0.9.21-26mdv2010.1

I usually have to disable Pulse just to get VLC audio input working but I would like to not have to do that any more since Pulse has reportedly improved of late and works fine with other audio capture programs such as Audacity and Skype. I miss having the ability to pipe sound around and being able to seamlessly play different audio apps at the same time when I have to disable Pulse.

Re: Sound input via Pulse choppy

Posted: 28 Aug 2010 03:06
by Rémi Denis-Courmont
You need to use the native PulseAudio plugin if you want to output via PulseAudio.

Using ALSA for PulseAudio triggers known buffering problems (as you can see), and I doubt the PulseAudio guys are ever going to fix it.

Re: Sound input via Pulse choppy

Posted: 28 Aug 2010 06:16
by simonb
Pulse audio output works fine for me. It is audio capture that isn't working.

Re: Sound input via Pulse choppy

Posted: 18 Oct 2010 02:57
by chetan
I would like to add that i faced a similar problem with VLC using --input-slave alsa:// .

While dmesg shows no errors , i was getting stuttering audio while recording.
Only workaround i found was to launch vlc using the padsp launcher script and using --input-slave oss://
Once i switched to oss emulated input vlc recording was perfect.

As simonb said the flickering problem exists for me too and goes away only if i use oss input.
Using Ubuntu 10.04 lucid with vlc 1.1.2 .

FIX:- padsp vlc --input-slave oss://

Re: Sound input via Pulse choppy

Posted: 13 Nov 2010 12:28
by simonb
Thanks that works a treat :-)

The actual command I got to work was...

Code: Select all

padsp vlc v4l2:// :v4l2-dev="/dev/video0" --input-slave oss:///dev/dsp
or

Code: Select all

padsp vlc v4l2:// :v4l2-dev="/dev/video0" :input-slave="oss:///dev/dsp"
I still have a strange problem in that it only works if the Pulse Audio Mixer is on the screen. Otherwise the sound stops and starts. However, I can sort of live with this for the time being.

Re: Sound input via Pulse choppy

Posted: 23 Jul 2011 12:05
by simonb
The above worked on one PC but not another. I have filed a bug report http://trac.videolan.org/vlc/ticket/5068.

I have another solution which is to use mencoder/mplayer instead of VLC. Here is the command to just play video and audio capture...

Code: Select all

mplayer tv:// -tv driver=v4l2:width=720:height=576:norm=PAL:outfmt=yuy2:fps=25:immediatemode=0:amode=1:forceaudio:audiorate=48000:alsa:adevice=default


Below is a command line I used to save directly to an mpegts file. Mencoders TS encapsulation seems to be somewhat broken with chronic sync issues. To get around this problem I pipe to ffmpeg. Apologies if this looks complicated...

Code: Select all

mencoder tv:// -tv driver=v4l2:width=720:height=576:norm=PAL:outfmt=yuy2:fps=25:immediatemode=0:amode=1:forceaudio:audiorate=48000:alsa:adevice=default -oac lavc -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=8000:acodec=ac3:abitrate=224:aspect=4/3 -ofps 25 -of mpeg -mpegopts format=mpeg2:tsaf -o - | ffmpeg -y -i - -re -vcodec copy -acodec copy -f mpegts capture.mpg
Hope that helps someone out there!

Re: Sound input via Pulse choppy

Posted: 11 Oct 2011 15:57
by Rémi Denis-Courmont
VLC 1.2.0 has a native PulseAudio audio input:

Code: Select all

vlc pulse:// # for the default source vlc pulse://alsa_card.pci-0000_00_1b.0 # for the "alsa_card.pci-0000_00_1b.0" source

Re: Sound input via Pulse choppy

Posted: 11 Oct 2011 16:54
by simonb
Thanks Rémi, that's great news. I'll give it a try.