milhouse
Posts: 641
Joined: Mon Jan 16, 2012 12:59 pm

Re: Overclocking

Wed Sep 26, 2012 8:24 am

milhouse wrote:Raspbian requires gawk (sudo apt-get install gawk) for netmon.sh.
This dependency has now been eliminated, both scripts updated and should work on "stock" installations of OpenELEC and Raspbian.

OpenELEC now updated from build r12006 onwards with nanosecond support which will improve accuracy of interval calculations (ie. RX/s, TX/s, IRQ/s) - Raspbian already supports nanosecond (ie. date +%N).

milhouse
Posts: 641
Joined: Mon Jan 16, 2012 12:59 pm

Re: Overclocking

Wed Sep 26, 2012 10:18 am

Dilligaf wrote:Just built and booted the new kernel, does this look right? BogoMIPS seems awfully low

[email protected]:~# cat /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 464.48
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 1000002

[email protected]:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
900000
Getting the same low 464.48 BogoMIPS too in the latest OpenELEC r12006:

Code: Select all

root ~ # vcgencmd version
Sep 25 2012 00:18:47
Copyright (c) 2012 Broadcom
version 339137 (release)

root ~ # uname -a
Linux rpi 3.2.30 #1 PREEMPT Wed Sep 26 04:14:37 BST 2012 armv6l GNU/Linux
My arm_freq is set to 1000.

User avatar
poglad
Posts: 100
Joined: Tue Jul 31, 2012 8:47 am
Location: Aberdeen, Scotland
Contact: Website

Re: Overclocking

Wed Sep 26, 2012 2:05 pm

Regarding the SD corruption that dom has been investigating - I too have had the problem with config.txt being corrupted and the system failing to reboot. I'm glad to find this thread, and will add the new parameter to my configuration tonight.

What I did find was that if I edit config.txt or run rpi-update, for example, and it makes changes to files in /boot then those changes all show correctly - until I actually reboot. It's as though there's write-caching going on, and the flush is failing. As long as you don't reboot, it reads from the cache and the files appear to be okay.

So what I've been doing for now, after updating or otherwise making changes to /boot, is then immediately backing up those files - in my case using WinSCP over the network to my laptop. The files back up fine, with their correct contents. I then shut down the Pi - not reboot - and put the SD card into my laptop. Then if any of the files look corrupt - and very often they do - I restore them from the back-up. Then I put the SD card back into the Pi and it boots up fine.

From what dom has been saying, and my limited knowledge and observation, it sounds like the flushing of a write cache is partially failing due to a possible timing error. I'll add the new config parameter tonight and carry on backing up for now, just in case, but would be delighted if the problem is resolved.

