Kodi shutdown process
#1
Hi there,

I run Kodi 6.0.3 on a RPi2.
I have a 2.5" 2T HDD directly connected on the USB with a very good PSU.
Every time I shut-down/reboot Kodi/RPi, I can hear a "not so good" sound from the HDD; kind of hissing followed by click.
When I first unmount the HDD, there is not sound (HDD seams to still spin) and I shut-down/reboot, no sound happen.

After reading, this sound looks to be an HDD emergency stop. I am a bit afraid to loose the HDD and data.

So, is there a way for a user/I to add a delay between the unmount and the USB power off in the shut-down process?
If not, is it possible to get a special built with a ~500ms delay for a try?

Thanks

PS: Please don't ask why I shut-down RPi ;-)
Config, video/audio player:
3T HDD <USB> Odroid N2+ / CoreElec <HDMI> Denon AVR-2313 <HDMI> LG TV 55UF860V
                                          <nfs wired> Linksys WRT32X router <USB> 4T HDD
Reply
#2
If you're connected directly to the usb port of the Pi, then that's the issue. Hard drive isn't getting enough power. You can set /boot/config.txt with

Code:
max_usb_current=1

But that still might not be enough. Using an external drive works best with a powered usb hub. Then that's plugged into the Pi.
Reply
#3
Most external 3.5" enclosures come with a power supply so i'd plug that into the enclosure and not rely on the RPi USB supply trying to provide the required current. So if your enclosure comes with its own power supply use it. If it's a 2.5" drive then a powered USB hub or the earlier mentioned co fig.txt change should be ok.

As to HDD sounds, if you still have them when fully powered then your HDD could be failing. The manufacture may have some tools that you can use on a PC to check the internal (smart) counters which will indicate if there is a problem. If it's been making uglly sounds for a while and the smart counters show some concerns i'd consider getting another HDD.

In anycase to protect from data loss, you need a backup system in place...
I'm a XBMC novice :)
Reply
#4
Thanks for your answers but,

max_usb_current=1 is done and I have consider the PSU issue but I don't think at all this is that. PSU is Samsung ETA-U90EBE, values are:
Code:
Load R   I@5V    PSU output    RPi USB outside connector
ohms       A        V              V
0         0        5.11           5.10
40        0.125    5.2
20        0.25     5.2            5.06
10        0.5      5.27           5.00
5         1        5.35           4.86
3.33      1.5      5.47           4.58
2.5       2        5.60
2         2.5      4.78
However It could be the USB output limitation, even I did the hack.
See this thread for more info about what I did.
I don't think RPi2+HDD could need 1.5A just in shutdown time, they works fine when playing.

So, I'd like to try to pause between unmount and power cut and I don't have the answer to my question:
Is there a way for a user/I to add a delay between the unmount and the USB power off in the shut-down process?
If not, is it possible to get a special built with a ~500ms delay for a try?

Any answer?

Thanks

Edit: I did a check on the HDD SMART: No issue (so far!)
Config, video/audio player:
3T HDD <USB> Odroid N2+ / CoreElec <HDMI> Denon AVR-2313 <HDMI> LG TV 55UF860V
                                          <nfs wired> Linksys WRT32X router <USB> 4T HDD
Reply
#5
Were you able to solve this by any chance?

I am also looking for something like this. I just have an external 2.5" hdd connected to Rpi. All works fine with max_usb_current=1 while playing and accessing contents from hdd. Just need some solution for shutdown process. I am reluctant to add a powered usb hub just for 1 HDD. As Rpi has got 4 usb ports and there is enough power.
LibreELEC v8.2.1 + Rpi 3
Android s912 (kodi v17.6)
Reply
#6
When you mentioned a clicking sound, I automatically associate that with not enough juice to spin the drive. Most cases where the external drive isn't getting enough power, it clicks. I had the same with my WD Passport plugged directly to the Pi one day. It worked for a few days just fine.. then started clicking, and fsck errors at boot time. Plugged directly in my powered hub and it went away.

