White powdery stuff is a sign of excess calcium in the urine, which has been implicated in urinary tract stones. Here's a start on how to reduce it or get rid of it altogether:
If you're feeding romaine lettuce, switch to red or green leaf lettuce. Romaine isn't any higher in calcium than the others, but some pigs will have powdery/sludgy urine when fed romaine.
Some greens are much higher than others in calcium, or have too many oxalates and too much vitamin A, and should be fed only sparingly. Check
https://www.guineapigcages.com/foru...y-nutrition-charts-poisonous-plants-list.html for what can be fed when.
If that doesn't work, the pellets are next. Some pigs will have powdery/sludgy urine when fed Oxbow pellets, while others eat them all their lives with no problems. But if you're feeding Oxbow, switch to Kleenmama (order from (broken link removed)) and see if that helps.
If your water is hard, put a filter on the faucet or buy a pitcher with a filter. Vets in the south of England often recommend filtering water because of the high limestone concentration there. Do not use distilled water -- you don't want to take all the minerals out, just reduce the calcium content.
If all that fails, you may need to really dig into the diet and see exactly how much calcium is being fed. Let us know if you get to that point, and I'll have some more suggestions.
For me, stopping the romaine was all it took to get rid of the white spots. Others have more difficulty, and some pigs will just excrete excess calcium no matter what you do. It's probably a genetic thing, but it's not well understood.