Author |
Message |
sgunther
|
Posted: Mon Jan 15, 2007 2:21 am |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
I am having an issue where i get in dmesg;
Code: kernel: ivtv0: All encoder MPEG stream buffers are full. Dropping data. kernel: ivtv0: Cause: the application is not reading fast enough.
This happens when I have multiple tuners scheduled (2 or 3) to start simultaneously. The shows video is pixelated and drops ot for ~5 seconds and then it works fine.
I found http://svn.mythtv.org/trac/ticket/1660 that talks about a patch to be applied. If I download the source I can apply the patch. Are there additional "KnoppMyth" modifications (patches/diffs) I should consider before .configure && make && make install? Will doing this likely cause any harm?
I am running R5E50 with a PVR-500 and a PVR-150.
|
|
Top |
|
 |
tjc
|
Posted: Mon Jan 15, 2007 10:52 am |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
There is a "compile from svn" page on the wiki which has most of the info you're looking for, search for "svn" and it should come up near the top of the list. WattoToydarian also put together a script which automates most of it which is posted around here, search for "compile mythtv from svn script" and don't forget to click the "search for all terms" button.
|
|
Top |
|
 |
brendan
|
Posted: Mon Jan 15, 2007 11:24 am |
|
Joined: Tue Dec 07, 2004 12:04 pm
Posts: 369
|
sg-
I have the same issue. If you document the full process, including the patch, and post it here, I'd appreciate it. Sounds like the patch won't be in mythtv proper till the next release.
-brendan
|
|
Top |
|
 |
sgunther
|
Posted: Tue Jan 16, 2007 9:10 am |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
I wanted to update all compponents to the latest fixes when I did this so...
I used ssh as root for all of this except the install (as mythtv) I had read there were issues. I did it last night. I will let you know if I see any more errors. Best of luck.
Credit goes where credit is due. I used the WattoToydarian script as a model. http://mysettopbox.tv/phpBB2/viewtopic. ... hlight=svn
Code: cd /usr/src wget http://svn.mythtv.org/trac/attachment/ticket/1660/asyncdb.2.patch?format=raw mv asyncdb.2.patch\?format\=raw asyncdb.2.patch mkdir svn cd svn svn co http://svn.mythtv.org/svn/branches/release-0-20-fixes/mythtv svn co http://svn.mythtv.org/svn/branches/release-0-20-fixes/mythplugins svn co http://svn.mythtv.org/svn/branches/release-0-20-fixes/myththemes mkdir backup cd backup /bin/cp -f /usr/share/mythtv/mainmenu.xml ./ /bin/cp -f --reply=yes /usr/share/mythtv/optical_menu.xml ./ cd ../mythtv/ ./configure --disable-distcc --prefix=/usr --enable-proc-opt --enable-dvb --enable-xvmc --enable-xvmc-pro --enable-opengl-vsync export QTDIR=/usr/share/qt3 /usr/bin/qmake mythtv.pro patch -p0 < /usr/src/asyncdb.2.patch /usr/bin/nice -n17 /usr/bin/make
# Backup Knoppmyth and MythTV. grep /usr/share/mythtv /myth/backup/backup.list >/dev/null || echo ./usr/share/mythtv >> /myth/backup/backup.list sed -si~ -e 's:^/:./:' /myth/backup/backup.list /usr/local/bin/mythbackup
To install the newly compiled svn version user:mythtv needs to have sudo access to 'make install' to do this run visudo and add /usr/bin/make to the mythtv line. Or just 'su'...
# Stop all effected programs. /etc/init.d/lirc stop /etc/init.d/mysql stop /etc/init.d/mythtv-backend stop
# Install MythTV and restore custom menus. (As user: mythtv) sudo /usr/bin/nice -n17 /usr/bin/make install /bin/cp -f /usr/src/svn/backup/mainmenu.xml /usr/share/mythtv/ /bin/cp -f /usr/src/svn/backup/optical_menu.xml /usr/share/mythtv/
# Configure and Install MythThemes. cd /usr/src/svn/myththemes/ ./configure --prefix=/usr /usr/bin/qmake myththemes.pro /usr/bin/nice -n17 /usr/bin/make
(As user: mythtv) sudo /usr/bin/nice -n17 /usr/bin/make install
# Configure, make, and install MythPlugins. cd /usr/src/svn/mythplugins/ ./configure --prefix=/usr --enable-all /usr/bin/qmake mythplugins.pro /usr/bin/nice -n17 /usr/bin/make
(As user: mythtv) sudo /usr/bin/nice -n17 /usr/bin/make install
# Restart frontend to load plugins and update MythWeb. /bin/cp -R mythweb/* /var/www/mythweb
reboot Update #1 Mythweb gets a little messed up... I need to track it down (just a page display issue) but it should be no big deal. I will update when I get it. Update #2 To fix mythweb run; Code: /usr/share/mythtv/mythweb/modules/_shared/lang/build_translation.pl
-sg
|
|
Top |
|
 |