By what I read, you have the drive connected directly to the Pi, with a good power supply.. for the Pi. Not an external power supply for the drive. What is the power supply rating? What else is connected to the Pi? My hifiberry dac+ seems to use some juice, and the usb wifi dongle seemed to be the extra drain that caused my drive issues when connected directly. I have a 2.1A supply.

As for powering down the drive itself when connected through a hub.. as it will always be powered otherwise, I'm planning on a 5V 5A supply, hard wired to both my 7-port usb hub, and the Pi's power port itself. I have a Hauppauge 950Q tuner, a usb ssd drive for the os, the WD Passport for my music and movie storage, a usb stick turned to swap, a keyboard and mouse dongle, my wifi dongle, and my hifiberry dac+ sound card. Right now I'm using 2 separate supplies.. 2.1A for the Pi, and 2A for the hub. I figure 5A should be good for both of them. I then plan on building a simple arduino based remote power switch, with relays, that will both power on, and power off using the remote. That will control the power to the external drives. Then again.. I've read it's the powering on and off that shortens their life span, and being constantly powered is actually a good thing. It's the internet.. it must be true. Tongue
Reply
#7
(2016-05-02, 01:17)greenbag Wrote: When you mentioned a clicking sound, I automatically associate that with not enough juice to spin the drive. Most cases where the external drive isn't getting enough power, it clicks. I had the same with my WD Passport plugged directly to the Pi one day. It worked for a few days just fine.. then started clicking, and fsck errors at boot time. Plugged directly in my powered hub and it went away.

By what I read, you have the drive connected directly to the Pi, with a good power supply.. for the Pi. Not an external power supply for the drive. What is the power supply rating? What else is connected to the Pi? My hifiberry dac+ seems to use some juice, and the usb wifi dongle seemed to be the extra drain that caused my drive issues when connected directly. I have a 2.1A supply.

As for powering down the drive itself when connected through a hub.. as it will always be powered otherwise, I'm planning on a 5V 5A supply, hard wired to both my 7-port usb hub, and the Pi's power port itself. I have a Hauppauge 950Q tuner, a usb ssd drive for the os, the WD Passport for my music and movie storage, a usb stick turned to swap, a keyboard and mouse dongle, my wifi dongle, and my hifiberry dac+ sound card. Right now I'm using 2 separate supplies.. 2.1A for the Pi, and 2A for the hub. I figure 5A should be good for both of them. I then plan on building a simple arduino based remote power switch, with relays, that will both power on, and power off using the remote. That will control the power to the external drives. Then again.. I've read it's the powering on and off that shortens their life span, and being constantly powered is actually a good thing. It's the internet.. it must be true. Tongue

Well I have the official raspberry power supply with 5V 2A connected to Rpi2. I got 1 portable hdd and usb wifi dongle. During normal operation, there is no clicking sound. I have been using same setup since an year now. Even if I connect an usb thumbdrive to transfer some data some times, all works flawlessly. There is no extra drain which can cause the drive to be unmounted. So my assumption is that there is enough juice to power all 3 peripherals. Thus only 1 hdd and wifi dongle should not be any issue.

The clicking sound is only heard when I power off the Rpi, which I think and agree with OP that is due to the power cutoff before the drive in unmounted. So the hdd is still in operation and spinning when power is cutoff.

I hope that makes sense.
LibreELEC v8.2.1 + Rpi 3
Android s912 (kodi v17.6)
Reply
#8
(2016-05-02, 01:38)ace310 Wrote:
(2016-05-02, 01:17)greenbag Wrote: When you mentioned a clicking sound, I automatically associate that with not enough juice to spin the drive. Most cases where the external drive isn't getting enough power, it clicks. I had the same with my WD Passport plugged directly to the Pi one day. It worked for a few days just fine.. then started clicking, and fsck errors at boot time. Plugged directly in my powered hub and it went away.

By what I read, you have the drive connected directly to the Pi, with a good power supply.. for the Pi. Not an external power supply for the drive. What is the power supply rating? What else is connected to the Pi? My hifiberry dac+ seems to use some juice, and the usb wifi dongle seemed to be the extra drain that caused my drive issues when connected directly. I have a 2.1A supply.

