INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Streaming HD audio distorted [Solved]  (Read 2080 times)

dpfels

  • Recent member
  • *
  • Posts: 21
Streaming HD audio distorted [Solved]
« on: May 09, 2023, 08:31:45 am »

Hi,
I am attempting to stream audio from my UPNP/DNLA server to Media Center 30 for Mac with weird results.  The music plays at the wrong speed (too fast) and with a lot of distortion. This is true for multiple file formats, including, particularly,HD (high bit rate) FLAC files.
I suspect that there is a problem either with the way Media Center is interpreting my audio files or the way that it is sending it to my DAC (a FocusRite Clarett 8Pre).
I have tested the Clarett with other streaming/audio software, including iTunes and music software including Ableton Live and iZotope RX (playing the exact same files) with no issues.
Is this an issue with the Media Center or a problem with the default settings?  If it is the settings, can someone point me to the right settings page to fix this?
Thanks,
Dan
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Streaming HD audio distorted
« Reply #1 on: May 09, 2023, 08:40:51 am »

So MC is the Renderer and you're sending to it from other software?

In certain cases, MC will convert if it's the DLNA Server and you can change that in Media Network settings.

What type of files are you starting with?  Do ordinary FLAC files work?

More details might help.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #2 on: May 09, 2023, 01:00:37 pm »

I will do my best to answer.
Files are high def FLAC (192kHz · 24bit or similar), although I have tried this on lower bit-rate files, they are mostly FLAC.  I will try again with other flavors of files, including lower bit rate (44.1/16bit CD rips or MP3 files, both of which are common in my collection), but I am certain that all files I tested had an issue.
File server is a Synology NAS (DS214play) running their own DLNA server software.  I have also tried it with minimserver running on the same NAS device.  I am able to stream music from this server to a streaming box (from Cambridge Audio) or to an I)S device (using a variety of apps to stream) with no issues.