sgunther
|
Posted: Tue Jan 16, 2007 12:59 pm |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
Looks like the patch does not work.
I have a lot less instances but the buffer full messages still pop up.
Anyone else seen this?
|
|
Top |
|
 |
brendan
|
Posted: Wed Jan 17, 2007 2:12 pm |
|
Joined: Tue Dec 07, 2004 12:04 pm
Posts: 369
|
sgunther wrote: Looks like the patch does not work.
I have a lot less instances but the buffer full messages still pop up.
Anyone else seen this?
Hmm, how about also increasing the ivtv buffers, e.g.:
Add to the /etc/mythtv/modules/ivtv file :
Code: options ivtv yuv_buffers=4 mpg_buffers=16 vbi_buffers=4 pcm_buffers=4
-brendan
|
|
Top |
|
 |
sgunther
|
Posted: Wed Jan 17, 2007 7:32 pm |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
I added it then, Code: update-modules then Code: reboot Time will tell. I did not have any errors at all today. So I think the patch helped a lot but we will see if this makes it go away fully. I appreciate the input. I had been trying Code: options ivtv yuv_buffers=32 mpg_buffers=16 vbi_buffers=16 pcm_buffers=16 but it was crashing on boot... I noticed in the Code: modinfo ivtv it does specify the defaults but not the max mins. Maybe I was using too much memory in my option line.
|
|
Top |
|
 |
brendan
|
Posted: Thu Jan 18, 2007 9:37 am |
|
Joined: Tue Dec 07, 2004 12:04 pm
Posts: 369
|
Is the update-modules call necessary? The man page says it is obsolete, but calls /sbin/update-modules.modutils if it exists, which it does.
But...
I thought that these changes to the options were picked up automatically, as evidenced by my own typos in the file preventing ivtv from loading in the past.
Let me know if the patch, the module options or both seem to be required to get it working without bits of lost mpeg stream.
-brendan
|
|
Top |
|
 |
sgunther
|
Posted: Thu Jan 18, 2007 5:13 pm |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
So far with both the errors and pixelation have gone away. I will update again tomorrow.
|
|
Top |
|
 |
brendan
|
Posted: Thu Jan 18, 2007 5:49 pm |
|
Joined: Tue Dec 07, 2004 12:04 pm
Posts: 369
|
sgunther wrote: So far with both the errors and pixelation have gone away. I will update again tomorrow.
The Mythtv Setup CARDS screen no longer allows us to set the VBI options, while the backend apparently resets the VBI options on a regular basis, overriding any v4l2-ctl passed vbi changes I make.
However, the Setup GENERAL screen (first one) allows us to set Closed Captioning to None (not the default), which does the trick. Mythtv 0.20 knows a little more about the ivtv driver than older versions, so this tells mythtv to notify the ivtv driver that vbi is not needed at all. Stepping back for a moment, I suppose that change to both screens was about being user friendly.
Whether or not this will impact the issue sgunther is working on above, I'm not sure, but I think it might. I'm going from 8% CPU per ivtv-vbi-enc task thread (with 3 cards in my system) to near 0. I'll post whether the larger buffers plus the CC disable also do the trick.
If you need CC, however, this solution won't be very helpful. In the long run, some ivtv and perhaps mythtv fixes, such as the patch above, will be needed.
-brendan
|
|
Top |
|
 |
