Semi-inclusive pion production and the d/u ratio