I have a parts manual for the TX2160. It shows a female splined U-joint connection on each end, retained by roll pins. I do not know if it is the same as your TX2140, but imagine it is very similar. Some tractors use a CV-joint with balls that can fall out or become worn, and disables the front drive and generates an awful grinding/popping sound.
If you lift the front axle and spin one tire, the other should rotate the opposite direction. Check for grinding etc. The driveshaft will not spin.
Then, with the tractor in 2 wheel drive, turn both front tires in the same direction. You should be able to hear the driveshaft spinning inside its cover. Listen for grinding.
Here is my thought: The parts manual for the 2160 shows that the front drive is engaged by sliding a gear forward along a shaft to engage the front axle drive, so the shaft will spin freely, driven by the front wheels. If the 4 wheel drive is disengaged and it makes noise, the problem is outside the transmission, in the driveshaft or axle. If engaging 4 wheel drive causes the sound, the trouble must be in the gear system in the transmission. Trying the tests above may help isolate the area of trouble if you aren't able to drive the tractor.
Good luck!