sgunther
|
Posted: Thu Jan 18, 2007 10:21 pm |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
I have VBI on and am getting ~10% per ivtv-enc-vbi.
If when you turn off the VBI you no longer get video errors it may point to CPU loading.
I am wondering if the CPU loading of multiple tuners, MythTV programs, and the mySQL access is the issue. If the loading is the issue then the spike in loading could be mitigated with either turning off VBI or staggering the mySQL writes.
I ran a time based trace on mysql as two shows finished and wrote their metadata to the database...
(Note: I pad 90 seconds to my shows so that is why it stopped at 1:30 after 00)
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND TIME
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:03.79 mysqld 22:01:30
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:03.79 mysqld 22:01:30
2871 mysql 0 0 128m 19m 2256 S 5.9 4.1 6:03.82 mysqld 22:01:31
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:03.82 mysqld 22:01:31
2871 mysql 0 0 128m 19m 2256 S 23.7 4.1 6:03.94 mysqld 22:01:32
2871 mysql 0 0 128m 19m 2256 S 11.9 4.1 6:04.00 mysqld 22:01:32
2871 mysql 0 0 128m 19m 2256 S 19.8 4.1 6:04.10 mysqld 22:01:33
2871 mysql 0 0 128m 19m 2256 S 33.5 4.1 6:04.27 mysqld 22:01:33
2871 mysql 0 0 128m 19m 2256 S 43.5 4.1 6:04.49 mysqld 22:01:34
2871 mysql 0 0 128m 19m 2256 S 35.6 4.1 6:04.67 mysqld 22:01:34
2871 mysql 0 0 128m 19m 2256 S 53.6 4.1 6:04.94 mysqld 22:01:35
2871 mysql 0 0 128m 19m 2256 S 85.7 4.1 6:05.37 mysqld 22:01:35
2871 mysql 0 0 128m 19m 2256 S 81.2 4.1 6:05.78 mysqld 22:01:36
2871 mysql 0 0 128m 19m 2256 S 65.1 4.1 6:06.11 mysqld 22:01:36
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:06.11 mysqld 22:01:37
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:06.11 mysqld 22:01:37
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:06.11 mysqld 22:01:38
2871 mysql 0 0 128m 19m 2256 S 0.0 4.1 6:06.11 mysqld 22:01:38
I was suprised to see it peak at 86%!
Last edited by sgunther on Fri Jan 19, 2007 12:00 pm, edited 1 time in total.
|
|
Top |
|
 |
sgunther
|
Posted: Fri Jan 19, 2007 11:45 am |
|
Joined: Thu Apr 27, 2006 1:07 am
Posts: 54
|
I had to remove the changes to ivtv buffers. I was getting out of memory errors. So I will see how the patch alone does over the next few days.
|
|
Top |
|
 |
brendan
|
Posted: Sat Jan 20, 2007 11:47 am |
|
Joined: Tue Dec 07, 2004 12:04 pm
Posts: 369
|
Hans indicated we should be seeing 0.5 to 1.0 seconds of video per MB of buffer space. In the case of 16MB for each MPG buffer, that should be 8 to 16 seconds, but for the default 4MB, that's just 2 to 4 seconds.
Do you think your four second (22:01:32 to 22:01:36) mysql snapshot was from a single call into the database? If so, and without the patch, if the reads had been pending on a single call with that profile (in your case, it was after the recording ended, I know), then that would have caused the loss of buffered data, right?
If you could, perhaps, profile mysql during recording and see if you can identify any large stretches of mysql activity not correlated to the beginning or end of a recording, that might help to pinpoint.
sgunther wrote: I had to remove the changes to ivtv buffers. I was getting out of memory errors. So I will see how the patch alone does over the next few days.
With CC off (and consequently CPU-sucking VBI encoding off), the buffers increased to 16MB each, my mythcommflag set to nice 19 (by changing the executable settings in setup), but without the mythtv patch, I'm still getting very occassional "fast enough" errors, but now reduced to 0 to 2 per recording, or so. But the problem is waaaay less of an issue than before.
-brendan
|
|
Top |
|
 |
