This question and similar ones shows up fairly frequently. How Did Soldiers Handle the Noise of Combat During the World Wars written by u/Georgy_K_Zhukov talks briefly about the history of ear protection (or lack thereof)
Did 18th century cannon crews use hearing protection when engaged in naval combat? written by u/zlingprinter talks about naval ships (and comes to similar conclusions as the other post)