Author Topic: *Solved* 810 - Myth Live and recording issue PCHD5500  (Read 6409 times)

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
*Solved* 810 - Myth Live and recording issue PCHD5500
« on: September 20, 2009, 03:58:21 pm »
Hello,

  I've hit a bit of a wall in troubleshooting an intermittent issue that occurs when I attempt to watch analog signals via the PCHD5500 cards. Essentially recorded shows and livetv affected by this issue will skip about every half second throughout the recording (or consistently throughout the live tv session). To correct it in livetv you just have to change chanels (channel up then channel down). Though I haven't found a workable solution to correct affected recordings. A snippet of the mythbackend.log is below, it seems every time this issue occurs i get the 'Strange error flushing buffer ...' message in the log.

Code: [Select]
2009-09-18 21:00:03.269 AutoExpire: CalcParams(): Max required Free Space: 11.0 GB w/freq: 15 min
strange error flushing buffer ...
2009-09-18 21:00:03.706 Started recording: Psych "Bollywood Homicide": channel 1039 on cardid 1, sourceid 1
2009-09-18 21:00:03.937 Using runtime prefix = /usr
2009-09-18 21:00:04.096 Empty LocalHostName.
2009-09-18 21:00:04.163 Using localhost value of dcerouter
2009-09-18 21:00:04.273 New DB connection, total: 1
2009-09-18 21:00:04.288 Connected to database 'mythconverg' at host: localhost
2009-09-18 21:00:04.308 Closing DB connection named 'DBManager0'
2009-09-18 21:00:04.324 Connected to database 'mythconverg' at host: localhost
2009-09-18 21:00:04.340 New DB connection, total: 2
2009-09-18 21:00:04.346 Connected to database 'mythconverg' at host: localhost
2009-09-18 21:00:04.360 Current Schema Version: 1214
2009-09-18 21:00:04.509 Preview: Grabbed preview '/home/public/data/pvr/1056_20090918200000.nuv' 480x480@64s
2009-09-18 21:00:04.960 Reschedule requested for id 0.
2009-09-18 21:00:05.284 Scheduled 228 items in 0.3 = 0.00 match + 0.32 place
2009-09-18 21:00:22.700 MainServer::HandleAnnounce Monitor
2009-09-18 21:00:22.704 adding: moon44 as a client (events: 0)
2009-09-18 21:00:22.708 MainServer::HandleAnnounce Monitor
2009-09-18 21:00:22.723 adding: moon44 as a client (events: 1)
2009-09-18 21:00:22.726 MainServer::HandleAnnounce Playback
2009-09-18 21:00:22.728 adding: moon44 as a client (events: 0)
2009-09-18 21:00:22.732 MainServer::HandleAnnounce FileTransfer
2009-09-18 21:00:22.736 adding: moon44 as a remote file transfer

  My questions are: is this something I have messed up in my logical config (setup is here: http://wiki.linuxmce.org/index.php/User:Murdock)? Is this a defect that needs to be in trac? Am I missing a valuable log that would help correct this issue?

Thank you,

Ryan

« Last Edit: October 26, 2009, 03:13:09 am by Murdock »

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: 810 - Myth Live and recording issue PCHD5500
« Reply #1 on: September 22, 2009, 03:14:50 pm »
The research I've done has suggested that the issue is rooted in the lame MP3 codec:
ii  lame                                       3.98-0.0                                                   LAME Ain't an MP3 Encoder
ii  libmp3lame0                                3.98-0.0                                                   LAME Ain't an MP3 Encoder

I modified the myth front end recording profiles for livetv (and others) to use uncompressed instead of MP3. Testing over the last hour has been successful, we'll see what happens.

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: 810 - Myth Live and recording issue PCHD5500
« Reply #2 on: October 25, 2009, 02:07:24 am »
No luck, the audio/video skipping continues to occur roughly 1 in 5 times that mythtv launches for the 2 analog sources.


If anyone has any thoughts, please let me know!

Thank you,

Ryan

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: 810 - Myth Live and recording issue PCHD5500
« Reply #3 on: October 25, 2009, 09:21:37 am »
Hello,

  I've hit a bit of a wall in troubleshooting an intermittent issue that occurs when I attempt to watch analog signals via the PCHD5500 cards. Essentially recorded shows and livetv affected by this issue will skip about every half second throughout the recording (or consistently throughout the live tv session). To correct it in livetv you just have to change chanels (channel up then channel down). Though I haven't found a workable solution to correct affected recordings. A snippet of the mythbackend.log is below, it seems every time this issue occurs i get the 'Strange error flushing buffer ...' message in the log.

Code: [Select]
2009-09-18 21:00:03.269 AutoExpire: CalcParams(): Max required Free Space: 11.0 GB w/freq: 15 min
strange error flushing buffer ...
2009-09-18 21:00:03.706 Started recording: Psych "Bollywood Homicide": channel 1039 on cardid 1, sourceid 1
2009-09-18 21:00:03.937 Using runtime prefix = /usr
2009-09-18 21:00:04.096 Empty LocalHostName.
2009-09-18 21:00:04.163 Using localhost value of dcerouter
2009-09-18 21:00:04.273 New DB connection, total: 1
2009-09-18 21:00:04.288 Connected to database 'mythconverg' at host: localhost
2009-09-18 21:00:04.308 Closing DB connection named 'DBManager0'
2009-09-18 21:00:04.324 Connected to database 'mythconverg' at host: localhost
2009-09-18 21:00:04.340 New DB connection, total: 2
2009-09-18 21:00:04.346 Connected to database 'mythconverg' at host: localhost
2009-09-18 21:00:04.360 Current Schema Version: 1214
2009-09-18 21:00:04.509 Preview: Grabbed preview '/home/public/data/pvr/1056_20090918200000.nuv' 480x480@64s
2009-09-18 21:00:04.960 Reschedule requested for id 0.
2009-09-18 21:00:05.284 Scheduled 228 items in 0.3 = 0.00 match + 0.32 place
2009-09-18 21:00:22.700 MainServer::HandleAnnounce Monitor
2009-09-18 21:00:22.704 adding: moon44 as a client (events: 0)
2009-09-18 21:00:22.708 MainServer::HandleAnnounce Monitor
2009-09-18 21:00:22.723 adding: moon44 as a client (events: 1)
2009-09-18 21:00:22.726 MainServer::HandleAnnounce Playback
2009-09-18 21:00:22.728 adding: moon44 as a client (events: 0)
2009-09-18 21:00:22.732 MainServer::HandleAnnounce FileTransfer
2009-09-18 21:00:22.736 adding: moon44 as a remote file transfer

  My questions are: is this something I have messed up in my logical config (setup is here: http://wiki.linuxmce.org/index.php/User:Murdock)? Is this a defect that needs to be in trac? Am I missing a valuable log that would help correct this issue?

Thank you,

Ryan



Check your capture card config in Myth backend setup... but it sound like that might be the root of the problem.

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: 810 - Myth Live and recording issue PCHD5500
« Reply #4 on: October 25, 2009, 03:35:29 pm »
Good thought, I did set it up via the standard setup in the wiki. http://wiki.linuxmce.org/index.php/PcHDTV_HD5500

I've also played around with changing some settings to see if it helps but have changed them back since it had little effect.

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: 810 - Myth Live and recording issue PCHD5500
« Reply #5 on: October 25, 2009, 11:16:50 pm »
In looking at the log I had attached, it's not the correct log for posting. This mythfrontend log is the closest i've come to narrowing down the issue, the problem occurs at least 1 in 5 times i launch with the analog feed:
Code: [Select]
2009-10-25 16:07:06.877 Opening ALSA audio device 'default'.
2009-10-25 16:07:07.040 VideoOutputXv: XVideo Adaptor Name: 'NV17 Video Texture'
2009-10-25 16:07:07.078 OSD Theme Dimensions W: 640 H: 480
2009-10-25 16:07:07.434 TV: Changing from None to WatchingLiveTV
2009-10-25 16:07:07.436 New DB connection, total: 3
2009-10-25 16:07:07.438 Connected to database 'mythconverg' at host: dcerouter
2009-10-25 16:07:07.439 Using realtime priority.
2009-10-25 16:07:07.541 Video timing method: RTC
2009-10-25 16:07:08.131 NVP: prebuffering pause
2009-10-25 16:07:08.132 WriteAudio: buffer underrun
2009-10-25 16:07:08.749 NVP: prebuffering pause
2009-10-25 16:07:08.751 WriteAudio: buffer underrun
2009-10-25 16:07:09.700 NVP: prebuffering pause
2009-10-25 16:07:09.701 WriteAudio: buffer underrun
2009-10-25 16:07:10.282 WriteAudio: buffer underrun
2009-10-25 16:07:10.441 NVP: prebuffering pause
2009-10-25 16:07:10.443 WriteAudio: buffer underrun
2009-10-25 16:07:10.740 TV: ProcessNetworkControlCommand(NETWORK_CONTROL QUERY POSITION)
2009-10-25 16:07:11.291 NVP: prebuffering pause
2009-10-25 16:07:11.292 WriteAudio: buffer underrun
2009-10-25 16:07:12.181 NVP: prebuffering pause
2009-10-25 16:07:12.182 WriteAudio: buffer underrun

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: 810 - Myth Live and recording issue PCHD5500
« Reply #6 on: October 26, 2009, 01:27:17 am »
I've tried messing with a few more settings (switching from ALSA to OSS devices, and a few other things) with no luck.

The really unusual thing here is that the problem ONLY surfaces on the analog PCHDTV cards connections. I've checked out the system utilization (myth sessions max out at about 1/4 of the CPU on both the MD and core)

I do not have a problem with HDTV feeds via the HDHomeRun or any video playback (except for the tainted files that were recorded with prebuffer issues - playback for those are consistently bad, not random like the LiveTV feeds). Video playback for HDHomeRun feeds is consistently good and has no issues.

This tells me it's something to do with either the cards or the configuration of the analog cards on the system or in myth. I just don't know where.


Any ideas or feedback is appreciated!

Ryan

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: *SOLVED* 810 - Myth Live and recording issue PCHD5500
« Reply #7 on: October 26, 2009, 03:12:52 am »
Okay...

  Here's what I did:

Starting out the issue presented itself 1 in 5 launches of the mythfrontend - watch live tv.

1. Modified each mythtv frontend to use the OSS devices vs the ALSA, both the Mixer (/dev/mixer) and the output (/dev/dsp)
  - Impact - Issue presented itself 1 in 8 times

2. Set the pci latency from the default of 64 to 128
  - Impact - Issue presented itself 1 in 16 times

3. Set the pci latency from 128 to 248 (sample syntax below)
  - Impact - Issue has not yet resurfaced - tested 25 times

setpci -v -s 01:06.0 latency_timer=F8 #<-- the value must be in hex
setpci -v -s 01:06.1 latency_timer=F8
setpci -v -s 01:06.2 latency_timer=F8
setpci -v -s 01:06.4 latency_timer=F8
setpci -v -s 01:07.0 latency_timer=F8
setpci -v -s 01:07.1 latency_timer=F8
setpci -v -s 01:07.2 latency_timer=F8
setpci -v -s 01:07.4 latency_timer=F8

  The wiki has been updated to include this information. http://wiki.linuxmce.org/index.php/PcHDTV_HD5500#Troubleshooting
« Last Edit: October 26, 2009, 03:17:53 am by Murdock »

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: *Solved* 810 - Myth Live and recording issue PCHD5500
« Reply #8 on: October 26, 2009, 03:21:41 am »
How about a patch?

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: *Solved* 810 - Myth Live and recording issue PCHD5500
« Reply #9 on: October 26, 2009, 12:59:03 pm »
A patch would have to be specifically targeted to this card (these settings may be detrimental to other cards), I'm not certain how to do that.

dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: *Solved* 810 - Myth Live and recording issue PCHD5500
« Reply #10 on: October 26, 2009, 04:49:52 pm »
something specific to this card would be 'ok' in the meantime. Join #linuxmce-devel to ask for assistance in creating it.

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: *Solved* 810 - Myth Live and recording issue PCHD5500
« Reply #11 on: October 27, 2009, 12:52:54 am »
That was me in the channel the last couple of days trying to setup a dev environment  :)

Murdock

  • Guru
  • ****
  • Posts: 229
    • View Profile
Re: *Solved* 810 - Myth Live and recording issue PCHD5500
« Reply #12 on: December 09, 2009, 04:36:01 am »
I've recently had to rebuild my system from alpha 2 (i built it at around release 18 and updated it until the end of alpha 2) to beta 2 which utilizes myth .22 vs .21

  I performed the following steps after getting my core and MD up and runnning using the generic instructions:

On the Core:
1. Update V4L drivers:
sudo apt-get install build-essential mercurial linux-headers-`uname -r`

cd /usr/src

sudo hg clone http://linuxtv.org/hg/v4l-dvb

cd v4l-dvb

sudo make

#This will take a while, then install the drivers

sudo make install


After the initial install on my MD, the sound card registered and everything looked good, though after a reboot my sound card would not recognize so I installed the latest ALSA drivers (ubuntuforums.org/showthread.php?p=6589810#post6589810), upon reboot the sound card was recognized once again.

The only other thing i did on the core was to ensure that the sound pieces in the mythtv-setup program were set to a dsp device instead of ALSA default.

I didn't have to make any other changes and I have not been able to reproduce the skipping sound I was having on .21 (thank GOD)