Thanks to all of you guys! I will try to use LED/CDS method, but will also order few different types of digipots, and experiment with them if my first attempt fail.
If you choose to go with a digital potentiometer there is one important thing to keep in mind. That is it's internal wiper resistance.
Due to it's internal construction a digital potmeter is basically a switched resistor network. The selector that chooses the resistor according to wiper position has an internal resistance that could be around 70 ohms. So 10 mA of current through the potmeter (wiper) results in an 700 mV drop across the resistor. (just read about this in 'Mastering the I2C bus', and this thread came to mind)
So if used in the feedback path of your opamp you really need to keep this in mind.
I'll keep that in mind... thanks.
led+photoresistor approach is not that good, unless you can accept closed feedback loop and very slow settling time. Photoresistors are not linear, so you would have to build some sort of regulator measuring output signal from the amp and adjusting the LED current. This will be very slow, because photoresistors have rather high time constants.
You could use something like this: http://www.tme.eu/en/details/vtl5c10/tht-optocouplers-transistor-output/perkin-elmer/# but that kind of stuff tends to be rather expensive. For volume setting I would use digital potentiometer, as you can find many dedicated solutions. For anything of higher frequency range variable gain amplifiers are the only way to go.
I know it's not linear, but I'm planning to measure that function (LED current / CDS resistance) and try to approximate it in software, in worst case i will capture 50 points, enter them in table and then do a linear interpolation on the output of the PIC. Also, it doesn't need to be very precise or consistent, it's just for audio volume control and if the volume drift +/-10% over the period of few hours due to temperature change, etc., nobody could notice that probably.
I'm not really an expert, but I have a lot of confidence that this might work. If not, digipot is my second solution.