aha, ok ! At this point many things are more clear for me ! So, ports look ok, i just need to find toslink device to test them.
Coming to the audio problem, i have the following issue.
The audio i hear from the front speaker when it is i.e. 4 dots before max output, appears distorted, rattling.
When someone speaks on Ytube, i hear his voice ok, but sometimes user pronouncing vowels and speaker
distorts sound a lot, and sounds like sudden pops in voice.
When i volume down all are fine, but then cannot hear sound well.
Volume control keys working ok, on white keyboard, before a crash occured by reading a friends pc-formatted usb flash drive. After that my mac started responding very slowly when i was moving i.e. system preferences window or other
windows GUIs on my screen. Programms were running ok though.
I noticed a soundflower option in my audio prefs and decided to uninstall it and this caused further instability to my osx Lion.
After i fixed this (i will re-format it soon though) my sound still has same problem as above
PLUS the volume buttons on keyboard are disabled. No sound at all. I have to Alt-click sound menu and select
internal speakers to activate it again. Then buttons work BUT NO clicking sounds when i volume up/down.
I tried everything (PRAM, smc, terminal commands, plugging headphones etc) and buttons and audio problem does not correct at all. Further to this, sometimes when i hear audio from i.e. youtube, i volume up/down ok and suddenly Sound is Lost. Volume buttons works ok but no sound at all from speaker. I pause, replay video, no sound until i open a new video, then sound plays ok !
Not sure now if i have to change backplane board or speakers or front board.... and apple diagnostics dont run on my lion.