:input-slave alsa:// problem. Cant capture audio

*nix specific usage questions
morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

:input-slave alsa:// problem. Cant capture audio

Postby morphemass » 13 Jul 2009 11:21

I'm hoping for some hints as to where the problem may lay here. I'm capturing video from a generic video capture card (this works fine, Im on Ubuntu Jaunty BTW) and TRYING to capture sound from one of the motherboards audio inputs (Gigabyte EX58-UD5). When I pop headphones in I can hear the audio. If I mute the line-in audio input, its muted. but when I use the ":input-slave alsa://" directive alongside the v4l2 video capture options I get video captured but no audio.

I HAD audio capture working in an older version of VLC, but I've now spent hours trying to get it to work with V1.0 of VLC and am getting nowhere, partly (I suspect) because I cant find documentation on how the :input-slave directive can be used...ANY hints or advise appreciated here. tia

gborzi
New Cone
New Cone
Posts: 5
Joined: 11 Jul 2009 20:30

Re: :input-slave alsa:// problem. Cant capture audio

Postby gborzi » 13 Jul 2009 14:13

Hello,
I've used input-slave directive to capture oss audio with a command like this

vlc 'v4l2://:v4l2-dev=/dev/analogtv:v4l2-standard=2' :input-slave=oss:///dev/tvdsp

where /dev/analogtv is a symbolic link to /dev/video0 and /dev/tvdsp is a symbolic link to /dev/dsp1. The problem is that the video becomes choppy. I don't know for alsa, perhaps something like :input-slave=alsa://hw:X,Y.

morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

Re: :input-slave alsa:// problem. Cant capture audio

Postby morphemass » 13 Jul 2009 16:06

Hello,
I've used input-slave directive to capture oss audio with a command like this

vlc 'v4l2://:v4l2-dev=/dev/analogtv:v4l2-standard=2' :input-slave=oss:///dev/tvdsp

where /dev/analogtv is a symbolic link to /dev/video0 and /dev/tvdsp is a symbolic link to /dev/dsp1. The problem is that the video becomes choppy. I don't know for alsa, perhaps something like :input-slave=alsa://hw:X,Y.
Thanks gborzi; typically though I'm just using the input off the motherboard so my audio device will be different HOWEVER the syntax is what is important. Even the release note say "Use --input-slave alsa:// or oss:// if needed." so no wonder I've been struggling. Will update if I get it working.

morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

Re: :input-slave alsa:// problem. Cant capture audio

Postby morphemass » 13 Jul 2009 20:02

Okay I am still having trouble with this - the command I am using is simply :

Code: Select all

vlc -vvv v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=720 :v4l2-height=576 :v4l2-fps=25 :v4l2-input=2 :v4l2-standard=5 :v4l2-adev=/dev/dsp :input-slave=alsa://
But this results in a VERY long start up time and broken video. Now I *think* the (motherboards alsa) audio input is being detected since if I log things I see :

Code: Select all

[0x7f2274002e58] main input debug: adding slave input 'alsa://' [0x7f2274002e58] main input debug: `alsa://' gives access `alsa' demux `' path `' [0x7f2274002e58] main input debug: creating demux: access='alsa' demux='' path='' [0x7f2274013378] main demux debug: looking for access_demux module: 1 candidate [0x7f2274013378] access_alsa demux debug: Available alsa capture devices: [0x7f2274013378] access_alsa demux debug: Intel (HDA Intel) [0x7f2274013378] access_alsa demux debug: hw:0,0 : ALC883 Analog (ALC883 Analog) [0x7f2274013378] access_alsa demux debug: hw:0,1 : ALC883 Digital (ALC883 Digital) [0x7f2274013378] access_alsa demux debug: hw:0,2 : ALC883 Analog (ALC883 Analog) [0x7f2274013378] access_alsa demux debug: opening device 'hw' [0x7f2274013378] access_alsa demux debug: 'hw' is an audio device [0x7f2274013378] access_alsa demux debug: opened adev=`hw' stereo 48000Hz [0x7f2274013378] access_alsa demux debug: new audio es 2 channels 48000Hz [0x7f2274002e58] main input debug: selecting program id=0 [0x7f2274013378] main demux debug: using access_demux module "access_alsa" [0x7f2274013378] main demux debug: TIMER module_need() : 21.485 ms - Total 21.485 ms / 1 intvls (Avg 21.485 ms) [0x2893e18] main decoder debug: looking for decoder module: 31 candidates [0x2893e18] araw decoder debug: samplerate:48000Hz channels:2 bits/sample:16 [0x2893e18] main decoder debug: using decoder module "araw" [0x2893e18] main decoder debug: TIMER module_need() : 4.054 ms - Total 4.054 ms / 1 intvls (Avg 4.054 ms) [0x2893e18] main decoder debug: thread (decoder) created at priority 5 (input/decoder.c:315) [0x2893e18] main decoder debug: thread started [0x7f2274002e58] main input debug: `v4l2://' successfully opened [0x7f2274001d98]
BUT then things go into an interesting loop where the system tries to buffer the audio and I get continual messages such as the following :

Code: Select all

[0x7f2274002e58] main input warning: clock gap, unexpected stream discontinuity [0x7f2274002e58] main input warning: feeding synchro with a new reference point trying to recover from clock gap [0x7f2274002e58] main input debug: Buffering 0% [0x7f2274002e58] main input debug: Buffering 28% [0x7f2274002e58] main input warning: clock gap, unexpected stream discontinuity [0x7f2274002e58] main input warning: feeding synchro with a new reference point trying to recover from clock gap [0x7f2274002e58] main input debug: Buffering 0% [0x7f2274002e58] main input warning: clock gap, unexpected stream discontinuity [0x7f2274002e58] main input warning: feeding synchro with a new reference point trying to recover from clock gap [0x7f2274002e58] main input debug: Buffering 0% [0x7f2274002e58] main input debug: Buffering 28%
At no point do the video/audio play HOWEVER if I leave out the audio I CAN get the video to play.

*sigh* ANY advice appreciated.

morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

Re: :input-slave alsa:// problem. Cant capture audio

Postby morphemass » 13 Jul 2009 22:33

Well I'm getting somewhere; the command "vlc alsa://hw:0,0" allows me to play the current line-in audio (and I can record it using the record button) HOWEVER that command and variants such as "vlc alsa://", "vlc --input-slave=alsa://" ALL result in the vlc interface complaining that the access_alsa module cannot be loaded and the initial "vlc alsa://hw:0,0" seems to be REQUIRED in order to set the correct alsa input.

When I combine, in any combination, that alsa access line with the video/v4l2 options I still get the issue with buffering and no sound.

I feel like I am dealing with a bug here......

morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

Re: :input-slave alsa:// problem. Cant capture audio

Postby morphemass » 13 Jul 2009 23:27

Perversely I just downgraded to 0.9.9a and there I now have audio but no video. Upgraded to 1.0.0.1 again and same there....I cant seem to get video to work now because the audio is being captured. I've tried removing the .cache files....next step, downgrading the PC to a toaster via use of sledgehammer adaptor. :evil:

gborzi
New Cone
New Cone
Posts: 5
Joined: 11 Jul 2009 20:30

Re: :input-slave alsa:// problem. Cant capture audio

Postby gborzi » 14 Jul 2009 03:15

Hello morphemass,
there is one thing I forgot to mention in my previous post. In order to have video (even without audio) I have to add width and height after the video device, like this

vlc v4l2:///dev/video0:width=720:height=576

using v4l-{width,height} has no effect. I have tried the equivalent of "vlc alsa://hw:0,0" with oss in two ways

vlc v4l2:///dev/video0:width=720:height=576 oss:///dev/tvdsp (video ok, but no audio)

vlc oss:///dev/tvdsp v4l2:///dev/video0:width=720:height=576 (audio ok, no video)

It looks like there is a bug that prevents vlc from reading all but the first command line option.

morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

Re: :input-slave alsa:// problem. Cant capture audio

Postby morphemass » 14 Jul 2009 13:59

Hello morphemass,
there is one thing I forgot to mention in my previous post. In order to have video (even without audio) I have to add width and height after the video device, like this

vlc v4l2:///dev/video0:width=720:height=576

using v4l-{width,height} has no effect. I have tried the equivalent of "vlc alsa://hw:0,0" with oss in two ways

vlc v4l2:///dev/video0:width=720:height=576 oss:///dev/tvdsp (video ok, but no audio)

vlc oss:///dev/tvdsp v4l2:///dev/video0:width=720:height=576 (audio ok, no video)

It looks like there is a bug that prevents vlc from reading all but the first command line option.
That's interesting gborzi. That's more or less what I was experiencing; however just before I had to leave this be for the night I had a look at the logs and after upgrading and downgrading VLC seems to have lost the ability to play MPEG video streams so I'm wondering if doing the downgrade, then doing an upgrade resulted in the Ubuntu restricted packages being changed. Anyways I'm not at all convinced that part of my problem isnt with the capture card I'm using. We normally use either the viewcast 100 or the plain old leadtek vc100xp but I decided to experiment with a wintv-pvr150 since it would allow me to cut out converting the stream to mpeg2 but I'm now suspicious as to if the problem may lie with that.

Anyways another evening of wrestling with this problem coming up ;)

morphemass
Blank Cone
Blank Cone
Posts: 20
Joined: 12 Nov 2008 21:38

Re: :input-slave alsa:// problem. Cant capture audio

Postby morphemass » 14 Jul 2009 21:58

I installed a different capture card and tried again with version 1.0.0.1 but still had problems capturing audio and video (I could get audio this time but not video - logged errors were different). I then downgraded again to 0.9.9a and was able to get everything working within a few minutes. I'm going to have to look at building the git/svn version and taking the issue to the dev list since the issue looks peculiar enough to be of interest...hopefully.

gborzi
New Cone
New Cone
Posts: 5
Joined: 11 Jul 2009 20:30

Re: :input-slave alsa:// problem. Cant capture audio

Postby gborzi » 01 Aug 2009 10:18

Hello morphemass,
I've just tried vlc 1.0.1 with this command

vlc v4l2:///dev/analogtv:width=720:height=576 :input-slave=oss:///dev/tvdsp

and it works OK. That is to say I can have both audio and video running smoothly, unlike with the previous version when with the above command I had choppy video.


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

Who is online

Users browsing this forum: No registered users and 12 guests