USB DVB tuners and the Raspberry Pi - a warning

For discussion of topics specific to MythTV on Raspberry Pi devices
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by cliveb »

kmdewaal wrote:
Fri Mar 24, 2023 11:43 am
You can use gnome-disks to read the SMART data of the disk. This might give an indication if and why the disk is failing.
Does gnome-disks require a Gnome desktop? My Mint system is running XFCE.

I tried using smartctl but what it reported doesn't mean much to me. The only thing that looked a bit suspicious was this:

Code: Select all

Warning! SMART ATA Error Log Structure error: invalid SMART checksum.
User avatar
kmdewaal
Developer
Posts: 641
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by kmdewaal »

With smartctl you get the same information as with gnome-disks.
On a SSD I do get this summary result:

Code: Select all

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
It is possible to start a self-test with smartctl, but this was for me never that useful.
Probably a new disk is the way forward.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by cliveb »

kmdewaal wrote:
Fri Mar 24, 2023 12:53 pm
With smartctl you get the same information as with gnome-disks.
OK, thanks. So no real need to run gnome-disks.

Here's the full output from smartctl:

Code: Select all

smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-67-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     WD Blue SA510 2.5 1000GB
Serial Number:    22243V453813
LU WWN Device Id: 5 001b44 4a5430abc
Firmware Version: 52008100
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available, deterministic
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-4, ACS-2 T13/2015-D revision 3
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri Mar 24 13:49:52 2023 GMT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (    0) seconds.
Offline data collection
capabilities:                    (0x71) SMART execute Offline immediate.
                                        No Auto Offline data collection support.
                                        Suspend Offline collection upon new
                                        command.
                                        No Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        (  10) minutes.
Conveyance self-test routine
recommended polling time:        (   1) minutes.

SMART Attributes Data Structure revision number: 0
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0032   100   100   010    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       6
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       21
165 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       77314785359
166 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       1
167 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       23
168 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       2
169 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       357
170 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0
171 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0
172 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0
173 Unknown_Attribute       0x0032   100   100   005    Old_age   Always       -       1
174 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       4
184 End-to-End_Error        0x0032   100   100   097    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   100   100   014    Old_age   Always       -       30 (Min/Max 8/41)
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       0
230 Unknown_SSD_Attribute   0x0032   100   100   000    Old_age   Always       -       81605689363
232 Available_Reservd_Space 0x0033   100   100   004    Pre-fail  Always       -       92
233 Media_Wearout_Indicator 0x0032   100   100   000    Old_age   Always       -       163
234 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       2958
241 Total_LBAs_Written      0x0030   253   253   000    Old_age   Offline      -       1341
242 Total_LBAs_Read         0x0030   253   253   000    Old_age   Offline      -       903
244 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0

Warning! SMART ATA Error Log Structure error: invalid SMART checksum.
SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%         6         -
# 2  Short offline       Completed without error       00%         6         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
So it does claim that the overall health assessment has passed.

There's a lot of "Unknown Attributes" listed, which isn't exactly helpful.
kmdewaal wrote:
Fri Mar 24, 2023 12:53 pm
Probably a new disk is the way forward.
I'm wondering if there's something special about the WD Blue SSD that means sustained writes might sometimes get interrupted? I don't think it's SSDs in general that this might happen to, because the test systems I've been running on both x86 and RPi machines use a 128GB SSD I happened to have spare (Transcend brand). When I bought the WD Blue I thought I was going for a reputable brand.

I will temporarily clone the WD Blue to a 1TB HDD I've got and run the system on that for a while. Ultimately I want to use a SSD because they seem to respond much quicker.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by gedakc »

In the past when I've had a hard drive start to fail, the Reallocated_Sector_Ct begins increasing and eventually the hard drive fails outright.

While looking at the posted details I find it interesting that the drive says it has only been on for 6 hours. If the drive has been powered on for much longer than that, then I would tend not to trust any of the statistics that the drive is reporting.

Code: Select all

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0032   100   100   010    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       6
Trying a different HDD or SSD would help to identify if the drive is a problem.

With respect to backend recordings, I have had not problems recording OTA TV shows using X86 or RPi3/RPi4 computers.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by cliveb »

