Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[VU+ Duo] usb stick missing from list of storage devices

  • Thread starter Thread starter edogg
  • Start date Start date
I wonder what the timeout is for the code to be called? e.g how long before it is decided that the usb stick is not being used.
 
As it is not a normal behaviour for an USB-stick to 'fall asleep', I think that that will be due to the firmware/hardware of the chipset in the pen. And hence also the duration of the period it manages to stay awake.
 
As it is not a normal behaviour for an USB-stick to 'fall asleep', I think that that will be due to the firmware/hardware of the chipset in the pen. And hence also the duration of the period it manages to stay awake.

Good point - however that raises the question of why it never happened with ViX 2.1? As I am using exactly the same sticks (a lot of other report this as well).

regards
CT
 
Good point - however that raises the question of why it never happened with ViX 2.1? As I am using exactly the same sticks (a lot of other report this as well).

I think the code was rather recently introduced in engima2 (i might be wrong).
 
Exactly so the firmware of the usb sticks shouldn't be of consideration.

Well, of course that mathers to. Otherwise all would share the same problem. For example the following usb stick
256 MB Kingston Technology DataTraveler II+ Pen Drive just ignores the command and does nothing.
 
My two pence - my new duo had problems of vanishing picons. I had settings to put the hdd to sleep in 5 min. What I did was put the hdd to sleep in 20 min and had a cron job setup every 15 min to the USB. I have a 500gb hdd and a 4gb USB wih the picons and epg. The hdd never had the problem, only the USB. Sinc making the above changes, I have not lost picons neither has my USB slept.

I am not a programmer so not sure if this logic of mine makes any cutting sense, but something for the developers to consider if they think it is worthwhile.
 
Well, of course that mathers to. Otherwise all would share the same problem. For example the following usb stick
256 MB Kingston Technology DataTraveler II+ Pen Drive just ignores the command and does nothing.

My point was... why add the command in the first place?
 
My point was... why add the command in the first place?

To spin down external usb harddrives while they are not in use. Thats the intention, though rather pointless to try to do it to usb flash sticks. But i guess there isnt an easy way to see if it is indeed a flashstick or a external harddrive.
 
Which code do you mean?

Enigma2 Harddisk.py
Code:
   # the HDD idle poll daemon.
   # as some harddrives have a buggy standby timer, we are doing this by hand here.
   # first, we disable the hardware timer. then, we check every now and then if
   # any access has been made to the disc. If there has been no access over a specifed time,
   # we set the hdd into standby.
   def readStats(self):
      try:
         l = open("/sys/block/%s/stat" % self.device).read()
      except IOError:
         return -1,-1
      data = l.split(None,5)
      return (int(data[0]), int(data[4]))

   def startIdle(self):
      self.last_access = time.time()
      self.last_stat = 0
      self.is_sleeping = False
      from enigma import eTimer

      # disable HDD standby timer
      if self.bus() == "External":
         Console().ePopen(("sdparm", "sdparm", "--set=SCT=0", self.disk_path))
      else:
         Console().ePopen(("hdparm", "hdparm", "-S0", self.disk_path))
      self.timer = eTimer()
      self.timer.callback.append(self.runIdle)
      self.idle_running = True
      self.setIdleTime(self.max_idle_time) # kick the idle polling loop

   def runIdle(self):
      if not self.max_idle_time:
         return
      t = time.time()

      idle_time = t - self.last_access

      stats = self.readStats()
      l = sum(stats)

      if l != self.last_stat and l >= 0: # access
         self.last_stat = l
         self.last_access = t
         idle_time = 0
         self.is_sleeping = False

      if idle_time >= self.max_idle_time and not self.is_sleeping:
         self.setSleep()
         self.is_sleeping = True

   def setSleep(self):
      if self.bus() == "External":
         Console().ePopen(("sdparm", "sdparm", "--flexible", "--readonly", "--command=stop", self.disk_path))
      else:
         Console().ePopen(("hdparm", "hdparm", "-y", self.disk_path))

   def setIdleTime(self, idle):
      self.max_idle_time = idle
      if self.idle_running:
         if not idle:
            self.timer.stop()
         else:
                else:
            self.timer.start(idle * 100, False)  # poll 10 times per period.

   def isSleeping(self):
      return self.is_sleeping
 
Hi Guys,
Sorry to throw a spanner in the works, but I have solved the problem on my machine and am all the happier for it.
I had the following mount:
Vu+ DUO
Device /dev/sdb1
Mount /media/usb
type ext4
I was using a 4GB Cruzer Blade, which has always worked fine on the previous kernel, but after reading pheonix's comments about a possible faulty batch, I plugged in an old unbranded 2GB stick, given free on a training course, and copied all my picons etc to it. I left it formatted FAT32, and after 2 days, the mount is still fine and all files are accessable.
The cruzer blade was initialized in the STB and converted to EXT4, but still lost the mount. It was formatted at 4GB, but only 3GB showed up on the mount, not sure if that was relevant.
As Zartmy pointed out, maybe the Cruzer Blade has more sophisticated firmware and is being put into power save by the new kernel, or maybe there is just a bad batch around.
Hopefully this will give some hope to those in the same situation.
 
Last edited by a moderator:
The obvious temporary answer is the add a user setting to allow the external standby (sdparm) to be turned off if the user is having problems. Basically allowing the sdparm command not to be issued. Long term we need to know why this is happening when it didn't in ViX 2.1 and/or why the kernal is losing the mount and not being able to restore them.

Quite honestly I'd prefer to be able to disable sleep mode for usb sticks.
 
There is indeed a kernel bug in kernel 3.x, resulting in setting all USB-storage devices to standby. Not all devices are affected by this: on many the firmware prevents this.
An easy work-around is to set HDD-idle time to 'never'.
 

OpenViX Feeds Status

Back
Top