helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
806 stars 58 forks source link

Make EMPIA em28xx video grabbers work out of the box #346

Open probonopd opened 2 years ago

probonopd commented 2 years ago

e.g., USB ID eb1a:2861 (MSI Movie Voc mini)

The BSD hardware database seems to be entirely blank on this: https://bsd-hardware.info/index.php?id=usb:eb1a

Yet https://www.freebsd.org/cgi/man.cgi?query=em28xx describes it:

em28xx webcamd driver for USB camera and TV devices

It is unclear, however, how webcamd must be invoked so that it recognizes the device.

probonopd commented 2 years ago
% sudo webcamd -N vendor-0xeb1a-product-0x2861 -S unknown -M 0
webcamd 2799 - - Attached to ugen0.5[0]
webcamd 2799 - - Creating /dev/video0
webcamd 2799 - - Creating /dev/video1

% sudo chmod 777 /dev/video* # Is there a better way?

This needs to be automated when the device is plugged in?

However, VLC still erros when I try to open /dev/video0...

[0000000802996560] main playlist: playlist is empty
[000000080ec16060] v4l2 demux error: not a radio tuner device

(Which is correct. The capture card does not have a radio tuner.)

probonopd commented 2 years ago
% sudo ffmpeg -f v4l2 -standard PAL -i /dev/video0 -c:v libx264 -preset ultrafast -crf 0 output.mkv
# Creates a file, but only black, no video
% sudo ffmpeg -f v4l2 -standard PAL -i /dev/video1 -c:v libx264 -preset ultrafast -crf 0 output.mkv
[video4linux2,v4l2 @ 0x806468000] ioctl(VIDIOC_G_FMT): Invalid argument
/dev/video1: Invalid argument 
probonopd commented 2 years ago

For comparison, on Linux:

[  189.891298] usb 2-2: New USB device found, idVendor=eb1a, idProduct=2861, bcdDevice= 1.00
[  189.891304] usb 2-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  189.963761] mc: Linux media interface: v0.10
[  190.038315] videodev: Linux video capture interface: v2.00
[  190.079881] em28xx 2-2:1.0: New device   @ 480 Mbps (eb1a:2861, interface 0, class 0)
[  190.079889] em28xx 2-2:1.0: Video interface 0 found: isoc
[  190.131404] em28xx 2-2:1.0: chip ID is em2860
[  190.198971] em28xx 2-2:1.0: board has no eeprom
[  190.246547] em28xx 2-2:1.0: No sensor detected
[  190.270101] em28xx 2-2:1.0: found i2c device @ 0xb8 on bus 0 [tvp5150a]
[  190.279495] em28xx 2-2:1.0: Your board has no unique USB ID.
               A hint were successfully done, based on i2c devicelist hash.
               This method is not 100% failproof.
               If the board were misdetected, please email this log to:
                V4L Mailing List  <linux-media@vger.kernel.org>
               Board detected as EM2860/TVP5150 Reference Design
[  190.415436] em28xx 2-2:1.0: Identified as EM2860/TVP5150 Reference Design (card=29)
[  190.415447] em28xx 2-2:1.0: analog set to isoc mode.
[  190.416194] em28xx 2-2:1.1: audio device (eb1a:2861): interface 1, class 1
[  190.416226] em28xx 2-2:1.2: audio device (eb1a:2861): interface 2, class 1
[  190.419100] usbcore: registered new interface driver em28xx
[  190.496627] usbcore: registered new interface driver snd-usb-audio
[  190.507644] em28xx 2-2:1.0: Registering V4L2 extension
[  190.576707] tvp5150 13-005c: tvp5150 (4.0) chip found @ 0xb8 (2-2:1.0)
[  190.576716] tvp5150 13-005c: tvp5150am1 detected.
[  191.862691] em28xx 2-2:1.0: Config register raw data: 0x10
[  191.877432] em28xx 2-2:1.0: AC97 vendor ID = 0xffffffff
[  191.884485] em28xx 2-2:1.0: AC97 features = 0x6a90
[  191.884494] em28xx 2-2:1.0: Empia 202 AC97 audio processor detected
[  194.539446] em28xx 2-2:1.0: V4L2 video device registered as video0
[  194.539452] em28xx 2-2:1.0: V4L2 VBI device registered as vbi0
[  194.539458] em28xx 2-2:1.0: V4L2 extension successfully initialized
[  194.539460] em28xx: Registered (Em28xx v4l2 Extension) extension

vlc doesn't seem to play anything under Linux as well...

sudo rmmod em28xx
$ sudo modprobe em28xx card=38

$ v4l2-ctl -d /dev/video0 -i 1
Video input set to 1 (Composite: Camera, ok)

Still no video in vlc.