(I'm using turbo mode with the 1000 MHz setting selected from raspi-config).

Paul

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 2:10 pm

milhouse wrote: Getting the same low 464.48 BogoMIPS too in the latest OpenELEC r12006:

Code: Select all

root ~ # vcgencmd version
Sep 25 2012 00:18:47
Copyright (c) 2012 Broadcom
version 339137 (release)

root ~ # uname -a
Linux rpi 3.2.30 #1 PREEMPT Wed Sep 26 04:14:37 BST 2012 armv6l GNU/Linux
My arm_freq is set to 1000.
I think that is harmless, as udelay no longer uses the value from BogoMips for determining how long to wait for.
However, it looks wrong, and so I've pushed out a fix.

kevs3d
Posts: 23
Joined: Fri Sep 07, 2012 6:26 pm

Re: Overclocking

Wed Sep 26, 2012 3:21 pm

poglad wrote:Regarding the SD corruption that dom has been investigating - I too have had the problem with config.txt being corrupted and the system failing to reboot. I'm glad to find this thread, and will add the new parameter to my configuration tonight.

What I did find was that if I edit config.txt or run rpi-update, for example, and it makes changes to files in /boot then those changes all show correctly - until I actually reboot. It's as though there's write-caching going on, and the flush is failing. As long as you don't reboot, it reads from the cache and the files appear to be okay.

So what I've been doing for now, after updating or otherwise making changes to /boot, is then immediately backing up those files - in my case using WinSCP over the network to my laptop. The files back up fine, with their correct contents. I then shut down the Pi - not reboot - and put the SD card into my laptop. Then if any of the files look corrupt - and very often they do - I restore them from the back-up. Then I put the SD card back into the Pi and it boots up fine.

From what dom has been saying, and my limited knowledge and observation, it sounds like the flushing of a write cache is partially failing due to a possible timing error. I'll add the new config parameter tonight and carry on backing up for now, just in case, but would be delighted if the problem is resolved.

(I'm using turbo mode with the 1000 MHz setting selected from raspi-config).

Paul
Interesting - I was about to post something similar. Did a lot of investigation last night. I can really only corrupt the /boot FAT partition due to overclocking (on my class 10 card). I set the pi to arm1100,core500,ovolt8 and gave it a really good kicking - lots of file transfers on the linux partition, quake3 and raytracer benchmarks all running - no problems! However, as *soon* as I modify the config.txt or any other file on the /boot FAT partition I get exactly what you describe, errors, unwritten or failed to correctly write the file back - and it looks fine until you reboot. And it was rpi-update that always killed it before - and of course it writes a lot to the /boot area... I have the very latest firmware.

Cheers,

Kev
--
http://www.kevs3d.co.uk/dev - HTML5 canvas games, demos and utils.

milhouse
Posts: 641
Joined: Mon Jan 16, 2012 12:59 pm

Re: Overclocking

Wed Sep 26, 2012 3:27 pm

"It was fine until you reboot" does sound awfully familiar - I've had clean partitions, all data theoretically synced, and still the ext4 partition would be found to be corrupt during a reboot. Mind you, I've also demonstrated major carnage occurring while the system is up, yet the system seems to be entirely stable in every other respect (like you, I can hammer it as long as I don't max out the network, or write to the SD card).

Dilligaf
Posts: 283
Joined: Wed May 23, 2012 6:48 pm

Re: Overclocking

Wed Sep 26, 2012 3:39 pm

I can consistently corrupt the root partition by scanning my xbmc library, the thing is my library is on a mysql server on another machine. Only explanation I have is the cache writing to the card is corrupting it. From earlier testing (before dynamic OC) I found that changing OC settings had a huge impact on sd card read/write speeds, definitely think it's a timing issue. I have yet to corrupt my boot partition.

kevs3d
Posts: 23
Joined: Fri Sep 07, 2012 6:26 pm

Re: Overclocking

Wed Sep 26, 2012 4:07 pm

Dilligaf wrote:I can consistently corrupt the root partition by scanning my xbmc library, the thing is my library is on a mysql server on another machine. Only explanation I have is the cache writing to the card is corrupting it. From earlier testing (before dynamic OC) I found that changing OC settings had a huge impact on sd card read/write speeds, definitely think it's a timing issue. I have yet to corrupt my boot partition.
Interestingly I've found my tests (just using dd to write to from /dev/zero and tmp files) actually go *slower* when overclocked using the class 10 card. So yes caching/timing does sound like the issue but it will take the magic of dom for me to get any further i think :)
--
http://www.kevs3d.co.uk/dev - HTML5 canvas games, demos and utils.

cesarvog
Posts: 20
Joined: Fri Aug 24, 2012 12:18 pm

Re: Overclocking

Wed Sep 26, 2012 4:56 pm

I won't pretend to be a power user, when in fact I consider myself just a curious user. That being said, would trying different init_emmc_clock settings do any good trying to avoid partitions from being corrupted with the newest overclock settings/kernel?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 5:09 pm

cesarvog wrote:I won't pretend to be a power user, when in fact I consider myself just a curious user. That being said, would trying different init_emmc_clock settings do any good trying to avoid partitions from being corrupted with the newest overclock settings/kernel?
It could be worth changing it to 35000000 (i.e. 70% of original, assuming you are overclocking from 700MHz->1GHz).
That would assume the clock is being incorrectly scaled up with the arm_freq, which I don't believe it is.
You can check what the frequency is when the ARM is busy:
vcgencmd measure_clock emmc
but, it shows me 50000000, as I'd expect.

What I really need is for a number of people who are suffering the problem, to gradually wind down the overclock settings, and hopefully tell me that, e.g. core_freq > 800 causes corruption.
If I got a consensus of what the clock (or voltage) it is that is critical, I can possibly do something about it, but I've had very few useful bug reports.

pmk
Posts: 21
Joined: Wed Jun 20, 2012 5:27 pm

Re: Overclocking

Wed Sep 26, 2012 6:32 pm

If you could post some instructions on how to test and get the information you need I can do some testing over the next days or two as got some free time.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 6:54 pm

pmk wrote:If you could post some instructions on how to test and get the information you need I can do some testing over the next days or two as got some free time.
Are you currently suffering from corruption when overclock is enabled?

If so, start find the lowest overclock settings (from raspi-config) that causes corruption.
Find some activity that causes corruption. I believe running xbmc and scanning your media library is a good example.
Anything that causes the CPU to be busy (and so causes overclock to be enabled), and writes to sdcard should be a candidate.

The overclock consists of 4 lines in the config.txt file. E.g.
arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6

Try turning them down to default, one at a time. Default is:
arm_freq=700
core_freq=250
sdram_freq=400
over_voltage=0

I would suggest changing them in the order:
sdram_freq->400, core_freq->250, arm_freq->750, over_voltage->0 (this may need some of the previous 3 settings to be lowered to boot correctly).

As the corruption may cause the sdcard to not boot, you probably need to reimage the sdcard after each failure.
Boot up and use raspi-config to select an overclock level (the lowest that causes corruption). Don't reboot, but type in:

Code: Select all

sudo nano /boot/config.txt
and edit the overclock setting you are currently testing to the lower value. Then:

Code: Select all

sudo reboot
See if you can cause the sdcard to be corrupted.
I'd like to know which of the overclock settings are necessary for corruption to occur.

pmk
Posts: 21
Joined: Wed Jun 20, 2012 5:27 pm

Re: Overclocking

Wed Sep 26, 2012 6:58 pm

dom wrote:
pmk wrote:If you could post some instructions on how to test and get the information you need I can do some testing over the next days or two as got some free time.
Are you currently suffering from corruption when overclock is enabled?
I have not tried it since the problem was found but if you need it tested I can do it tomorrow

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 7:02 pm

pmk wrote:I have not tried it since the problem was found but if you need it tested I can do it tomorrow
Please try testing. However I believe the majority of people don't see the issue, so you may not find the problem.
If someone who is complaining about the issue can do the same test, that would be useful.

gogiman
Posts: 14
Joined: Tue Jul 10, 2012 6:55 am

Re: Overclocking

Wed Sep 26, 2012 7:12 pm

Hi, I was just watching this thread because I thought that this issue is happening as soon as you use turbo modes. So is this issue actually happening just rarly?

User avatar
poglad
Posts: 100
Joined: Tue Jul 31, 2012 8:47 am
Location: Aberdeen, Scotland
Contact: Website

Re: Overclocking

Wed Sep 26, 2012 7:20 pm

I will try to do this over the next couple of days.

Can I just point something out - if I have overclocked, and then I lower one of the settings and reboot, the file is being saved with my CURRENT overclocking config, but then I'm booting up with the NEW one. If the file gets corrupted (or not) when it's saved, then it was not the NEW setting that caused it to happen.

Does that make sense?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 7:27 pm

poglad wrote:Can I just point something out - if I have overclocked, and then I lower one of the settings and reboot, the file is being saved with my CURRENT overclocking config, but then I'm booting up with the NEW one. If the file gets corrupted (or not) when it's saved, then it was not the NEW setting that caused it to happen.
When you select overlock in raspi-config, nothing happens except /boot/config.txt is edited. The new overclock doesn't get applied until you reboot.
So, if the file gets corrupted at this point, it was due to the previous overclock settings.
If this file gets corrupted and this is the first boot since you imaged the sdcard, then the corruption is not overclock related.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 7:29 pm

gogiman wrote:Hi, I was just watching this thread because I thought that this issue is happening as soon as you use turbo modes. So is this issue actually happening just rarly?
I believe it is pretty rare, and possibly only affects transcend cards. I've not seen the problem (I mostly use Sandisk cards).

sam nazarko
Posts: 150
Joined: Wed Apr 25, 2012 5:05 pm

Re: Overclocking

Wed Sep 26, 2012 7:47 pm

I've seen it on Integral Class 10 and Sandisk Ultra Class 6.

It's not the clock frequency as that was fine before right? It must be the governor. I've tried every kernel iteration, including today's one with delay.s in Assembler.

I bet if one set a performance governor rather than 'ondemand' it wouldn't corrupt as the bogomips wouldn't fluctuate.

User avatar
poglad
Posts: 100
Joined: Tue Jul 31, 2012 8:47 am
Location: Aberdeen, Scotland
Contact: Website

Re: Overclocking

Wed Sep 26, 2012 7:52 pm

dom wrote:So, if the file gets corrupted at this point, it was due to the previous overclock settings.
That's what I was trying to say - because that is indeed the point at which the corruption happens for me. :D

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5370
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Overclocking

Wed Sep 26, 2012 7:53 pm

sam nazarko wrote:I've seen it on Integral Class 10 and Sandisk Ultra Class 6.

It's not the clock frequency as that was fine before right? It must be the governor. I've tried every kernel iteration, including today's one with delay.s in Assembler.

I bet if one set a performance governor rather than 'ondemand' it wouldn't corrupt as the bogomips wouldn't fluctuate.
It is possible that it is the changing of arm_clock/core_clock/sdram_clock/over_voltage, rather than the absolute level.

But I'm pretty sure it's not the governor on it's own. To prove it, you could set
temp_limit=1

That would mean the ondemand governor would still run all the time, but the GPU would limit the overclock to stock values (believing we have exceeded the temperature limit).
I'd be surprised if that failed.

Similarly, if you set:
arm_freq=710
core_freq=250
sdram_freq=400
over_voltage=0

I'd be surprised if that failed, even though ondemand governor is still running, and switching frequency.

But it is an experiment worth running.

cesarvog
Posts: 20
Joined: Fri Aug 24, 2012 12:18 pm

Re: Overclocking

Wed Sep 26, 2012 7:59 pm

Sam, how can I run vcgencmd measure_clock emmc on Raspbmc RC5?
My system doesn't sem to have bin, include, lib, sbin and src folders inside /opt/vc. Only lib is there.

sam nazarko
Posts: 150
Joined: Wed Apr 25, 2012 5:05 pm

Re: Overclocking

Wed Sep 26, 2012 8:04 pm

For the sake of minimalism I excluded bin, I should add vcgencmd as part of RC5.

Anyway

wget -q https://github.com/raspberrypi/firmware ... n/vcgencmd

cesarvog
Posts: 20
Joined: Fri Aug 24, 2012 12:18 pm

Re: Overclocking

Wed Sep 26, 2012 8:31 pm

Thanks Sam and Dom. Can't wget from the above mentioned folder. wget returns:

ERROR: The certificate of `github.com' is not trusted.
ERROR: The certificate of `github.com' hasn't got a known issuer.

Anyway, I just want to tell that my system has been streaming from the Plex Media Server successfully and I did not have any more SD card corruption. I'm using a Sandisk Extreme Pro Class 10 UHS-I. Dom, FWIW, I've tried lowering and also raising the init_emmc_clock to 35000000 and 70000000, with no SD corruption. I'm using raspberrypi-firmware-b5898de on top of Sam's Raspbcm RC5 with XBMC updated to xbmc-rbp-20120922. I've successfully tried Normal, Fast and Super profiles. Didn't try Ultimate, as I got corruption with that setting before.

PipPin
Posts: 5
Joined: Wed May 09, 2012 7:31 pm

Re: Overclocking

Wed Sep 26, 2012 9:16 pm

If anyone is interested I seem to be getting config.txt corruption when I attempt overclocking via raspi-config. My SD card is a Samsung Class 10. I'm happy to carry out some testing, but need very step-by-step instructions as I'm a near total n00b in Linux.

Return to “Advanced users”