Swap ends of the cable. That'll tell you if it's the cable or not. The good news is that optical cables, especially the cheap ones, are light enough so once it works in position you can use any type to putty (picture mounting putty, silly putty, MoreTite) to fix it in place.