{"id":309,"date":"2016-01-08T13:23:00","date_gmt":"2016-01-08T19:23:00","guid":{"rendered":"http:\/\/www.rollofone.com\/?p=309"},"modified":"2017-10-05T13:57:08","modified_gmt":"2017-10-05T18:57:08","slug":"playing-dsd-files-directly-on-linux","status":"publish","type":"post","link":"https:\/\/www.rollofone.com\/?p=309","title":{"rendered":"Playing DSD files directly on Linux"},"content":{"rendered":"<p><em>A lot of people believe DSD to be the format of choice when it comes to real high quality audio. If the provenance is right (e.g. if it has been recorded directly to DSD) DSD will deliver an amazing sound experience (see the differences between digital audio formats) . If you are a Linux user, you can use a modified MPD sound server to play DSD data. But it\u2019s a bit of overkill for those of us who don\u2019t want a complex sound server just to send a DSD \/DSF files to an USB DA<\/em><em>C. Here\u2019s how you can play those files with ffmpeg and some glue.<\/em><\/p>\n<p>To be honest: I don\u2019t like to move files around, refresh servers or create playlists. I am old fashioned. I just type play this or play that and I expect sound to come from my speakers. So far \u2013 this works great with FLACs, MP3s or WAVs. Not so good for DSD or DSF files. Quit frankly \u2013 I didn\u2019t find anything to work -out of the box- on my little Linux laptop. While ffmpeg is able to decode dsd, it is still missing the crucial part to convert the audio into DOP (dsd over pcm).<\/p>\n<p>Believe me \u2013 i tried<a href=\"http:\/\/www.rollofone.com\/wp-content\/uploads\/2016\/01\/dsdx600-300x130_weg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-315 alignleft\" src=\"http:\/\/www.rollofone.com\/wp-content\/uploads\/2016\/01\/dsdx600-300x130_weg.png\" alt=\"dsdx600-300x130_weg\" width=\"300\" height=\"130\" \/><\/a> almost everything. I even sent a \u201cmayday\u201d over the ffmpeg mailing list \u2013 but .. to no avail (yet). So \u2013 if everything else fails \u2013 one has to sit down and find the solution herself.<\/p>\n<p><strong>Here\u2019s what we want:<\/strong><\/p>\n<p>A converter that converts a DSD file into a DOP file and pushes this DOP data over alsa to a USB dac. Well \u2013 there\u2019s <a href=\"https:\/\/code.google.com\/p\/dsf2flac\/\">DSF2FLAC<\/a> and this little tools has a neat feature: It allows to pack DOP files into the Flac-Container.<\/p>\n<p><code>dsf2flac -d -r 176400 -i thedsdaudio.dsf -o thedsdaudio.flac<\/code><\/p>\n<p>Cool. Took about another hour or so to be able to play that flac via ffmpeg.<\/p>\n<p><code>ffmpeg -i thedsdaudio.flac -r 176400 -c pcm_s32le\u00a0 -f alsa hw:1<\/code><\/p>\n<p>Voila. The DSD light on my DAC turns on and I am happy. But not happy enough. It takes time to convert a DSD into a flac. And I don\u2019t wont to wait. So \u2013 I went ahead and patched dsf2flac to be able to dump the DOP data to stdout.<\/p>\n<p>So, it looks like that now:<\/p>\n<p><code>dsf2flac -d -r 176400 -i thedsdaudio.dsf -o - 2&gt;\/dev\/null\u00a0 | ffmpeg -i - -r 176400<br \/>\n-c pcm_s32le\u00a0 -f alsa hw:1<\/code><\/p>\n<p>Now we\u2019re talking. No more MPD. Knit yourself a little shell script around it and you are ready to go.<\/p>\n<p>Here\u2019s the <a href=\"http:\/\/blog.michaelamerz.com\/data\/main.cpp\">replacement main.cpp<\/a> that you should copy over the original before compiling.<\/p>\n<p>That\u2019s all folks. Have fun.<\/p>\n<p><strong>UPDATE: I have found &#8220;<a href=\"https:\/\/sourceforge.net\/projects\/deadbeef\/\" target=\"_blank\">deadbeef<\/a>&#8221; and downloaded the pre-compiled binary from sourceforge. Didn&#8217;t really expect it to work out of the box on my Centos7 computer. But it did. And it plays DSD just fine. We&#8217;ve got ourselves a solution to play DSD on Linux.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A lot of people believe DSD to be the format of choice when it comes to real high quality audio. If the provenance is right (e.g. if it has been recorded directly to DSD) DSD will deliver an amazing sound experience (see the differences between digital audio formats) . If you are a Linux user, <a href=\"https:\/\/www.rollofone.com\/?p=309\" rel=\"nofollow\"><span class=\"sr-only\">Read more about Playing DSD files directly on Linux<\/span>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":1045,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[5,15,13,14],"class_list":["post-309","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical","tag-dsd","tag-ffmpeg","tag-lunux","tag-mpd"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309"}],"version-history":[{"count":11,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":2268,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions\/2268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=\/wp\/v2\/media\/1045"}],"wp:attachment":[{"href":"https:\/\/www.rollofone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rollofone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}