teet
|
Posted: Sun Dec 23, 2007 12:50 am |
|
Joined: Sun Apr 16, 2006 11:14 am
Posts: 2
|
brendan wrote: Hans indicated we should be seeing 0.5 to 1.0 seconds of video per MB of buffer space. In the case of 16MB for each MPG buffer, that should be 8 to 16 seconds, but for the default 4MB, that's just 2 to 4 seconds.
First post! I have a question related to mythtv on ubuntu 7.10 (gutsy gibbon). I realize this is a knoppmyth forum, but I think my question is distribution independent.
I have a PVR-150. The quality of my RECORDED tv is great. However, I have noticed that Live TV can be a bit "jerky" (stutter, glitchy -> alternate words for searches). However, if I pause Live TV for 4-5 seconds and then hit play, Live TV plays back as smoothly as a "recorded" show (yes I realize that live tv is recorded too). So, my conclusion is that the ~2 seconds of buffering -- where the cable signal is taken in, converted to mpeg, written to the hard drive, and then played back from the hard drive -- is just not enough when watching live TV.
So, I've been trying to figure out how to increase the buffer of mythtv playback. I tried the suggestion mentioned here. I created the file /etc/modprobe.d/ivtv whose contents is:
Code: options ivtv enc_yuv_buffers=4 enc_mpg_buffers=16 enc_vbi_buffers=4 enc_pcm_buffers=4 My dmesg |grep ivtv output after a reboot is now: Code: [ 50.297625] ivtv: ==================== START INIT IVTV ==================== [ 50.297629] ivtv: version 1.0.0 (2.6.22-14-386 mod_unload 486 ) loading [ 50.297687] ivtv0: Autodetected Hauppauge card (cx23416 based) [ 50.297738] ivtv0: Unreasonably low latency timer, setting to 64 (was 32) [ 51.234797] ivtv0: loaded v4l-cx2341x-enc.fw firmware (4158727400 bytes) [ 51.446754] ivtv0: Encoder revision: 0x02050032 [ 51.446759] ivtv0: Recommended firmware version is 0x02060039. [ 51.505701] ivtv0: Autodetected Hauppauge WinTV PVR-150 [ 51.526806] tuner 0-0061: chip found @ 0xc2 (ivtv i2c driver #0) [ 51.555179] cx25840 0-0044: cx25843-24 found @ 0x88 (ivtv i2c driver #0) [ 55.132507] wm8775 0-001b: chip found @ 0x36 (ivtv i2c driver #0) [ 55.496995] ivtv0: Registered device video0 for encoder MPEG (16 MB) [ 55.497589] ivtv0: Registered device video32 for encoder YUV (4 MB) [ 55.497979] ivtv0: Registered device vbi0 for encoder VBI (4 MB) [ 55.498302] ivtv0: Registered device video24 for encoder PCM audio (4 MB) [ 55.521887] ivtv0: Initialized Hauppauge WinTV PVR-150, card #0 [ 55.521914] ivtv: ==================== END INIT IVTV ====================
So it appears that the changes "took".
However, I still have the same problem when watching live tv. If I hit the spacebar to "save position", I see that I only have ~2 seconds of buffer. Now, if I pause the recording for 5 seconds or so, and then hit the right arrow key to skip forward 30 seconds (i.e. skip forward as far as possible) and then hit space bar to "save position", I see that I have a 4-5 second buffer! So it appears that the mpg_buffer trick only works if I pause the recording first (which was what I was trying to avoid having to do in the first place).
My question: Is there a setting I need to change somewhere in mythtv so it uses the correct 16 MB mpeg buffer all of the time instead of the default 4 MB buffer?
-teet
|
|
Top |
|
 |
brendan
|
Posted: Sun Dec 23, 2007 11:46 am |
|
Joined: Tue Dec 07, 2004 12:04 pm
Posts: 369
|
teet - these are two different kinds of buffers. The ivtv buffer is a driver buffer and you never want that to fill up, otherwise several seconds tv would be lost and not recorded.
The mythtv "buffer" you describe is more appropriately called a series of buffers and playback positioning steps.
They are completely unrelated.
-brendan
|
|
Top |
|
 |