Difference between revisions of "Plextor ConvertX PX-M402U"
m (→testing audio input) |
|||
(9 intermediate revisions by one user not shown) | |||
Line 18: | Line 18: | ||
=== driver and system recognition === | === driver and system recognition === | ||
− | The device was recognized in [[ | + | The device was recognized in [[Mythbuntu]] immediately upon connection. The output of lsusb shows the device as: |
Plextor Corp. ConvertX M402U A/V Capture | Plextor Corp. ConvertX M402U A/V Capture | ||
Line 29: | Line 29: | ||
The audio device is going to have a name like: "hw:3,0" It will likely be a second audio device since the first is the system soundcard. | The audio device is going to have a name like: "hw:3,0" It will likely be a second audio device since the first is the system soundcard. | ||
− | * hw:0,0 - The system sound device / ALSA device | + | * hw:0,0 - The system sound device / [[ALSA]] device |
* hw:3,0 - Audio from Plextor ConvertX | * hw:3,0 - Audio from Plextor ConvertX | ||
Line 79: | Line 79: | ||
*Channels: Stereo | *Channels: Stereo | ||
*Sample rate: 48000 Hz 16 bit | *Sample rate: 48000 Hz 16 bit | ||
+ | |||
+ | === Testing with mplayer === | ||
+ | Successful. Audio + Video after disable PulseAudio's control of the device. Skip to end to see solution. | ||
+ | |||
+ | Problem: Video in [[mplayer]] but no audio | ||
+ | |||
+ | This produces a picture but no audio: | ||
+ | mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:width=720:height=480:outfmt=yv12:device=/dev/video0 | ||
+ | |||
+ | Now to add audio: | ||
+ | mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:alsa=1:adevice=hw.3,0:audiorate=96000:forceaudio:width=720:height=480:outfmt=yv12:device=/dev/video0:immediatemode=0 | ||
+ | |||
+ | Some of the parameters explained: | ||
+ | *alsa=1 (use alsa) | ||
+ | *adevice=hw.3,0 (use direct hardware access with device 0 of card 3 which is the Plextor ConvertX on my system) | ||
+ | *audiorate=32000 (audio sample rate) | ||
+ | *amode=1 (stereo) | ||
+ | *input=0 (0=composite input, 1=svideo input) | ||
+ | *norm=NTSC or normid=4 (see supported norms: 0 = PAL, 4 = NTSC) | ||
+ | |||
+ | So that should work, right? It didn't at first. See the (partial) [[mplayer]] error output: | ||
+ | |||
+ | [...] | ||
+ | Error opening audio: Device or resource busy | ||
+ | v4l2: ioctl set mute failed: Invalid argument | ||
+ | v4l2: 0 frames successfully processed, 0 frames dropped. | ||
+ | Exiting... (End of file) | ||
+ | |||
+ | The problem was caused by PulseAudio tieing up the resource (ConvertX audio) so it appeared busy to [[mplayer]]. I don't know why this bothers mplayer and not vlc. vlc doesn't seem to care. Anyway, the solution: | ||
+ | |||
+ | "''[http://linuxtv.org/wiki/index.php/OTG102#Problems_with_audio If mplayer etc. reports that the audio device is busy] "error opening audio: Device or resource busy" and you are using pulseaudio, disable pulseaudio's control of the device, eg in pavucontrol (Pulse Audio Volume Control) under configuration, set the Cx231xx Audio device to be off. This will allow other programs to access the resource through the alsa device.'' " | ||
+ | |||
+ | That absolutely solved the problem with mplayer. | ||
+ | |||
+ | Under the "Configuration" tab in Pulse Audio Control you see "ConvertX M402U A/V Capture" and a drop-down box next to the label "Profile." That drop down box has the following two options: | ||
+ | * Analog Stereo Input | ||
+ | * Off | ||
+ | By changing it from "Analog Stereo Input" to "Off" you allow mplayer to have access to alsa. You will notice that if you click on the Pulse Audio Control tab "Input Devices" that the #2 Input Device listed "ConvertX M402U A/V Analog Stereo" is not visible. That area of the interface is empty. If you go back and change the drop down box in the "Configuration" tab to "Analog Stereo Input" then the #2 Input Device listed "ConvertX M402U A/V Analog Stereo" under the "Input Devices" tab will become visible again. | ||
=== Sometimes the USB port goes KaBlam === | === Sometimes the USB port goes KaBlam === | ||
Line 95: | Line 133: | ||
=== module-loopback hack === | === module-loopback hack === | ||
− | We made it so there was audio and video using VLC. However, many other apps have trouble. mplayer command line parameters are more tricky than vlc. | + | We made it so there was audio and video using VLC. However, many other apps have trouble. [[mplayer]] command line parameters are more tricky than vlc. |
It is possible to bind the input device from the Plextor ConvertX to the Alsa stereo output. | It is possible to bind the input device from the Plextor ConvertX to the Alsa stereo output. | ||
Line 119: | Line 157: | ||
You can remove the module-loopback mixing by doing: | You can remove the module-loopback mixing by doing: | ||
+ | pacmd unload-module module-loopback | ||
+ | source: [http://www.linuxquestions.org/questions/linux-software-2/alsa-and-pulseaudio-recording-multiple-input-devices-877614/ jthill on linuxquestions.org] | ||
+ | It would be better to specify which interfaces to mix specifically rather than just mixing them all. | ||
+ | pactl load-module module-loopback source="alsa_input.usb-PLEXTOR_Plextor_ConvertX_M402U-00-PXM402.analog-stereo" sink="alsa_output.pci-0000_00_08.0.analog-stereo" | ||
+ | I couldn't get this to work. When I do I will come back here and correct the error. moving on... | ||
+ | Q: How do I know what to specify for the source, what is the exact correct text string? | ||
+ | A: I found it by using "pacmd list-sources". There is a lot of information, it would help to narrow it down: | ||
+ | pacmd list-sources |grep M402U | ||
+ | Another cool way to narrow down the information for any capture device and to show inputs and outputs... | ||
+ | pacmd list-sources | sed -nr '/^ |\tname:/H;${g;s/\n\t/\t/g;s/\n//p}' | ||
+ | Ugly Hack Warning: ''There is latency when using the "hard wire" or "binding" hack. You might notice that sound lags behind the video depending on your hardware and system processing power. It is better to use the method described in the VLC section where you can tell the software which input device to use for sound. | ||
− | + | See also: | |
− | + | * [https://wiki.archlinux.org/index.php/PulseAudio/Examples PulseAudio/Examples] | |
− | + | * [http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ/#index39h3 freedesktop.org PulseAudio FAQ] - a guide that was never very verbose and notably incomplete. | |
− | + | ||
− | + | ||
− | + | ||
=== Adding to MythTV back-end configuration === | === Adding to MythTV back-end configuration === | ||
+ | With the capture device working having both audio and video using [[mplayer]] then MythTV should be able to fully use the capture device. It is just a matter of a proper configuration of MythTV back-end settings. | ||
+ | <big><big>coming soon...</big></big> | ||
+ | {{:Template:Sparse Entry}} | ||
== Related == | == Related == |
Latest revision as of 16:22, 25 March 2021
Plextor ConvertX PX-M402U USB 2.0 Real-Time Digital Video Converter. Converts to DivX®, MPEG-4, MPEG-1 and 2.
- Real-time hardware and MPEG-1/2/4 digital video converter
- Fast digital video conversion and lower CPU usage with hardware encoder
- Easy-to-use personal or VCD video creation software
- Official DivX Certified product
- Save hard disk space with DivX and MPEG-4
The ConvertX PX-M402U is an external USB 2.0 capture device that can encode external analog inputs to MPEG2/DivX in realtime. It has a full Linux SDK which has an open license. While the firmware is included with the SDK, this firmware does not have an open license.
There is a similar model, the Plextor ConvertX PVR PX-TV402U, that includes a tv tuner.
Contents
Review
Not at this time.
Using with MythTV
driver and system recognition
The device was recognized in Mythbuntu immediately upon connection. The output of lsusb shows the device as:
Plextor Corp. ConvertX M402U A/V Capture
testing video input
Any video player shows video from a connected source by simply opening the file
/dev/video0
If your device is on video0, it may be on video1 or another if you have other capture devices.
testing audio input
The audio device is going to have a name like: "hw:3,0" It will likely be a second audio device since the first is the system soundcard.
- hw:0,0 - The system sound device / ALSA device
- hw:3,0 - Audio from Plextor ConvertX
Finding the ConvertX, type:
cat /proc/asound/cards
Output Example:
0 [SB ]: HDA-Intel - HDA ATI SB HDA ATI SB at 0xfe5f4000 irq 16 1 [HDMI ]: HDA-Intel - HDA ATI HDMI HDA ATI HDMI at 0xfe7e8000 irq 19 2 [pcsp ]: PC-Speaker - pcsp Internal PC-Speaker at port 0x61 3 [PXM402 ]: go7007 - Plextor PX-M402 Plextor PX-M402
ref: http://www.alsa-project.org/main/index.php/Asoundrc
Testing with VLC (Video LAN Player)
Verified working audio and video using VLC Player 2.1.4
Assuming your capture device is /dev/video0 and ALSA ID is hw:3,0 then do the following:
- Open VLC
- On the menubar: Media -> Open Capture Device (or press CNTL-C)
- In this Open Media dialog click the "Capture Device" tab.
- Use these settings:
- Capture mode: Video Camera
- Device Selection
- Video device name: /dev/video0
- Audio device name: hw:3,0
- Click the Play button at the bottom of the dialog
This is creating the playlist v4l2:///dev/video0
v4l2 is Video4Linux version 2 video capture framework for linux. Video4Linux2 drivers have to setup supporting ICs to do audio/video muxing/encoding/decoding.
To open the capture device with video and audio from the command line:
vlc v4l2:///dev/video0 :input-slave="alsa://hw:3,0"
Test with VLC playing video from a connected composite DVD player. VLC reports the following:
Video
- Codec: MPEG-4 Video (mp4v)
- Resolution: 720x480
- Frames: 29.97
- Decode: Planar 4:2:0 YUV
Audio
- Codec: PCM S16 LE(s16l)
- Channels: Stereo
- Sample rate: 48000 Hz 16 bit
Testing with mplayer
Successful. Audio + Video after disable PulseAudio's control of the device. Skip to end to see solution.
Problem: Video in mplayer but no audio
This produces a picture but no audio:
mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:width=720:height=480:outfmt=yv12:device=/dev/video0
Now to add audio:
mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:alsa=1:adevice=hw.3,0:audiorate=96000:forceaudio:width=720:height=480:outfmt=yv12:device=/dev/video0:immediatemode=0
Some of the parameters explained:
- alsa=1 (use alsa)
- adevice=hw.3,0 (use direct hardware access with device 0 of card 3 which is the Plextor ConvertX on my system)
- audiorate=32000 (audio sample rate)
- amode=1 (stereo)
- input=0 (0=composite input, 1=svideo input)
- norm=NTSC or normid=4 (see supported norms: 0 = PAL, 4 = NTSC)
So that should work, right? It didn't at first. See the (partial) mplayer error output:
[...] Error opening audio: Device or resource busy v4l2: ioctl set mute failed: Invalid argument v4l2: 0 frames successfully processed, 0 frames dropped. Exiting... (End of file)
The problem was caused by PulseAudio tieing up the resource (ConvertX audio) so it appeared busy to mplayer. I don't know why this bothers mplayer and not vlc. vlc doesn't seem to care. Anyway, the solution:
"If mplayer etc. reports that the audio device is busy "error opening audio: Device or resource busy" and you are using pulseaudio, disable pulseaudio's control of the device, eg in pavucontrol (Pulse Audio Volume Control) under configuration, set the Cx231xx Audio device to be off. This will allow other programs to access the resource through the alsa device. "
That absolutely solved the problem with mplayer.
Under the "Configuration" tab in Pulse Audio Control you see "ConvertX M402U A/V Capture" and a drop-down box next to the label "Profile." That drop down box has the following two options:
- Analog Stereo Input
- Off
By changing it from "Analog Stereo Input" to "Off" you allow mplayer to have access to alsa. You will notice that if you click on the Pulse Audio Control tab "Input Devices" that the #2 Input Device listed "ConvertX M402U A/V Analog Stereo" is not visible. That area of the interface is empty. If you go back and change the drop down box in the "Configuration" tab to "Analog Stereo Input" then the #2 Input Device listed "ConvertX M402U A/V Analog Stereo" under the "Input Devices" tab will become visible again.
Sometimes the USB port goes KaBlam
While testing you might find the USB port stops. If you do this:
cat /dev/video0
and you get nothing, knowing that your video source is connected and active, you might need to unplug the USB cable and plug it back in again after a few seconds to reset the port.
If reaching behind the computer to unplug the USB cable is bothersome you can try this snazzy little C program to reset the USB port:
- usbreset.c - specify the BUS and DEVICE number to reset the USB port.
Note: as an alternative to /dev/video0 (which you don't want to try from a remote shell) you can strip the non-ascii characters for a safer test of the device.
tr -cd '\11\12\15\40-\176' < /dev/video0
module-loopback hack
We made it so there was audio and video using VLC. However, many other apps have trouble. mplayer command line parameters are more tricky than vlc.
It is possible to bind the input device from the Plextor ConvertX to the Alsa stereo output.
1. Install pulseaudio control: pavucontrol
apt-get install pavucontrol
2. Start your a/v source. Open KMPlayer and direct it to play from file: /dev/video0 or try "Dragon Player".
3. Open pavucontrol and notice under the "Input Devices" tab there will be two separate areas.
- Built-in Audio Analog Stereo
- ConvertX M402U A/V Capture Analog Stereo
If your connected device and the ConvertX are both work properly you will see activity on the level indicator bar (which is blue in the illustration) for #2. But you don't hear anything.
You can bind (might not be the correct term for it) the sound card to the ConvertX audio input using module-loopback.
pacmd load-module module-loopback latency_msec=5
Now you should hear out the speakers what is showing as indicator bar activity on "ConvertX M402U A/V Capture Analog Stereo"
This is an ugly hack. Why? Because you just combined everything so whatever else is playing through the card will get mixed and you will hear it or it will be captured if you are encoding.
You can remove the module-loopback mixing by doing:
pacmd unload-module module-loopback
source: jthill on linuxquestions.org
It would be better to specify which interfaces to mix specifically rather than just mixing them all.
pactl load-module module-loopback source="alsa_input.usb-PLEXTOR_Plextor_ConvertX_M402U-00-PXM402.analog-stereo" sink="alsa_output.pci-0000_00_08.0.analog-stereo"
I couldn't get this to work. When I do I will come back here and correct the error. moving on...
Q: How do I know what to specify for the source, what is the exact correct text string?
A: I found it by using "pacmd list-sources". There is a lot of information, it would help to narrow it down:
pacmd list-sources |grep M402U
Another cool way to narrow down the information for any capture device and to show inputs and outputs...
pacmd list-sources | sed -nr '/^ |\tname:/H;${g;s/\n\t/\t/g;s/\n//p}'
Ugly Hack Warning: There is latency when using the "hard wire" or "binding" hack. You might notice that sound lags behind the video depending on your hardware and system processing power. It is better to use the method described in the VLC section where you can tell the software which input device to use for sound.
See also:
- PulseAudio/Examples
- freedesktop.org PulseAudio FAQ - a guide that was never very verbose and notably incomplete.
Adding to MythTV back-end configuration
With the capture device working having both audio and video using mplayer then MythTV should be able to fully use the capture device. It is just a matter of a proper configuration of MythTV back-end settings.
coming soon...
Note: This page is notably incomplete. You can help. Please contribute by registering your email address and adding your knowledge to this page. The D.U.C.K. wiki was created to be a free informative place that allows an open exchange of accurate information. Learn more... |
Related
- Hauppauge USB Live-2
- Plextor ConvertX PX-M402U
- Hauppauge 1196 WinTV-HVR-1250
- Hauppauge WinTV-HVR-2255 Dual Tuner