Skip to content

DSD support #796

Closed
Closed

Description

@Madman600

Is there any way to get cmus to play DSD files?

Activity

  1. criztovyl commented on Apr 26, 2018

    @criztovyl

    In theory the ffmpeg should be able to play DSD files, could you try that via ffprobe, just to be sure?

    I for example used this sample file and ffprobe your_dsd_file.dsf, produced the following output:

    $ ffprobe ~/Downloads/01\ -\ David\ Elias\ -\ The\ Window\ -\ Vision\ of\ Her\ \(DSD64\).dsf
    ffprobe version 3.3.7 Copyright (c) 2007-2018 the FFmpeg developers
    ... snip ...
    [dsf @ 0x5655579b21e0] Estimating duration from bitrate, this may be inaccurate
    Input #0, dsf, from '/home/christoph/Downloads/01 - David Elias - The Window - Vision of Her (DSD64).dsf':
      Metadata:
        title           : Vision of Her
        artist          : David Elias
        genre           : Folk
        encoder         : KORG AudioGate ver.1.5.0
        date            : 2007-11-20 22:52
      Duration: 00:05:07.11, bitrate: 5644 kb/s
        Stream #0:0: Audio: dsd_lsbf_planar, 352800 Hz, stereo, fltp, 5644 kb/s
    
    

    If it works and you compiled cmus yourself, you could add dsf to the ffmpeg.c input plugin's extensions (e.g. after "wav", or better after "flac") and then recompile cmus.

    cmus/ip/ffmpeg.c

    Lines 477 to 480 in b595b8c

    const char *const ip_extensions[] = {
    "aa", "aac", "ac3", "aif", "aifc", "aiff", "ape", "au", "fla", "flac",
    "m4a", "m4b", "mka", "mkv", "mp+", "mp2", "mp3", "mp4", "mpc", "mpp",
    "ogg", "shn", "tak", "tta", "wav", "webm", "wma", "wv",

    Otherwise this will turn into a "feature"-request.
    Maybe there even is another way link an additional extension to an input plugin without changing the source code.

  2. Madman600 commented on Apr 26, 2018

    @Madman600
    Author

    I modified the source code to do that which didn't work it sounded like it was playing super slow. Then I modified ffmpeg.c around line 238 to default to 32 bit output but that just resulted in static.

  3. Madman600 commented on Apr 26, 2018

    @Madman600
    Author

    Looks like you would have to use FLTP sample format but I'm not sure how that maps to sample format bits.

  4. criztovyl commented on Apr 26, 2018

    @criztovyl

    I am not sure either, maybe someone else can help.

  5. seniorm0ment commented on Jan 24, 2020

    @seniorm0ment

    +1 for this

  6. antonellocaroli commented on Mar 28, 2021

    @antonellocaroli

    +1

  7. hajosattila commented on Apr 20, 2024

    @hajosattila

    +1

  8. azizsayfiddin commented on May 26, 2024

    @azizsayfiddin

    +1

  9. pryid commented on May 30, 2024

    @pryid

    +1

  10. gavtroy commented on Jun 3, 2024

    @gavtroy
    Collaborator

    The ffmpeg plugin has slow playback because of the effective sample rate being unsupported. Actually 353kHz "DSD64" files work fine repeating that ffmpeg experiment today, since the latest release of cmus added support for sample rates up to 384kHz. Unfortunately "DSD128" files (effectively 706kHz) would still be broken as well as any higher variants (although >128 seems to be uncommon anyway).

    By the way I don't know anything about the "FLTP sample format" mentioned previously but I guess ffmpeg handles it under the hood because it doesn't seem to be an issue.

    Edit: yes it's resampling to S16 PCM anyway, and we can also resample to 384kHz when necessary.

  11. added a commit that references this issue on Jun 3, 2024
    928b787
  12. added a commit that references this issue on Sep 18, 2024
    353ab99
  13. added a commit that references this issue on Sep 22, 2024
    2e4850e
  14. added a commit that references this issue on Sep 22, 2024
    7423436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions