No audio when streaming using cvlc under debian squeeze

*nix specific usage questions
term0r
New Cone
New Cone
Posts: 3
Joined: 16 Jul 2010 01:13

No audio when streaming using cvlc under debian squeeze

Postby term0r » 16 Jul 2010 01:36

Hi

For two or three days I've been trying to get VLC streaming working using a webcam as input (/dev/video0) and a line-in as input (/dev/dsp0) or as an ALSA input.

Initially I was using the Debian etch vlc, but hit many issues with the lack of codecs supported, especially with no mp3lame support.

So, built a squeeze box from scratch, and have done the following:

Installed ALSA, configured using alsamixer, made the various dev's using snddevices. Checked that I get the input (my cellphone at the moment playing mp3s) coming out of the speaker socket on the sound card. All seems good.

I followed a few guides for getting ffmpeg and vlc compiled from scratch. In the end I checked ffmpeg out from the svn and compiled with:

Code: Select all

./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-shared --enable-nonfree --enable-libvorbis --enable-libgsm --enable-libspeex --enable-libschroedinger --enable-libdirac --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libopenjpeg --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-gpl --enable-libgsm --enable-libmp3lame make make install
Grabbed the latest VLC - wget http://sourceforge.net/projects/vlc/fil ... 2/download

Installed using:

Code: Select all

./configure --enable-merge-ffmpeg --enable-v4l --enable-dshow --enable-sout --disable-skins2 --enable-twolame --disable-xcb --disable-nls --disable-mozilla --disable-live555 make make install
I basically have no issues getting video working when using mms as my output. A command line similar to this works fine:

Code: Select all

cvlc 'v4l:///dev/video0:width=640:height=480' :input-slave=alsa://hw:0,0 --sout "#transcode{vcodec=WMV1,acodec=mp3,vb=1024,ab=512}:std{access=mmsh,mux=asfh,dst=:8080}" -vv
But I have no audio at all, just silence. When running the above command I think a key part of the output from vlc is:

Code: Select all

[0x9633fe4] main input debug: adding slave input 'alsa://hw:0,0' [0x9633fe4] main input debug: `alsa://hw:0,0' gives access `alsa' demux `' path `hw:0,0' [0x9633fe4] main input debug: creating demux: access='alsa' demux='' path='hw:0,0' [0x96354c4] main demux debug: looking for access_demux module: 1 candidate [0x96354c4] access_alsa demux debug: opening device 'hw:0,0' [0x96354c4] access_alsa demux debug: 'hw:0,0' is an audio device [0x96354c4] access_alsa demux debug: opened adev=`hw:0,0' stereo 48000Hz [0x96354c4] access_alsa demux debug: new audio es 2 channels 48000Hz [0x96354c4] main demux debug: using access_demux module "access_alsa" [0x96354c4] main demux debug: TIMER module_need() : 6.715 ms - Total 6.715 ms / 1 intvls (Avg 6.715 ms)
I started to suspect something was wrong with my input so I recorded some sound using:

Code: Select all

arecord -r 48000 -c 1 -t wav foobar.wav
That works fine.

I suspected video was interfering with audio, so tried with no video at all:

Code: Select all

cvlc alsa://hw:0,0 --sout "#transcode{vcodec=WMV1,acodec=mp3,vb=1024,ab=512}:std{access=mmsh,mux=asfh,dst=:8080}" -vv
No go - just silence.

I then wanted to get rid of the streaming part of things so tried something along these lines:

Code: Select all

cvlc alsa://hw:0,0 --sout "#transcode{vcodec=mp4v,acodec=mp4a,vb=1024,ab=128}:std{access=file,mux=mp4,dst=test.mp4}" -vv
That made an mp4 file with silence as the audio.

So, my biggest hunch is that vlc is only hearing silence in terms of its audio input. This seemed to also be the case when I was not using the alsa input method of vlc and instead refering to the /dev/dsp0 itself. I think my command line for this was something along the lines of:

Code: Select all

cvlc v4l:///dev/video0:adev=/dev/dsp0:audio=0 --sout "#transcode{vcodec=WMV1,acodec=mp3,vb=1024,ab=512}:std{access=mmsh,mux=asfh,dst=:8080}" -vv
Can anyone help with this, or suggest anything? I can include the full output of what happens when vlc starts, but basically it happily opens either the alsa hw0,0 or the /dev/dsp0 device depending on what method I am using. I'm pretty experienced with linux, but have virtually no experience with streaming or codecs.

Does anyone maybe have a command line already that does what I'm trying to do. Basically, take a video source, an audio source (either from a dsp or preferably from ALSA) and stream it? I don't really mind if I use mms, or some http method, but I would like the total bandwidth to be less than 1mbit. Ideally something more like 384 kbit with 256 for vid and 128 for audio. Does that seem reasonable?

I don't currently have X installed but can install it if required for testing.

Cheers
Dave

term0r
New Cone
New Cone
Posts: 3
Joined: 16 Jul 2010 01:13

Re: No audio when streaming using cvlc under debian squeeze

Postby term0r » 16 Jul 2010 06:49

Adding v4l2 support seemed to be the key to fixing this.

I ended up using the following cmd line for now:

Code: Select all

vlc v4l2:///dev/video0:width=640:height=480:fps=6 :input-slave=alsa://hw:0,0 --sout '#transcode{vcodec=mp1v,acodec=mp3,vb=1024,ab=128}:standard{access=http,mux=ps,dst=172.20.0.92:8080}' -vv

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: No audio when streaming using cvlc under debian squeeze

Postby Jean-Baptiste Kempf » 16 Jul 2010 15:08

did it work at the end?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

term0r
New Cone
New Cone
Posts: 3
Joined: 16 Jul 2010 01:13

Re: No audio when streaming using cvlc under debian squeeze

Postby term0r » 19 Jul 2010 01:45

Things are working just. The box I'm testing on doesn't really have enough grunt for the transcoding part. But now I've proved that the concept works I can now order some better hardware for the job.


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

Who is online

Users browsing this forum: No registered users and 22 guests