sound: add condition which judge whether the device is nil

Change-Id: I5d2dda358cd126fd32a7e8b91617c2e690ccff65