Is it possible that something is wrong with the spark, like possibly a coil pack? If you are getting inadequate spark at times it could possibly lead to unburned fuel causing backfire. Or possibly a faulty computer. By no means would i start by replacing the parts that i mentioned, because i have no idea.
Here is some information a quick search got me for your codes
A code P0122 may mean that one or more of the following has happened:
TPS not mounted securely
TPS circuit short to ground or another wire
Faulty TPS
Damaged computer (PCM)
A code P0325 most likely means one or more of the following has happened:
The knock sensor is faulty and needs to be replaced
There is a wiring short/fault in the knock sensor circuit
p0342Possible causes
- Camshaft Position Sensor harness is open or shorted
- Camshaft Position Sensor circuit poor electrical connection
- Faulty Camshaft Position Sensor
- Faulty starter motor
- Starting system circuit
- Dead (Weak) battery
found info on engine-codes.com and obd-codes.com