If you need earbuds while in Spain, doesn't hurt to check the cover of a bus stop waiting area...

Here's more info about it:
"Those discarded earbuds commonly seen on the roofs of tourist bus stops in Spain—especially in cities like Barcelona—are the disposable headphones given out on open-top Hop-On Hop-Off Barcelona City Tour buses. When taking the Sightseeing tour in Barcelona, tourists simply flick or chuck their used earbuds up onto the flat shelters when leaving.
The phenomenon is essentially a localized sociological trend. Because the upper decks of these double-decker buses are at the exact same height as the bus shelter roofs, it started as a playful or lazy trend by one rider. Following the "broken window theory," once a few pairs were up there, it turned into an ongoing game or tradition for passing riders to throw theirs up as well, resulting in the famous Discarded Headphones seen all around town"