write DTS, based on patch by Luca Abeni, lucabe72 email it