cyclic crick noise while recording via built in S/PDIF

I have a problem of cyclic crick noise while recording with Audacity 2.2.1 via built in S/PDIF.
Start recording and after few minutes passed, cyclic crick noise appears.
Please see attached figure of the recorded waveform.
You can see the scratch noise on the time 2:13.151 and 2:13.199 of the waveform.

My environment is:

MacBook pro Early 2011
MacOS 10.10.5 Yosemite
Memory 16GB, SSD 960GB
Interface = built in S/PDIF optical audio

Audacity 2.2.1
Recording 48kHz
Buffer = 100ms(default)
Without using any audio utility such as Sound Flower.

If I record the S/PDIF audio with Audacity 2.2.1 and Apple’s QuickTime Player concurrently,
Audacity 2.2.1 records the audio with click noise while QuickTime Player records
the same audio without the noise.
Older Audacity 2.0.0 also records the audio without the noise.

Since this click noise is similar to the playback click noise which I encountered using
Audacity 2.1.0 with Sound Flower, I have tried to change the latency down to 20ms and
up to 200ms but I could not fix the problem.

Is there any known restriction?
Could you give me any suggestion to fix this problem ?
Scratch noize.png

See this FAQ in the Audacity Manual:


Thank you for your reply.

I have read the FAQ page which you suggested, then set “Prevent App Nap” checkbox. It was good for couple of days.
But finally I have encountered the click noise again at long time recording today.
I have tried to change the buffer length before, but it seemed not to be the solution.
I don’t know why the click noise disappeared for few days and appeared again.

I have never encountered for the click noise as long as using Audacity 2.0.0.
Audacity 2.0.0 seems to be safer for this point of view.