I assume that MC is attempting to transcode/convert the files (incorrectly).  The other possibility is that MC doesn’t like my DAC (again, my focusrite Clarett works fine with all other MacOS software so far.

Please let me know if I can provide other details.
Thanks,
Dan
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #3 on: May 09, 2023, 01:07:00 pm »

I'm confused about your setup.  Do you have files imported into MC?  Or are you using some DLNA "server" and only using MC as a renderer?

MC does really as the library source.  Meaning that you have files imported into MC and MC plays them.  As a renderer being controlled by 3rd party tools, I'm not sure.

My recommendation would be to use MC directly.

Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #4 on: May 09, 2023, 01:17:35 pm »

Sorry for the confusion.
I am using MC as a “renderer”, although that is not the word I would have used (i was thinking it is a DLNA client for a remote server,  but I think that is the same thing).

I will try importing a few files directly into MC to see if it is any better.  However, I note that MC has a feature for connecting to a remote DLNA server/source, which is what I have been using.  MC has no problem selecting and playing files, which suggests that it complies with that part of the DLNA protocol.  It’s just an issue with the sound quality of the streamed music.

I had been hoping to use my Mac as an audio streamer, since my files are all stored on a remote network attached file server.  The benefit here is that the server software keeps my files or organized in the same way independent of where I am streaming.

Again, I will try this with a file that has been loaded directly into the MC library and see if it is any better.  May not have a response until later tonight.
Thanks,
Dan
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #5 on: May 09, 2023, 01:43:48 pm »

MC may work just fine as a pure renderer.  I was trying to say that most people use it as "the whole thing".  Most of my experience is with MC as a standalone system.

For using it as a renderer, you probably want to change some of these options:

Tools > Options > Media Network > Client Options
In particular:
Audio Conversion > Conversion (I would set this to never)
You might also change the Encoder settings in that section.

It's possible that MC is converting everything to MP3 before playing.  I believe that is the default.

Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #6 on: May 09, 2023, 01:59:15 pm »

Got it.
Thanks Brian.
I will check those settings - I definitely don’t want to down sample to MP3 - that defeats the point of the high-def audio files.
Dan
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Streaming HD audio distorted
« Reply #7 on: May 09, 2023, 04:00:49 pm »

MC can load a DLNA Server from a NAS, for instance, but it's far better to just import the files.

There is a DLNA topic on our wiki that would help you with terminology.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #8 on: May 10, 2023, 08:18:34 am »

OK - some additional test results and some conclusions.
I tried direct import of both my HD FLAC files and some mp3 & mp4 files.  All of them suffer from the same distortion (and faster/higher pitched playback).  This is all running on an M2 Mac Mini.

That said, I tested issues with the DAC (Focusrite Clarett 8Pre) by shutting it off and playing the audio through the tiny Mac Mini speaker.  In that case, the audio sounded fine (for a crappy speaker).  The audio playback was at the right speed and in the right key.

Therefore, my conclusion is that MC does not have the correct settings for interacting with my DAC.  I was able to get it to work briefly by shutting off the DAC (with MC running), playing some music through the Mac Mini speaker, then switching the DAC back on and redirecting the audio back to the DAC.  The sound was fine (great, actually).  However, I have not been able to reproduce this.

I checked in the MacOS audio/MIDI settings, but I couldn’t find any parameters to change for the Clarett 8Pre (beyond reducing the maximum sample rate; the opposite of what was recommended in the help file).

Any suggestions on what else I could change to make this work?
Thanks,
Dan

Any pointers on
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Streaming HD audio distorted
« Reply #9 on: May 10, 2023, 08:33:45 am »

Did you try the DAC manufacturer?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #10 on: May 10, 2023, 08:36:30 am »

That's a very atypical "DAC".  That's more of a studio piece.  It will probably work fine with MC, but with big multichannel DACs like this, you usually need some kind of control application that maps channels and things like that.  I believe you can find that here:

https://downloads.focusrite.com/focusrite/clarett/clarett-8pre-0

Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #11 on: May 10, 2023, 12:49:10 pm »

Thanks - I have all of the drivers and software installed.
I tried modifying the routing so that there is a direct line out to the headphone port, but that doesn’t make any difference.

I should note that this DAC works fine with all other music software on my Mac, including iTunes and many other music file management software.  There is something particular about the way that MC talks to my DAC that doesn’t work. 

I will give it a rest for now, but if you have any insight, please let me know.  Pity - MC looks nice, but perhaps not for me.

Thanks,
Dan
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #12 on: May 10, 2023, 01:55:09 pm »

The big clue is that the music plays at the wrong speed.  This means MC is setting a particular sample rate, but the DAC is not obeying and is playing at a different rate.  I'm going to guess that your DAC is defaulting to 96kHz.  Go take a look in audio midi setup.  Or look in your Focusrite utility and read the sample rate right from the interface controls.

You could try setting MC to play all files at that sample rate:  Player > DSP Studio > Output format > Sample rate

It's also possible that granting MC exclusive access to the DAC would help:  Tools > Options > Audio > Device settings

MC is a very precise player that is trying to faithfully reproduce every file at the exact rate it is encoded at.  Other MacOS players just "throw the audio" at the CoreAudio driver and the driver figures out the sample rate and generally goes a sample rate conversion to get the audio to the right rate.  That's why iTunes and friends all work.  They are lower quality less precise players.

I've used half a dozen DACs with MC and haven't had an issue yet.  But I don't have an 8 output, 6 input studio interface like you do.  :)

Best of luck.
Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #13 on: May 10, 2023, 03:30:21 pm »

Thanks -
I think I have found the solution.  Under the DSP settings, I need to force everything to 192 KHz.  Once that is done, the DAC settings stay at 192 (previously, they were jumping around to match the bit rate of the music), and the audio sounds good.
I assume that MC is upsampling everything to 192, which I hope is not lossy (unless there is some sort of interpolation or smoothing that could introduce some artifacts.). Not sure how it is handling my 192KHz FLAC files, which should not have had an issue.
I would love to understand what’s going on in the background.  At least for now, I can test out MC and compare the audio quality to what I am getting from other software (like iZotope RX and other audio editing software that I am used to).

FYI - “exclusive access” didn’t help, in case someone else is facing this issue.

Thanks for the suggestions!
Dan
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...
Re: Streaming HD audio distorted
« Reply #14 on: May 10, 2023, 04:02:56 pm »

Upsampling or downsampling is lossy, yes.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #15 on: May 10, 2023, 08:29:31 pm »

In an absolute sense, yes changing sample rates, with conventional algorithms, is lossy.  But it's not lossy like converting to MP3 or other lossy CODECs which reduce the information rate.  Rather, it's lossy in a much less significant way.  Yes, the waveforms are altered.  It may or may not be audible.  It should not be an obvious or glaring difference.  It should be very subtle if it's audible at all.  I would not be very concerned about it.

Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #16 on: May 12, 2023, 02:20:19 pm »

As a post-script to this discussion, I see that 192KHz, streaming as 192KHz through my DAC Audio Path states that "No changes are being made."
All other sample rates are being upsampled to 192KHz, which is fine with me.
Dan
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #17 on: May 20, 2023, 01:26:31 pm »

I am taking another stab at this thread - I have discovered some additional details and concerns.

First, I have moved to MC31 for Mac, so this may be in the wrong location, but I wanted to keep this thread and I don't see any changes from the newer version that fix this problem.

To recap, unless I force (by DSP) all sample rates to the set rate of my DAC (either 192 or 96), the audio is distorted.  The solution was to set to 192 and up sample everything else. 

However, today, I compared some 96KHz FLAC files played from MC (with DSP upsampling to 192KHz) or from another App (Amadeus Pro).  The other App sends the audio at the native sampling rate (confirmed by looking at the sample playback rate in either Audio MIDI Setup or in my DACs control software (Focusrite Control). 

The upsampled files from MC were clearly missing some details, which caused me to do some digging (I want to play all audio without DSP, if I can).  First, it is clear that the output (with the DSP>output off - unchecked) is passing the correct sample rate.  Audio MIDI Setup and Focusrite control all correctly switch to the correct sample rate on the fly, no matter which file is being played in MC.  That said, some of the time, the audio is perfect.  Other times, it is distorted and playing at the wrong speed (this was the original problem in this thread). 

This causes me to suspect the following:  I think that the distortion is coming from some sort of processing within MC, not with the sample or bit rate.  I am not sure how to test this directly (beyond looking at Audio MIDI setup or Focusrite Control), but I can see that the sample rate is  correct.  Additionally, I can occasionally get perfect audio from MC at any sample rate (tested across about 5 files at a variety of sample rates, earlier today), but it doesn't last.

Any suggestions or ideas? Is there any other debugging I can do?  Again, I can keep using this with the DSP, but it is altering the sound in a noticeable way, which I would like to avoid.

Thanks,
Dan
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #18 on: May 20, 2023, 03:24:32 pm »

More data:
I can output at 192KHz (the max for my DAC) without any DSP settings (DSP bypassed/unchecked).
For any other sample rate, I need to match the number of channels on my DSP (this varies by sample rate; no single channel number setting works for all sample rates between 44.1 and 192KHz), or I need to upsample to 192KHz.
Additionally, if I test this without engaging the DSP (switching between files of different sample rates; FLAC 96 to 192 and back), MC31 crashes after playing a few tracks with the wrong settings.  This crashing happens fairly consistently under these conditions.

I suspect that any DSP settings causes the output stream to pass along additional information to the DAC.  More likely, forcing sample-rate conversion ensures that the number of channels are always the same.  (However, I don't need to change the # of channels if I am converting the sample rate.). In any case, it is not solely a problem with the sample rate as I am currently pushing the audio stream with "no change" in the output sample rate.

Is there any way to give the native output from MC to recognize the required format for the stream going into Core Audio?  It seems to do this adjusting for sample rate correctly (sample rate out of MC is recognized by Audio Midi Setup. 

Otherwise, upsampling is the only stable DSP setting, but that comes at the cost of some audio quality.

Thanks for reading my long ramble!
Dan

PS - I am posting all of this thinking that it might be useful for someone else in the future, even though my particular DAC is a bit unusual.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13870
Re: Streaming HD audio distorted
« Reply #19 on: June 02, 2023, 08:07:24 am »

I'm not sure I understand all that's going on here but if you are up-sampling, under the audio settings, make sure SoX is enabled.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #20 on: June 02, 2023, 08:42:49 am »

Thanks.
To make it simple: my DAC varies the # of channels with changes in sample rate.  That is, it can translate more channels at a lower sample rate and fewer when the sample rate is higher (reflecting bandwidth limitations of the data stream, I suspect).  Since the number of channels under the DSP settings is fixed, the only way to control this is to up or down sample all audio tracks to the same sample rate (e.g. 96KHz for all output) with the correct number of channels (in this case 14 channels in total).

I will try activating SoX.  I didn’t know it existed before since that option is set from the Audio Output menu, not the DSP menu.

Thanks,
Dan
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #21 on: June 02, 2023, 09:08:57 am »

Why is the number of channels relevant?  If you are playing 2 channel audio, with 2 speakers, from your DAC, don't you want to set the output to 2 channels all the time?  The channels section of the DSP > Output Format should nearly always be set to the number of speakers you have connected to output channels.

I suspect that maybe this is simply related to which channel is active at various sample rates.  If so, using the Channel Offset in General > Audio > Audio Device > Device Settings is something you should experiment with.

Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #22 on: June 02, 2023, 10:05:59 am »

I think this may have been buried in an earlier part of this thread:
I am using a Focusrite DAC, which is designed for multi-channel IO (for music production).  I have tested the Channel Offset settings, which have no effect.  If I output at a single sample rate (e.g. 96KHz; my audio files vary from 44.1KHz to 192 KHz FLAC) by using DSP settings to force the sample rate, everything sounds fine (at least not bad).  If I don’t do this, I get distorted audio at the wrong playback speed and pitch when I switch from 96 to 192.  This isn’t consistent - sometimes I can play a few tracks in a row without distortion, but it usually goes to hell after a few tracks.

The only consistent solution so far is to use DSP to force all files to 96KHz.  I can also manually set the number of supplementary channels to match the number of channels that my DAC uses for a give sample rate, but this is laborious.

In the end, I plan to purchase a standard 2-channel DAC for music playback.  My situation (with the Focusrite) is unusual and I don’t know if MC can handle it, although I continue to tinker, since I am learning something from the experience.
Thanks,
Dan
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Streaming HD audio distorted
« Reply #23 on: June 02, 2023, 10:35:04 am »

Regarding inconsistent behavior:  Maybe setting Exclusive Access for the FR DAC would help.

Channels and sample rates:  Since I haven't seen it, I'm not familiar with how these two might map to one another.  If indeed you get N channels at 44.1 and M at 96, and O at 192, then you might consider setting up zones and Zone Switch rules.

Each zone can have different audio parameters (Like sound device and sound device settings).  Zone Switch Rules can pick the zone based on criteria.  Those criteria include every field that MC knows about for a given file.  So sample rate is one thing you could use to do Zone Switch.  This seems like way too much effort to me.  I would want to figure out a more elegant way.  But it's available if necessary.

Brian.
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #24 on: June 02, 2023, 11:41:03 am »

Thanks!
Exclusive access is set (doesn’t fix the problem).
I may check out setting up zones and using Zone switch rules, but I agree that’s a lot of effort for solving this problem.  That said, I greatly appreciate the education, and I am impressed with the granularity of control that is offered by MC in general.

In the end, I will probably switch to a simple 2-channel DAC that is better suited for music playback.

I greatly appreciate the discussion! (Now if someone could help me with my issues with Auto-rip, currently posted to the MC31 MacOS forum, I would greatly appreciate it!  ;) )
Dan
Logged

dpfels

  • Recent member
  • *
  • Posts: 21
Re: Streaming HD audio distorted
« Reply #25 on: June 20, 2023, 11:37:33 am »

Final comment on this thread:
I bought a Topping DAC and the problems all went away.  I can now stream directly to the DAC without correcting the sample rate in DSP settings.  The issue was clearly specific to the FocusRite not playing well with MC.
Thanks for all the suggestions.  At the very least, this was educational.
Dan
Logged
Pages: [1]   Go Up