gedakc wrote:
Fri Mar 24, 2023 4:40 pm
While looking at the posted details I find it interesting that the drive says it has only been on for 6 hours. If the drive has been powered on for much longer than that, then I would tend not to trust any of the statistics that the drive is reporting.
Good point. The drive has been in use for months. Even since the last time it was completely reformatted, it's been on for a couple of weeks.
gedakc wrote:
Fri Mar 24, 2023 4:40 pm
Trying a different HDD or SSD would help to identify if the drive is a problem.
That's what I've now done. Clonezilla'd the SSD to a HDD I had lying about and swapped that in. If that solves the problem, I will try getting the SSD exchanged under warranty - although proving it's faulty might be difficult.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by gedakc »

cliveb wrote:Clonezilla'd the SSD to a HDD I had lying about and swapped that in.
If the source drive was indeed failing then the data on the drive might not be consistent. It might be worth running an fsck on the drive while it is offline. Of course that would not necessarily fix internal database corruption. For that it might be good to run the optimize_mythdb.pl script.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by cliveb »

gedakc wrote:
Fri Mar 24, 2023 7:46 pm
It might be worth running an fsck on the drive while it is offline. Of course that would not necessarily fix internal database corruption. For that it might be good to run the optimize_mythdb.pl script.
So I ran a full fsck on the SSD (took 7.5 hours, as the only convenient way to do it was attach it to a USB2 port on an old laptop).
I was kind of expecting it to find nothing, because apart from the pixelation on recordings, the system had been behaving absolutely normally. I'd have expected that if the drive had errors, sometimes that would have affected the OS and/or applications itself.
Anyhow, the fsck reported 0 bad blocks.

Next, I ran the Western Digital Dashboard (on a Windows machine) to see what that had to say about it. It reported "100% Life Remaining" and "Drive Health Normal". It didn't tell me anything about the file system on it - probably because it's ext4 (not supported by Windows). It did say there was a firmware update available, so I installed that. But from what I've read about the firmware update, it was something to do with fixing the disk not being recognised by some systems - which was never a problem.

In the meantime, I'm going to let the mythtv backend carry on with the other HDD for a while to satisfy myself that the pixelation problem has gone. If that is the case, I will re-clone it back to the WD SSD and try again. If the pixelation then comes back, I will attempt to persuade the seller to exchange it.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by cliveb »

OK, latest update.

Last night I noticed a brief moment of pixelation on the new x86 machine running the HDD (rather than the SDD). Since an fsck and the WD dashboard both showed no problems with the SSD, I think my previous suspicion that the SSD was the root of the problem is now disproved.

I am left scratching my head. I've seen infrequent brief moments of pixelation on recordings using different aerials, DVB tuners, operating systems (Raspbian and Mint), architectures (ARM and x86_64), RAM, USB ports, disks. Running backends in parallel fed from the same aerial gives pixelation on one but not the other, so it can't be interference on the aerial feed. I know it's not the frontend playback that has the problem, because I've downloaded the recordings to a laptop and played them with VLC, which shows the same pixelation.

At this stage I think the most likely cause could be that the LinuxTV layer that is extracting the programme from the raw USB data feed could have some minor bug. I've seen the same kind of pixelation on Hauppauge and Astrometa tuners (which use different chipsets and demodulators).

I am now left wondering whether a HDHomeRun might work better, but that would be quite expensive to test out. If anyone has experience of both HDHomeRun and USB DVB tuners and can offer some insight, I'm all ears.

In the meantime I have downloaded a later version of the Hauppauge tuner's firmware and will see if that makes any difference.
cliveb
Senior
Posts: 131
Joined: Fri Jan 08, 2016 9:59 am
Great Britain

Re: USB DVB tuners and the Raspberry Pi - a warning

Post by cliveb »

OK, latest update.

A few weeks ago I downloaded the latest firmware for the Hauppauge WinTV-HD tuner (version 4.0.25 from the palosaari.fi site).
Since then the pixelation is gone.
A few days ago I reinstated the SSD and all is still OK.

So it would appear that the problem was just the firmware in the tuner - nothing to do with using a Raspberry Pi, or the hard disk, or interference on the aerial signal.

One final puzzle is that whereas the old firmware was downloaded to the tuner just once at system boot, this new firmware is being downloaded to the tuner repeatedly. I don't think it's every time a recording starts, but it's certainly been done dozens of times since the last reboot. Since the system is behaving OK, I don't want to fiddle in an attempt to find out why.
Post Reply