Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Configuring mpd for bit-perfect playback on the Mac (Read 3265 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Configuring mpd for bit-perfect playback on the Mac

I spent way too much time trying to get mpd set up properly on my Mac, and I finally found the right output config, so I thought I would share it.

The mpd config file file is long, with lots of settings, but the "audio_output" section is what you need to configure for whatever DAC you use.

The DAC I am using is a Topping D10s. Here is the exact config I used.

Code: [Select]
audio_output {
          type            "osx"
          name            "D10s "
          device          "D10s " # optional
          mixer_type      "disabled"
          dop              "yes"

So here are the settings that drove me nuts.  The device and name lines have the name of the DAC. For some reason, Apple adds a space to the end of the DAC name. My Topping D10s displays as "D10s" in system information, but will only work in MPD if you use "D10s ". Before this, I had a Grace SDAC, and I had to add "SDAC " to my config. So, if you've been struggling with getting your DAC to work directly without using CoreAudio, add the space.

The second setting is dop. dop is DSD over PCM. If you enable that, then mpd will play DSD natively on your DAC, if it supports it.

To be clear, I am convinced that 16/44.1 is as good as your ear can hear. But I wanted to find a way for the MAc to be able to auto-switch sample rates on the DAC. Most Mac music players won't do that, and the ones that do, cost money.

I couldn't let all you PC people using foobar2000 have all the fun.  :-)

I hope someone finds this useful.

 

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #1
The space is there because the vendor probably included it in the USB device name, and Apple isn't removing padding.

DeaDBeeF can switch the sample rate. Note that switching sample rates is not seamless, so you would lose gapless playback any time the sample rate changes.

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #2
The same DAC on the same Mac in Linux does not have a space when I set up the mpd config.

Do you think the Linux kernel removes the space?

I tried 3 different DACs on the Mac and they all had an extra space at the end of them.

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #3
That, or the macOS port of mpd adds it.

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #4
It's the MacOS doing it.  Here is my output from System Profiler:


Re: Configuring mpd for bit-perfect playback on the Mac

Reply #5
I can't run that command here:

Code: [Select]
% system_profiler SPAudioDataType
libc++abi: terminating with uncaught exception of type CAException

Running it without the option, it doesn't output an Audio: section.

EDIT 1: Aha, deleting the Steam Streaming audio HAL drivers and restarting Core Audio, I get output now:

Code: [Select]
Audio:

    Devices:

        LG Ultra HD:

          Manufacturer: GSM
          Output Channels: 2
          Current SampleRate: 48000
          Transport: DisplayPort
          Output Source: Default

        Yeti Stereo Microphone:

          Manufacturer: Blue Microphones
          Output Channels: 2
          Current SampleRate: 48000
          Transport: USB
          Output Source: Default

        Yeti Stereo Microphone:

          Default Input Device: Yes
          Input Channels: 2
          Manufacturer: Blue Microphones
          Current SampleRate: 44100
          Transport: USB
          Input Source: Default

        HD Webcam C615:

          Input Channels: 1
          Manufacturer: Unknown Manufacturer
          Current SampleRate: 48000
          Transport: USB
          Input Source: Default

        External Headphones:

          Default Output Device: Yes
          Default System Output Device: Yes
          Manufacturer: Apple Inc.
          Output Channels: 2
          Current SampleRate: 44100
          Transport: Built-in
          Output Source: External Headphones

        Mac mini Speakers:

          Manufacturer: Apple Inc.
          Output Channels: 2
          Current SampleRate: 48000
          Transport: Built-in
          Output Source: Mac mini Speakers

Edit 2: Linux kernel trims the names: https://github.com/torvalds/linux/blob/master/sound/usb/card.c#L514

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #6
Nice to meet another user of both Mac and Linux hardware.

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #7
I spent way too much time trying to get mpd set up properly on my Mac, and I finally found the right output config, so I thought I would share it.

The mpd config file file is long, with lots of settings, but the "audio_output" section is what you need to configure for whatever DAC you use.

The DAC I am using is a Topping D10s. Here is the exact config I used.

Code: [Select]
audio_output {
          type            "osx"
          name            "D10s "
          device          "D10s " # optional
          mixer_type      "disabled"
          dop              "yes"

So here are the settings that drove me nuts.  The device and name lines have the name of the DAC. For some reason, Apple adds a space to the end of the DAC name. My Topping D10s displays as "D10s" in system information, but will only work in MPD if you use "D10s ". Before this, I had a Grace SDAC, and I had to add "SDAC " to my config. So, if you've been struggling with getting your DAC to work directly without using CoreAudio, add the space.
...
I hope someone finds this useful.

Your post turned out to the most important post in getting mpd working on my 2012 mac mini. I have been a linux mpd user since ages. My current setup consists of a RPI4 with a 3Tb hard drive connected having the music_folder. I use the simple database plugin. All other mpd instances use the proxy database plugin and also mount the music folder nfs4. Recently I decided to re-purpose my mac mini to run mpd. The first problem was to get mpd with the proxy plugin compiled in. Second issue was to play all formats. Ultimately I managed to compile mpd with almost all features supported by Linux. The stumbling block was choppy audio. This got resolved by changing the audio_output to ao from osx. But I'm not sure about how good the ao plugin is. So I was looking for a way to use device names (Now I know thanks to this post - using the system_profiler SPAudioDataType command).

Code: [Select]
audio_output {
          type            "osx"
          name            "CoreAudio"
          mixer_type      "software"

On my linux devices, I use mpd to directly output to the audio devices unlike the above. So I made an entry for my dac like yours and now even with device type as "osx", I'm getting music without any latency or choppy audio. Thank you. Now my mpd.conf entry is like this (for some reason Mac reports the DAC name as "Speaker". Linux reports correctly as Xonar Essence One and device name as hw:One)

Code: [Select]
audio_output {
    type            "osx"
    name            "xonar essenceone"
    device          "Speaker"
    format          "*:32:2"
    mixer_type      "software"
    dop             "yes"
 }

Re: Configuring mpd for bit-perfect playback on the Mac

Reply #8
I spent way too much time trying to get mpd set up properly on my Mac, and I finally found the right output config, so I thought I would share it.

The mpd config file file is long, with lots of settings, but the "audio_output" section is what you need to configure for whatever DAC you use.

The DAC I am using is a Topping D10s. Here is the exact config I used.

Code: [Select]
audio_output {
          type            "osx"
          name            "D10s "
          device          "D10s " # optional
          mixer_type      "disabled"
          dop              "yes"

So here are the settings that drove me nuts.  The device and name lines have the name of the DAC. For some reason, Apple adds a space to the end of the DAC name. My Topping D10s displays as "D10s" in system information, but will only work in MPD if you use "D10s ". Before this, I had a Grace SDAC, and I had to add "SDAC " to my config. So, if you've been struggling with getting your DAC to work directly without using CoreAudio, add the space.
...
I hope someone finds this useful.

Your post turned out to the most important post in getting mpd working on my 2012 mac mini. I have been a linux mpd user since ages. My current setup consists of a RPI4 with a 3Tb hard drive connected having the music_folder. I use the simple database plugin. All other mpd instances use the proxy database plugin and also mount the music folder nfs4. Recently I decided to re-purpose my mac mini to run mpd. The first problem was to get mpd with the proxy plugin compiled in. Second issue was to play all formats. Ultimately I managed to compile mpd with almost all features supported by Linux. The stumbling block was choppy audio. This got resolved by changing the audio_output to ao from osx. But I'm not sure about how good the ao plugin is. So I was looking for a way to use device names (Now I know thanks to this post - using the system_profiler SPAudioDataType command).

Code: [Select]
audio_output {
          type            "osx"
          name            "CoreAudio"
          mixer_type      "software"

On my linux devices, I use mpd to directly output to the audio devices unlike the above. So I made an entry for my dac like yours and now even with device type as "osx", I'm getting music without any latency or choppy audio. Thank you. Now my mpd.conf entry is like this (for some reason Mac reports the DAC name as "Speaker". Linux reports correctly as Xonar Essence One and device name as hw:One)

Code: [Select]
audio_output {
    type            "osx"
    name            "xonar essenceone"
    device          "Speaker"
    format          "*:32:2"
    mixer_type      "software"
    dop             "yes"
 }


I installed mpd via homebrew (https://brew.sh), and that version has satellite support compiled in. The only thing that version can't seem to do is read files from an SMB share.  I needed to use nfs.

I'm glad this post was helpful.