Showing posts with label analog video capture. Show all posts
Showing posts with label analog video capture. Show all posts

Friday, September 26, 2008

How to set up both analog and digital out in Ubuntu


Wanted to get S/Pdif / digital output to my 2 channel DAC, while maintaining my analog output/ line out


First check what your devices are:type in terminal: aplay -l

Result:

**** List of PLAYBACK Hardware Devices ****
card 0: ICH5 [Intel ICH5], device 0: Intel ICH [Intel ICH5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICH5 [Intel ICH5], device 4: Intel ICH - IEC958 [Intel ICH5 - IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0


Note that device 4 is my digital audio device: IEC958.
First I set the sound preferences in System to IEC 958; this made the digital out active.
But no sound anymore on my pc speakers connected to analog audio out or line out.
So I found this suggestion: create in ~/.asoundrc the following code (type in terminal: sudo gedit ~/.asoundrc):
pcm.!default {
type plug
slave.pcm ttable

}

pcm.ana {
type hw
card 0
device 0
}

pcm.digi {
type hw
card 0
device 4
format S16_LE
rate 48000
}

pcm.both {
type multi
slaves {
a {
pcm "digi"
channels 2
}
b {
pcm "ana"
channels 2
}
}
bindings {
0 {
slave a
channel 0
}
1 {
slave a
channel 1
}
2 {
slave b
channel 0
}
3 {
slave b
channel 1
}
}
}

pcm.ttable {
type route
slave.pcm "both"
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
}

Note that I set my digital device to 4. It may be 2 or another one in your case.
(source: http://sudan.ubuntuforums.com/showthread.php?t=875268&s=bd8557c7e7f2df6b1627e997a1a82f62&

I had set my sound preferences back to ALSA. So now I had sound on the analog output, but not on the digital output. I installed gnome alsa mixer (via synaptic) and set it to work(applications, multimedia).
And found out that the volume of the ICP958P was zero. Changing that I had sound both analog and digital...







+++++++++++++++++++++++++++++++++++++++++++++++++++



The following was a digression that didn'tlead to a solution for me. But maybe for others:

Found this bug report:


Hardy beta, clean install.

ALSA sees the integrated sound card in my system and its analog and digital outputs, with no problem:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC883 Digital [ALC883 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0

However, pulseaudio is only using the Analog output.
Also, pavucontrol only shows the analog output device (ALC883 Analog).

I think this is a bug, there seems to be no way to have pulseaudio output to the digital (s/pdif / ie958) sink.

This: http://www.pulseaudio.org/ticket/139
may have something to do with this.
I followed the instructions:
- added the following line to /etc/pulse/default.pa:
load-module module-alsa-sink device=hw:0,1 ## Card 0, Device 1
- Kill and restart the audio server:
pulseaudio -k
pulseaudio -D

Now the digital output shows up in pavucontrol, and the applications that use pulse also use the digital output. All this shouldn't be needed (output to digital by default) or at least an easier digital output activation is necessary.


sorrce: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/205717


I tried the above solution. Didn't work for me; got the message connection failed when I tried to activate pavucontrol and no sound on my system and no digital out.







Device 4 or the IEC958 is the digital device; set that in tab Devices as device.

Sunday, September 14, 2008

Capturing analog video

source:(+video): http://nl.youtube.com/watch?v=dDLtHDvQ7O4
Thought I'd share my good fortune - I know I'm not alone in trying to figure out how to capture from an analog capture device in LINUX, and "How-Tos" in LINUX are fairly lacking on YouTube. Here are some command lines I've pieced together to capture - 2 for a TV card and 1 for USB Webcam. The tutorial will hopefully give you an idea on how to tweak them for your own use. As needs arise for my own further tweaking, maybe I'll post some modifications! Here they are, for your enjoyment. To use, just open a console where you want to save the video file, cut and paste, change the name of the file to what you want and add any other tweaks, and you're ready.

MPlayer/mencoder:
http://www.mplayerhq.hu

High Quality:
mencoder -ovc lavc -lavcopts vcodec=mpeg4:\vhq:vbitrate=6000 -oac mp3lame -lameopts br=256: -ffourcc DIVX -tv driver=v4l:norm=ntsc:input=1:adevice=/de v/dsp:width=640:height=480 -af volume=-10 -o ****.avi tv://

Web Quality:
mencoder -oac mp3lame -ovc lavc -lameopts mode=1:vbr=2:q=4 -lavcopts vcodec=mpeg4 -tv driver=v4l:norm=ntsc:input=1:adevice=/de v/dsp:width=640:height=480 -af volume=-10 -o ****.avi tv://

Webcam:
mencoder tv:// -tv driver=v4l:width=320:height=240:device=/ dev/video1:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o ****.avi

Getting Started in Cinelerra:
http://www.billauer.co.il/cinelerra-v...

This video was captured entirely in analog, entirely on my webcams, and entirely in LINUX (my first!) This is my third video using Cinelerra... hopefully no one noticed the difference!

Blog Archive