+10000 to this. If you are using an external DAC, there will not be any difference between your laptop a raspberry pi or any other device (as long as you configure it for bit perfect). But, If you use headphone out of the laptop or if you are using a headphone out from your phone (ios or android), then you will easily notice the difference. Same goes with the optical cable. But many of us are prone to psychoacoustics based on the price/marketing bullshit of the equipment and cable. In that case you will notice (and actuall hear too) that costlier the cable or equipment the sound is better. Same goes with the price of wine or mango. The costiler ones taste better if there is very little difference in taste, colour and smell.
The no 1 culprit for bad sound is the room followed by amp and speaker. No amount of money spent on cables will solve your room problem.
NOTE: for optical cables quality will matter if you are going to transmit the audio over few kilometers. For light travelling at 299 792 458 m/s, few cms here and there and how good the glass is, light will just smash through from one end to the other end in no time regardless of the quality. And unlike electrical cables (RCA, SPDIF, etc) you don't have two enemies known as EMI, capacitance and inductance changing the frequency response characteristic of the cable.