Search Results

Search found 11 results on 1 pages for 'volting'.

Page 1/1 | 1 

  • Video capture Performance

    - by volting
    I have noticed high CPU utilization in a number of applications (except mplayer) which read from the embedded webcam on my laptop. Bizarrely CPU utilization varies proportionately to the level of illumination present. I know that that high CPU usage has nothing to do with rendering the video, as I have written a simple app using the OpenCV library to simply grab frames from the webcam, and cpu usage is still high. I think that mplayer might be using my GPU (and the other apps aren't), but since its not an issue with rendering, I dont think this explains anything. Cheese Low light --- ~12% CPU Bright Light ---- ~63% CPU Camorama Low light --- ~7% CPU Bright Light ---- ~30% CPU Opencv C++ library, (display in a single highgui window) Low light --- ~13% CPU Bright Light ---- ~40% CPU (same test on windows 7, 4-9%) Mplayer No problem, 1-2% regardless of light levels Note: If all I want't to do is capture a feed from my webcam I would use mplayer and forget about it, but I'm developing an application which uses the OpenCV to capture a video feed among other things, performance is important.

    Read the article

  • Corrupted NTFS Drive showing multiple unallocated partitions

    - by volting
    My external hdd with a single NTFS partition was accidentaly plugged out (kids!)... and is now corrupted. Iv tried running ntfsfix - with no luck - output below.. When I look at the disk under disk management in Windows 7 it shows up as having 5 partitions 2 of which are unallocated - none have drive letters and it is not possible to set any (that option and most others are greyed out) - so I can't run chkdsk /f Iv tried using Minitool partition wizard which was mentioned as a solution to another similar question here. It showed the whole drive as one partition, but as unallocated, and the option -- "Check File System" was greyout. Is there anything else I could try ? Output of fdisk -l Disk /dev/sdb: 1500.3 GB, 1500299395072 bytes 255 heads, 63 sectors/track, 182401 cylinders, total 2930272256 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytest I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x69205244 This doesn't look like a partition table Probably you selected the wrong device. Device Boot Start End Blocks Id System /dev/sdb1 ? 218129509 1920119918 850995205 72 Unknown /dev/sdb2 ? 729050177 1273024900 271987362 74 Unknown /dev/sdb3 ? 168653938 168653938 0 65 Novell Netware 386 /dev/sdb4 2692939776 2692991410 25817+ 0 Empty Partition table entries are not in disk order Output of ntfsfix me@vaio:/dev$ sudo ntfsfix /dev/sdb Mounting volume... ntfs_mst_post_read_fixup_warn: magic: 0xffffffff size: 1024 usa_ofs: 65535 usa_count: 65534: Invalid argument Record 0 has no FILE magic (0xffffffff) Failed to load $MFT: Input/output error FAILED Attempting to correct errors... ntfs_mst_post_read_fixup_warn: magic: 0xffffffff size: 1024 usa_ofs: 65535 usa_count: 65534: Invalid argument Record 0 has no FILE magic (0xffffffff) Failed to load $MFT: Input/output error FAILED Failed to startup volume: Input/output error Checking for self-located MFT segment... ntfs_mst_post_read_fixup_warn: magic: 0xffffffff size: 1024 usa_ofs: 65535 usa_count: 65534: Invalid argument OK ntfs_mst_post_read_fixup_warn: magic: 0xffffffff size: 1024 usa_ofs: 65535 usa_count: 65534: Invalid argument Record 0 has no FILE magic (0xffffffff) Failed to load $MFT: Input/output error Volume is corrupt. You should run chkdsk. Options available with MiniTool: Related questions: How to fix a damaged/corrupted NTFS filesystem/partition without losing the data on it? Repair corrupted NTFS File System

    Read the article

  • Writing Device Drivers for Microcontrollers, where to define IO Port pins?

    - by volting
    I always seem to encounter this dilemma when writing low level code for MCU's. I never know where to declare pin definitions so as to make the code as reusable as possible. In this case Im writing a driver to interface an 8051 to a MCP4922 12bit serial DAC. Im unsure how/where I should declare the pin definitions for The CS(chip select) and LDAC(data latch) for the DAC. At the moment there declared in the header file for the driver. Iv done a lot of research trying to figure out the best approach but havent really found anything. Im basically want to know what the best practices... if there are some books worth reading or online information, examples etc, any recommendations would be welcome. Just a snippet of the driver so you get the idea /** @brief This function is used to write a 16bit data word to DAC B -12 data bit plus 4 configuration bits @param dac_data A 12bit word @param ip_buf_unbuf_select Input Buffered/unbuffered select bit. Buffered = 1; Unbuffered = 0 @param gain_select Output Gain Selection bit. 1 = 1x (VOUT = VREF * D/4096). 0 =2x (VOUT = 2 * VREF * D/4096) */ void MCP4922_DAC_B_TX_word(unsigned short int dac_data, bit ip_buf_unbuf_select, bit gain_select) { unsigned char low_byte=0, high_byte=0; CS = 0; /**Select the chip*/ high_byte |= ((0x01 << 7) | (0x01 << 4)); /**Set bit to select DAC A and Set SHDN bit high for DAC A active operation*/ if(ip_buf_unbuf_select) high_byte |= (0x01 << 6); if(gain_select) high_byte |= (0x01 << 5); high_byte |= ((dac_data >> 8) & 0x0F); low_byte |= dac_data; SPI_master_byte(high_byte); SPI_master_byte(low_byte); CS = 1; LDAC = 0; /**Latch the Data*/ LDAC = 1; }

    Read the article

  • Ignore carriage returns in scanf before data.... to keep layout of console based graphics with conio

    - by volting
    I have the misfortune of having use conio.h in vc++ 6 for a college assignment, My problem is that my graphic setup is in the center of the screen... e.g. gotoxy( getcols()/2, getrows()/2); printf("Enter something"); scanf( "%d", &something ); now if someone accidentally hits enter before they enter the "something", then the cursor gets reset to the left of the screen on the next line. Iv tried flushing the keyboard and bios buffers with fflush(stdin) and getchar(), which like I expected didn't work! Any help/ideas would be appreciated, Thanks, V

    Read the article

  • Help writing getstring function

    - by volting
    Im having some trouble writing a getstring function, this is what I have so far. Regards, V const char* getstring() { char *buffer; int i = 255; buffer = (char *)malloc(i*sizeof(char)); *buffer = getchar(); while ( *buffer != '\n' ) { buffer++; *buffer = getchar(); } *buffer = '\0'; const char* _temp = buffer; return _temp; } int main() { char* temp = getstring(); for ( ;temp++ ; *temp != '\0') { printf("%c", *temp); } return 0; }

    Read the article

  • Macros to set and clear bits

    - by volting
    Im trying to write a few simple macros to simplify the task of setting and clearing bits which should be a simple task however I cant seem to get them to work correctly. #define SET_BIT(p,n) ((p) |= (1 << (n))) #define CLR_BIT(p,n) ((p) &= (~(1) << (n)))

    Read the article

  • Problem with pointers and getstring function

    - by volting
    I am trying to write a function to get a string from the uart1. Its for an embedded system so I don't want to use malloc. The pointer that is passed to the getstring function seems to point to garbage after the gets_e_uart1() is called. I don't use pointers too often so I'm sure it is something really stupid and trivial that Im doing wrong. Regards, V int main() { char *ptr = 0; while(1) { gets_e_uart1(ptr, 100); puts_uart1(ptr); } return 0; }*end main*/ //------------------------------------------------------------------------- //gets a string and echos it //returns 0 if there is no error char getstring_e_uart1(char *stringPtr_, const int SIZE_) { char buffer_[SIZE_]; stringPtr_ = buffer_; int start_ = 0, end_ = SIZE_ - 1; char errorflag = 0; /*keep geting chars until newline char recieved*/ while((buffer_[start_++] = getchar_uart1())!= 0x0D) { putchar_uart1(buffer_[start_]);//echo it /*check for end of buffer wraparound if neccesary*/ if(start_ == end_) { start_ = 0; errorflag = 1; } } putchar_uart1('\n'); putchar_uart1('\r'); /*check for end of buffer wraparound if neccesary*/ if(start_ == end_) { buffer_[0] = '\0'; errorflag = 1; } else { buffer_[start_++] = '\0'; } return errorflag; } Update: I decided to go with approach of passing a pointer an array to the function. This works nicely, thanks to everyone for the informative answers. Updated Code: //------------------------------------------------------------------------- //argument 1 should be a pointer to an array, //and the second argument should be the size of the array //gets a string and echos it //returns 0 if there is no error char getstring_e_uart1(char *stringPtr_, const int SIZE_) { char *startPtr_ = stringPtr_; char *endPtr_ = startPtr_ + (SIZE_ - 1); char errorflag = 0; /*keep geting chars until newline char recieved*/ while((*stringPtr_ = getchar_uart1())!= 0x0D) { putchar_uart1(*stringPtr_);//echo it stringPtr_++; /*check for end of buffer wraparound if neccesary*/ if(stringPtr_ == endPtr_) { stringPtr_ = startPtr_; errorflag = 1; } } putchar_uart1('\n'); putchar_uart1('\r'); /*check for end of buffer wraparound if neccesary*/ if(stringPtr_ == endPtr_) { stringPtr_ = startPtr_; *stringPtr_ = '\0'; errorflag = 1; } else { *stringPtr_ = '\0'; } return errorflag; }

    Read the article

  • How to achieve interaction between GUI class with logic class

    - by volting
    Im new to GUI programming, and haven't done much OOP. Im working on a basic calculator app to help me learn GUI design and to brush up on OOP. I understand that anything GUI related should be kept seperate from the logic, but Im unsure how to implement interaction between logic an GUI classes when needed i.e. basically passing variables back and forth... Im using TKinter and when I pass a tkinter variable to my logic it only seems to hold the string PY_VAR0. def on_equal_btn_click(self): self.entryVariable.set(self.entryVariable.get() + "=") calculator = Calc(self.entryVariable) self.entryVariable.set(calculator.calculate()) Im sure that im probably doing something fundamentally wrong and probabaly really stupid, I spent a considerable amount of time experimenting (and searching for answers online) but Im getting no where. Any help would be appreciated. Thanks, V The Full Program (well just enough to show the structure..) import Tkinter class Gui(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent = parent self.initialize() def initialize(self): self.grid() self.create_widgets() """ grid config """ #self.grid_columnconfigure(0,weight=1,pad=0) self.resizable(False, False) def create_widgets(self): """row 0 of grid""" """Create Text Entry Box""" self.entryVariable = Tkinter.StringVar() self.entry = Tkinter.Entry(self,width=30,textvariable=self.entryVariable) self.entry.grid(column=0,row=0, columnspan = 3 ) self.entry.bind("<Return>", self.on_press_enter) """create equal button""" equal_btn = Tkinter.Button(self,text="=",width=4,command=self.on_equal_btn_click) equal_btn.grid(column=3, row=0) """row 1 of grid""" """create number 1 button""" number1_btn = Tkinter.Button(self,text="1",width=8,command=self.on_number1_btn_click) number1_btn.grid(column=0, row=1) . . . def on_equal_btn_click(self): self.entryVariable.set(self.entryVariable.get() + "=") calculator = Calc(self.entryVariable) self.entryVariable.set(calculator.calculate()) class Calc(): def __init__(self, equation): self.equation = equation def calculate(self): #TODO: parse string and calculate... return self.equation if __name__ == "__main__": app = Gui(None) app.title('Calculator') app.mainloop()

    Read the article

  • How to verify power provided to processors is clean

    - by GregC
    Once in a blue moon, I am seeing a blue screen of death on a shiny new Dell R7610 with a single 1100 Watt Dell-provided power supply on a beefy UPS. BCode is 101 (A clock interrupt was not received...), which some say is caused by under-volting a CPU. Naturally, I would have to contact Dell support, and their natural reaction would be to replace a motherboard, a power supply, or CPU, or a mixture of the above components. In synthetic benchmarks, system memory and CPU, as well as graphics memory and CPU perform admirably, staying up for hours and days. My questions are: Is power supply good enough for the application? Does it provide clean enough power to VRMs on the motherboard? Are VRMs good enough for dual Xeon E5-2665? Does C-states logic work correctly? Is there sufficient current provided to PCIe peripherals, such as disk controllers? P.S. Recently, I've gone through the ordeal with HP. They were nice and professional about it, but root cause was not established, and the HP machine still is less than 100%, giving me a blue screen of death once in a couple of months. Here's what quick web-searching turns up: http://www.sevenforums.com/bsod-help-support/35427-win-7-clock-interrupt-bsod-101-error.html#post356791 It appears Dell has addressed the above issue by clocking PCIe bus down to 5GT/sec in A03 BIOS. My disk controllers support PCIe 3.0, meaning that I would have to re-validate stability. Early testing shows improvements. Further testing shows significant decrease in performance on each of the x16 slots with Dell R7610 with A03 BIOS. But now it's running stable. HP machine has received a microcode update in September 2013 SUM (July BIOS) that makes it stable.

    Read the article

1