Changes

MythTV Hardware- Hauppauge USB Live-2

9,277 bytes added, 18:25, 7 March 2015
The following lines were added (+) and removed (-):
== driver and system recognition ===== driver and system recognition ===== testing video input ===== testing video input ===Once in Xfce you can test to see if you are able to receive video from a composite source via the USB Live-2.  For basic testing purposes mplayer serves well.  You will want to make sure that the driver loaded by using lsusb as described earlier.  A device should have been created in /dev as /dev/video0 or if you have other capture cards it could be /dev/video1 or higher.  Confirm which video device belongs to your USB Live 2.  For our example we will assume /dev/video0Once in Xfce you can test to see if you are able to receive video from a composite source via the USB Live-2.  For basic testing purposes [[mplayer]] serves well.  You will want to make sure that the driver loaded by using lsusb as described earlier.  A device should have been created in /dev as /dev/video0 or if you have other capture cards it could be /dev/video1 or higher.  Confirm which video device belongs to your USB Live 2.  For our example we will assume /dev/video0mplayer will complain that there is no TV Tuner (because of the -tv switch) however this will not prevent video from being displayed.  Specifying width= can be substituted with a width you prefer based on your resolution.  You should now see video from your source.  [[mplayer]] will complain that there is no TV Tuner (because of the -tv switch) however this will not prevent video from being displayed.  Specifying width= can be substituted with a width you prefer based on your resolution.  You should now see video from your source.  == testing audio input ==The driver dev made it default to PAL.  This is annoying if you are in North America.  norm=NTSC will force it to NTSC however if you observe dmesg you will see it tries PAL then NTSC.    cx231xx #0: do_mode_ctrl_overrides : 0xff cx231xx #0: do_mode_ctrl_overrides PAL cx231xx #0: do_mode_ctrl_overrides : 0xb000 cx231xx #0: do_mode_ctrl_overrides NTSC I guess if the dev lives in Europe he is going to assume everyone uses PAL. === testing audio input ===PulseAudio Volume Control will show at least 2 devices under the "Configuration" tab.  The first device will be your sound card or built-in audio.  The second device will be for the USB Live-2.  It will be labeled "Cx231xx Audio" as it is using the hacked Cx231xx kernel driver.  For an example you might see:* Built-in Audio:* Profile: Analog Stereo Output* Cx231xx Audio:* Profile: Ama;pg Stereo InputIf you click on the "Input Devices" tab you should see, at the top, "Cx231xx Audio Analog Stereo" and below that...* Cx231xx Audio Analog Stereo:* Port: Analog InputYou will see the horizontal bar fluctuating indicating input sound (if your source has sound) but you will not hear any audio. THis is because there is a "pulseaudio module-loopback" which is not automatically loaded nor can it be loaded though the graphical interface.  To add the loopback module to the running instance of Pulse Audio issue the command: pactl load-module module-loopbackTo make the module auto load issue the command: sudo sh -c ' echo "load-module module-loopback" >> /etc/pulse/default.pa 'Once module-loopback is loaded the pulse audio Volume Control panel will add an option to the Recording tab that allows selection to use on the loopback device.reference: [https://answers.launchpad.net/ubuntu/+source/pulseaudio/+question/83742 pulseaudio and saa7134 audio device]No additional audio related parameters were necessary to use on the mplayer command line for the test. mplayer tv:// -tv device=/dev/video0:norm=NTSCNow it is with picture and sound.  === more testing with mplayer ===Note: If you see a green picture with flickering lines at the top, then [[mplayer]] is attempting to play an NTSC video as PAL.  Again, the dopey kernel driver assumes PAL unless you specify NTSC.  You can see the problem in dmesg: cx231xx #0: do_mode_ctrl_overrides PALIt is useful to create a configuration file for mplayer with the defaults you use for your USB Live-2.  Create or edit the mplayer config file.  It is typically located at: /home/username/.mplayer where "username" is your username for mythtv.  Mythbuntu creates an empty file for you.  You can edit it. vi ~/.mplayer/config Add the following to your config file (including the comment text that is already present). # Write your default config options here! [protocol.tv] zoom = yes vo = x11 tv = "driver=v4l2:device=/dev/video0:norm=NTSC" monitoraspect = "4:3"Customize to suite your system config.  Now you don't have to specify command line parameters when running mplayer.  Start mplayer to view from your USB source: mplayer tv://We can test using gnome-mplayer which is the graphical gnome version part of the deb package gnome-mplayer installed via the command: sudo apt-get install gnome-mplayerIf you have the ~/.mplayer/config configured for [[mplayer]] it will be used by gnome-mplayer also.  You will need to do this because gnome-mplayer won't accept the -tv switch from the command line and will also try to default to PAL.  Now launch gnome-mplayer: gnome-mplayer tv://You may get prompted to "Resume Playback of Video X input at 0:00" - say "no."Now you can use gnome-mplayer gui frontend for mplayer as well as mplayer command line to get video and sound from the Hauppauge USB Live-2.  See also: [https://wiki.manjaro.org/index.php?title=Configure_mplayer_the_right_way Configure mplayer the right way]=== Testing with VLC (Video LAN Player) ===To show the a/v stream using [[VLC]] instead of [[mplayer]] execute the command: vlc v4l2:///dev/video0:standard=NTSCIf the last time the input was displayed was NTSC then vlc will default to NTSC with just  vlc v4l2:///dev/video0When vlc is closed, the sound continues to play.=== Adding to MythTV back-end configuration ===MythTV is designed to work with capture devices that have tuners.  [http://www.gossamer-threads.com/lists/mythtv/users/140368 Our device has no tuner] so it has to be configured in an irregular way that is not as well supported by the MythTV devs.  First review pertinent information from their documentation.<small>From the MythTV Wiki: [http://www.mythtv.org/wiki/MythTV-HOWTO_-_0.26#Capture_Cards Capture Cards]''You should have no capture cards defined, so the highlight will be on (New Capture Card). Press space to begin.Choose the appropriate settings for your particular tuner. Use the arrow keys to move around and to make your choices, and press RETURN when complete. Pressing RETURN will take you back to the Capture Cards screen; if you have additional capture cards in this machine, press the space bar when the highlight is on the (New Capture Card) row to define another card.If you have made a mistake, you can delete a card by highlighting it and pressing the 'D' key, or you can highlight it and press the RETURN or 'E' key to edit it.''From the MythTV Wiki: [http://www.mythtv.org/wiki/MythTV-HOWTO_-_0.26#Video_Sources Video Sources]''When you start, the highlight should be on (New Video Source). Press the space bar to begin. The first field asks for the name of the video source. You may choose something easy to remember, like "Antenna" or "Cable". Once you've chosen a name, press the down arrow to move to the next field.'' From the MythTV Wiki: [http://www.mythtv.org/wiki/MythTV-HOWTO_-_0.26#Input_Connections Input Connections]''On this screen, you will associate the various video sources you defined earlier with a physical input to a encoder card. It's entirely possible that you have multiple tuners, and each tuner has a different input, so on this screen you let MythTV know which device will connect to which input source. Don't add a video source to a hardware input if you don't actually have anything connected there. For example, adding "Cable" to the Tuner and to the Composite inputs without having something connected to Composite will lead to blank recordings.'' </small>Launch the backend setup $ mythtv-setupAnswer "Yes" when prompted to close the backend server. Enter the password.*Capture Card Setup:*Card type: Analog to MPEG-2 encoder card (PVR-150/250/350,etc):*Video device: /dev/video0:*Probed info: <nowiki>Hauppauge USB Live 2 [cx231xx]</nowiki>:*VBI device: ''(leave this blank - it is for closed caption)'':*Tuning timeout (ms): 6000* Video sources:* Video source name: VCR ''(call it what you want, VCR is just an example name)'':* Listings grabber: ''(choose something temporarily such as North America)'':* Channel frequency table: default:* Network ID: -1* Input connections (choose composite):*Capture device: <nowiki>[MPEG:/dev/video0]</nowiki>:*Input: Composite1:*Display name::*Video source: VCR:*External channel change command::*Preset tuner to channel::*Starting channel:We left some things blank in Input connections that we will go back and fill later.  Now exit mythtv-setup and DO NOT run mythfilldatabase.  We have to use mysql to add a dummy channel.  Your mysql admin login will be the same as your mythtv user password mysql -p mysql> use mythconverg; mysql> update videosource set xmltvgrabber = NULL where sourceid=1; mysql> insert into channel (chanid, channum, sourceid) VALUES (1001,1,1);What we did here was first inside the "videosource" table we set the xmltvgrabber for our new video source to NULL.  If your sourceid is something other than 1 then adjust accordingly.We also made a dummy or placeholder channel in the channel table so that the MythTV front-end has a channel it believes it is turning to when capturing from the USB Live-2.  This is a hack to deal with the fact that our device has no tuner.  The important fields are chanid, channum and sourceid.  You choose whatever unique channum you want.  The sourceid has to match that in videosouce table.  [http://www.gossamer-threads.com/lists/mythtv/users/44731 The chanid is a calculated field]: (sourceid * 1000) + channum Now you can exit mysql and go back into $ mythtv-setup* Video sources:* Video source name: VCR ''(call it what you want, VCR is just an example name)'':* Listings grabber: '''No grabber''':* Channel frequency table: default:* Network ID: -1* Input connections (choose composite):*Capture device: <nowiki>[MPEG:/dev/video0]</nowiki>:*Input: Composite1:*Display name: VCRSource:*Video source: VCR:*External channel change command::*Preset tuner to channel: '''1''':*Starting channel: '''1'''Exit the backend setup and this time go ahead and let it run mythfilldatabase.Open the MythTV frontend.  You will know we have accomplished something when it confirms that we are connected to the backend.Choose "Watch TV" to test...''So far unsuccessful.  In progress..''  &nbsp;[[Category:Computer Technology]][[Category:Linux]][[Category:Digital Video]][[Category:MythTV]]
Bureaucrat, administrator
16,192
edits