Sound input via Pulse choppy

*nix specific usage questions
simonb
Blank Cone
Blank Cone
Posts: 25
Joined: 15 Jan 2005 18:38
Operating System: Linux
Location: London

Sound input via Pulse choppy

Postby simonb » 27 Aug 2010 07:43

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Sound input via Pulse choppy

Postby Rémi Denis-Courmont » 28 Aug 2010 03:06

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

simonb
Blank Cone
Blank Cone
Posts: 25
Joined: 15 Jan 2005 18:38
Operating System: Linux
Location: London

Re: Sound input via Pulse choppy

Postby simonb » 28 Aug 2010 06:16

Pulse audio output works fine for me. It is audio capture that isn't working.

chetan
New Cone
New Cone
Posts: 1
Joined: 18 Oct 2010 02:51

Re: Sound input via Pulse choppy

Postby chetan » 18 Oct 2010 02:57

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://

simonb
Blank Cone
Blank Cone
Posts: 25
Joined: 15 Jan 2005 18:38
Operating System: Linux
Location: London

Re: Sound input via Pulse choppy

Postby simonb » 13 Nov 2010 12:28

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.

simonb
Blank Cone
Blank Cone
Posts: 25
Joined: 15 Jan 2005 18:38
Operating System: Linux
Location: London

Re: Sound input via Pulse choppy

Postby simonb » 23 Jul 2011 12:05

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!

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Sound input via Pulse choppy

Postby Rémi Denis-Courmont » 11 Oct 2011 15:57

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
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

simonb
Blank Cone
Blank Cone
Posts: 25
Joined: 15 Jan 2005 18:38
Operating System: Linux
Location: London

Re: Sound input via Pulse choppy

Postby simonb » 11 Oct 2011 16:54

Thanks Rémi, that's great news. I'll give it a try.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 21 guests