Default [Q] Please help! samsung s2 i9100 camera unknown error

My s2 has this error. Unknown error and then close the camera application. The front cam works well. I dont know what the error is. I tried factory reset, put my phone in safe mode, clear cache, etc. When I tried factory test, 'data line fail' occcurs when press the megacam test. Please help me fix this error. Also want to know of that error is a software or hardware error. Thanks