I have a 2008 X3 (3.0si with the N52B30 engine) with about 65k miles on it. Recently, the car started exhibiting two symptoms: starting the car is a problem and once it does start it runs rough at idle. During starting, the starter cranks but no start for a long time (10-15 seconds). It sounds like no spark or no fuel. However after about 10-15 seconds it does fire up. Occasionally, after the prolonged startup I do get an intermittent 2A94 error code so I replaced the crankshaft sensor (not the camshaft sensor). However, no change in behavior. The starts are still excessively long. Engine temperature does not seem to matter. Then there is the rough idle. The rough engine RPM only happens at idle. When I connect my Enginuity scan tool, it confirms that the engine goes into Idle when the rough RPM occurs. As soon as I touch the throttle, the RPM stabilizes and it runs as smooth as ever at any RPM. I was able to capture the spark advance plot when the engine runs rough and it does correlate with the irregular RPM. It's all over the place from -7 to 32 degrees. Again, when any throttle is added, the spark advance levels off perfectly and the engine runs as smooth as butter. Here is the plot of the erratic spark advance values. I get no other error codes. I've looked for any obvious vacuum leaks but could find nothing. Any help as to what to go after would be greatly appreciated.