As for powering down the drive itself when connected through a hub.. as it will always be powered otherwise, I'm planning on a 5V 5A supply, hard wired to both my 7-port usb hub, and the Pi's power port itself. I have a Hauppauge 950Q tuner, a usb ssd drive for the os, the WD Passport for my music and movie storage, a usb stick turned to swap, a keyboard and mouse dongle, my wifi dongle, and my hifiberry dac+ sound card. Right now I'm using 2 separate supplies.. 2.1A for the Pi, and 2A for the hub. I figure 5A should be good for both of them. I then plan on building a simple arduino based remote power switch, with relays, that will both power on, and power off using the remote. That will control the power to the external drives. Then again.. I've read it's the powering on and off that shortens their life span, and being constantly powered is actually a good thing. It's the internet.. it must be true. Tongue

Well I have the official raspberry power supply with 5V 2A connected to Rpi2. I got 1 portable hdd and usb wifi dongle. During normal operation, there is no clicking sound. I have been using same setup since an year now. Even if I connect an usb thumbdrive to transfer some data some times, all works flawlessly. There is no extra drain which can cause the drive to be unmounted. So my assumption is that there is enough juice to power all 3 peripherals. Thus only 1 hdd and wifi dongle should not be any issue.

The clicking sound is only heard when I power off the Rpi, which I think and agree with OP that is due to the power cutoff before the drive in unmounted. So the hdd is still in operation and spinning when power is cutoff.

I hope that makes sense.

I'd still try a 2.1A. But that's just me.


edit: your official RPi 2A power supply, wasn't meant for an external drive to be connected. The entire unit uses the most power when starting up and turning off. When you connect a usb drive to the system, the hard drive isn't running full speed, so isn't using maximum power draw. 2A may be the bare minimum your system needs. All the threads you come across about connecting an external drive, all say a 2.1A minimum. That 100 mA may just be the difference.
Reply
#9
And it's not the usb port shutting down before the Pi itself. A lot of us have the os on the external drive.. if the usb port shut down early, we'd be faced with corrupted os disks. the difference, is we use a powered hub.
Reply
#10
(2016-05-02, 02:42)greenbag Wrote: I'd still try a 2.1A. But that's just me.


edit: your official RPi 2A power supply, wasn't meant for an external drive to be connected. The entire unit uses the most power when starting up and turning off. When you connect a usb drive to the system, the hard drive isn't running full speed, so isn't using maximum power draw. 2A may be the bare minimum your system needs. All the threads you come across about connecting an external drive, all say a 2.1A minimum. That 100 mA may just be the difference.

I would disagree with you on that. When I am coping files from a thumbdrive to HDD both are running using the same shared power supply. All the media folders are on HDD. SD card only has the OS. And while watching a video from HDD would use maximum power as well. And that never causes any crash or warnings of low power.
LibreELEC v8.2.1 + Rpi 3
Android s912 (kodi v17.6)
Reply
#11
I wish you luck then.
Reply
#12
Thank you for your answers but I'd like to add:

First, I provided values and link about the PSU and about the voltage at the USB outside (what the external device see)
Everybody can argue about the possible lake of voltage when playing but the issue is ONLY at the Kodi power-down and not when I unmount before. So could you explain?

I know I could use another PSU for the HDD, I know I could use another hardware instead of RPi, I know I could even use another media player software. This is not the point.

The point is ace310 and I would be very glad to try a way to unmount the HDD before to power-down, or in the shut-down process with a delay or with a direct short-cut to unmount chained to the shut-down.

I found there is no short-cut to unmount the HDD in Keymap Editor nor in Command add-on. There is a way in the GUI with the contextual menu but nothing else.
See here my other thread.
Why? This could be helpful when one want to replace the media storage in safety.

I tried to find info on the shut-down process unsuccessfully. I would be glad to get a link to it, I could try to understand the code.
As I said, I'd guess it could be easy to add a pause (0.5 to 1 s) to try.

So thanks in advance to anybody who could lead to an answer to the questions.
Config, video/audio player:
3T HDD <USB> Odroid N2+ / CoreElec <HDMI> Denon AVR-2313 <HDMI> LG TV 55UF860V
                                          <nfs wired> Linksys WRT32X router <USB> 4T HDD
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi shutdown process0