Author Topic: 3.1.6512: distortion when playing audio with much different samplerates via ASIO  (Read 11353 times)

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
UPDATED 21.12.17:
- removed the old text, as I have made some more findings on this issue
- so you have the latest status here

Hi Steven,

how are you ? I am still very satisfied with MusicBee and using it now since many years. I hope you can help me with the following issue.
I upgraded already to the last version of MusicBee, which is 3.1.6512. But the problem is still there.

I have problems with the playback of audio files via ASIO driver when the sample rate differs much to each other.
BTW .. its out of question whether to workaround with WASABI or ASIO4ALL, I want (and need) to use the ASIO driver.

EDIT: also I can see that MusicBee changes the sample rate properly in all cases. The RME driver settings dialog shows me this.

Whats always possible and works nicely: playback of FLAC files with 44.1 or 48 kHz sample rate, where the sample rate change are only little. But as soon as I playback audio content with differs much in terms of sample rate, then I get kind of asynchronity which resultes in distortion / noise through the speakers.

1st I thought MusicBee has a general problem playing music content with higher sample rates than 48 kHz.
This is luckily not the case !!
But to be able to play a song in i.e. 44.1 or 48 and then play another in 88.1 or 96 then I have to:
1. terminate MusicBee
2. set the new sample rate manually in the ASIO driver, like i.e. 88.2 kHz
3. then start MusicBee

Further testing shows: that I can play songs with different sample rates which do not differ too much, i.e.:
1. Close MusicBee
2. and then set ASIO driver to
- 44.1 kHz, freshly start MusicBee: plays music well with 44.1 and 48 kHz, distortion when trying to play a song @88.2/96/192 kHz
- 88.2 kHz, freshly start MusicBee: plays music well with 88.2 and 96 kHz, distortion when trying to play a song @44.1/48/192 kHz
- 192  kHz, freshly start MusicBee: plays music well with 192 kHz, distortion when trying to play a song @44.1/48/88.2/96 kHz

I see here certain similarities / a pattern: inside of the three different sample rate blocks "44.1/48", "88.2/96" and "192" MusicBee can successfully change the sample rate. But if fails when the sample rate changes "too much" between i.e. "44.1/48 and 88.2/96" or between "88.2/96 and 44.1/48".

This rings a bell .. maybe the problem has to do with this:
44.1/48 kHz content uses the same ASIO buffer size, which I have set to usually 128 samples (btw .. can be from 32 to 2048 samples).
88.2/96 kHz doubles the data rate uses a higher bandwidth, thus the ASIO driver automatically changes to 256 samples buffer.
176.4/192 kHz again doubles the data rate, thus the ASIO driver automatically changes to 512 samples buffer.

Its definitively not related to the "ASIO buffer size", in the special sense "you need to use a higher ASIO buffer size, as your HW/driver is unable to work reliable with a lower one". I have the same issues when using higher ones up to 2048.
Also I can exclude "USB transport errors", as the RME ASIO driver is very advanced and has an USB dignosis function which I had running in parallel. So I can exclude cable / USB transport errors and also improper use of maybe too low ASIO buffers.

I cross-checked with another application Foobar2000, there such problems do not occurr. With foobar2000 I can play audio content completely independend, which sample rate the content has. By this I could exclude a device, cable or driver problem and am convinced that this is indeed an application issue.

In a good case of luck its only a very small problem which hopefully could be fixed easily with not too many efforts, perhaps:
- different initialization when a new title starts or
- different parameters to ASIO library calls that you use

BTW thanks: last time you solved another issue in the area of ASIO driver, to fix the display/selection of output channels, when a device has plenty of channels. This was excellent, as my current devices have plenty out outputs ;)

Of could I can help with testing new code.
Once it works I am also happily willed to do a money contributing to your project via paypal.

My hardware:

Audio Interfaces (tested with both):
- RME UFX+, http://www.rme-audio.de/en/products/fireface_ufx-plus.php
- RME ADI-2 Pro, http://www.rme-audio.de/en/products/adi_2-pro.php
Both devices use the same (last) RME ASIO driver: driver_madiface_win_09616.zip
Usually I use the UFX+ for playback on near field monitors.
The ADI-2 Pro is then connected via AES as pure headphone amp.
But I tried the ADI-2 Pro also isolated, soleyly connected to my PC via USB.
All the same, foobar works, issues with MusicBee.

PC:
- Windows 7 SP1, Ultimate
- CPU: Intel Xeon E5-1650v3, socket 2011-3, Supermicro X10SRi-F (server mainboard)
- USB3 card: Sonnet Allegro Pro (4x FL1100 USB3 controller), for each recording device a dedicated and by RME supported USB controller
- Windows High Performance Energy Profile
Last Edit: December 22, 2017, 05:56:58 AM by tubescreamer

CritterMan

  • Sr. Member
  • ****
  • Posts: 556
  • Now with FiiO M11!
I'd suggest checking to make sure your driver is up to date, and then I'd test using WASAPI. Sadly, sometimes you'll have trouble with ASIO in some situations. Same goes for WASAPI, but usually one or the other will work.
Home Desk ~ MB 3.3 Portable • Questyle CMA400i (ASIO) • Sennheiser HD 660S (balanced) / Audeze EL-8 Closed Back / Fostex TR-X00 Ebony • Teac AI-101DA • Jamo C93 + Dayton Audio SUB-1000
Work Desk ~ MB 3.3 Portable / Tidal • SMSL SU-8 v2 • Nobsound NS-05P • THX AAA 789 • Sennheiser HD 58X (balanced)
OTG ~ FiiO M11 • Audiofly AF180 / B&O H6

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
Hi CritterMan,

if it would be the driver then it would cause issues also with foobar2000, but with foobar2000 all is fine.

I prefer ASIO to achive bit perfect transport of audio material to RME and then High End Hi-Fi.
I don't want to discuss ASIO vs WASAPI, I simply want to use ASIO.

Another important finding.

Playback of music with sample rates >48 kHz with MusicBee works, when I
- terminate MusicBee
- change the sample rate to i.e. 96000 in the driver settings dialogue
- start MusicBee again
- start playback of audio with 96kHz

It looks to me that on the change of the sample rate MusicBee seem to do someting wrong.
Maybe something like a timing issue.
In the RME driver setting I can see that the proper sample rate is being set.

But this is tedious work having to quit music bee every time and manually set the samplerate for the audio device
when i.e. the sample rate inside of a playback list changes or when I simply pick such a song with other sample rate.

I would really be glad if MusicBee could be brought to the same good shape in terms of ASIO playback as foobar2000.

Of course I can support with testing.

Many thanks
Last Edit: December 20, 2017, 09:58:32 AM by tubescreamer

CritterMan

  • Sr. Member
  • ****
  • Posts: 556
  • Now with FiiO M11!
if it would be the driver then it would cause issues also with foobar2000, but with foobar2000 all is fine.

Not necessarily. In very simplified terms, the stream of data being fed into the driver has a source, and not all source/driver combinations get along. Incompatibilities often manifest as a digitally distorted audio stream, such as the one you described. If MB was the source of the problem, large numbers of other users would be experiencing the issue as well, and that simply isn't evident in the forums. So, it's more likely that the issue is unique to your setup. This is why the driver is suspect, most users of the hardware you have are not using MB so the driver probably isn't used with MB often.

Please note that I've taken time out of my day to offer assistance. If you are going to dismiss a simple and basic troubleshooting step out of hand, you're not as likely to receive additional assistance from others here. We're all volunteers, including the developer.

 
Home Desk ~ MB 3.3 Portable • Questyle CMA400i (ASIO) • Sennheiser HD 660S (balanced) / Audeze EL-8 Closed Back / Fostex TR-X00 Ebony • Teac AI-101DA • Jamo C93 + Dayton Audio SUB-1000
Work Desk ~ MB 3.3 Portable / Tidal • SMSL SU-8 v2 • Nobsound NS-05P • THX AAA 789 • Sennheiser HD 58X (balanced)
OTG ~ FiiO M11 • Audiofly AF180 / B&O H6

hiccup

  • Sr. Member
  • ****
  • Posts: 7785
Nice dac tubescreamer!

The asio component that BASS (MB's audio-engine) is using, is already a few years old, and doesn't seem to get a lot of support or updates.
Not sure if the cause of your well-explained issue is related to that, but it might.

A thought: have you tried the asio4all driver?
It's manufacturer-independent, but even some manufacturers 'that can't be bothered' to improve their asio drivers point to it.
(not that I would suspect RME of doing such?)

You'll have to wait and see if MusicBee's developer sees something in your report that would get him interested to investigate this.

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
Nice dac tubescreamer!

The asio component that BASS (MB's audio-engine) is using, is already a few years old, and doesn't seem to get a lot of support or updates.
Not sure if the cause of your well-explained issue is related to that, but it might.

A thought: have you tried the asio4all driver?
It's manufacturer-independent, but even some manufacturers 'that can't be bothered' to improve their asio drivers point to it.
(not that I would suspect RME of doing such?)

You'll have to wait and see if MusicBee's developer sees something in your report that would get him interested to investigate this.


My computer is being used in a Home recording studio.




To use asio4all is not an option for me.
I have devices which all have ASIO drivers.
Basically I am using an UFX+ and the ADI-2 Pro is being used solely as Headphone Preamp.

To sum up the situation.
MusicBee has an ASIO driver.
It works very well for 44.1/48 .. only the change to higher sample rate doesnt work.
Other products like foobar do not have this problem.
I very much doubt that this is a problem on my side, be it OS or RME ASIO drivers.

What I am asking for is, that somebody who actively develops MusicBee to look, whether he can maybe change something in the programming, that this problem goes away.
Last Edit: December 21, 2017, 10:21:14 AM by tubescreamer

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
if it would be the driver then it would cause issues also with foobar2000, but with foobar2000 all is fine.
Not necessarily. In very simplified terms, the stream of data being fed into the driver has a source, and not all source/driver combinations get along. Incompatibilities often manifest as a digitally distorted audio stream, such as the one you described. If MB was the source of the problem, large numbers of other users would be experiencing the issue as well, and that simply isn't evident in the forums. So, it's more likely that the issue is unique to your setup. This is why the driver is suspect, most users of the hardware you have are not using MB so the driver probably isn't used with MB often.

Please note that I've taken time out of my day to offer assistance. If you are going to dismiss a simple and basic troubleshooting step out of hand, you're not as likely to receive additional assistance from others here. We're all volunteers, including the developer.

EDITED, pls re-read

I appreciate help but please stick to the topic ASIO.

I would highly appreciate, if Steve as MusicBee owner would take this as an opportunity
to fix a long standing bug in the MusicBee ASIO code.

I think it has not been detected for a long time because the combination of users using ASIO driver
in combination with higher sample rates than 48 kHz is appearently rare.

Steve fixed already some years ago another nasty bug around ASIO driver, for which I am very thankful.
If a recording device has many output channels then a scroll bar was missing to be able to scroll down.

From this I learned that Steven tries his best to make MusicBee to a round product which
works for everybody even if its maybe the minority of users. That spirit is highly appreciated.

Today I made some other interesting findings:

If I preselect 88.2 or 96 kHz in the ASIO driver and then start MusicBee
AND only play music content with 88.2/96 kHz then playback stays stable !

Asynchonity/Distortion happens again, when I switch to 44.1/48.

Isn't it strange ?

If you stay with your music playback within certain sample rates like "44.1/48" or "88.2/96" then all works.
But if you switch playing back from "44.1/48" to "88.2/96" or vice versa, then problems arise (asynchronity/distortion).

Sadly I am not so deep in programming and especially not using Steinbergs ASIO library.

But I have a certain gut feeling that it might be related to the ASIO Buffersize.

The ASIO driver has to change its ASIO buffersize along with higher sample frequencies. This change is being done and HAS to be done by the ASIO driver automatically, because with 88.2/96kHz you transfer double the amount of data.

When I configure the ASIO buffer size (possible from 32 to 2048 samples) to lets say
128 samples @44.1/48 kHz then it will be
256 samples @88.2/96 and
512 samples @176.2/192 kHz.

Has MusicBee perhaps a problem with than or is the code not prepared for this change which has to happen ?

That is at this moment the only explanation which comes to my mind,
as MusicBee has no issues to playback 88.2/96 and also 192 when it has been preselected in the ASIO driver
BEFORE starting MusicBee itself.
Problems start again when switching from 88.2 or 96kHz back to either 44.1/48 or 192 kHz.

Is this perhaps something with which you could find out and fix, why MusicBee has issues and foobar not ?!

If you have a development snapshot, then I am willed to test and to report to the development.
Last Edit: December 21, 2017, 12:34:20 PM by tubescreamer

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
I would really appreciate if the people behind MusicBee and its ASIO driver would take a deeper look:
Just to clarify: there are no "people" behind MB. It is developed and maintained by one person - Steven. He does this in his spare time and asks for nothing in return. Users who offer him money as an incentive to fix something are wasting their time, and will more than likely get ignored. Users who badger him to fix/add things will also likely get ignored. Users who bump their issue every six hours are likely to be ignored. Steven implements new features and fixes bugs as he sees fit. With the complexity and time involved being key factors. Note that I don't speak for him but I just wanted you to have a fuller understanding of who is behind MB and how he operates
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
I would really appreciate if the people behind MusicBee and its ASIO driver would take a deeper look:
Just to clarify: there are no "people" behind MB. It is developed and maintained by one person - Steven. He does this in his spare time and asks for nothing in return. Users who offer him money as an incentive to fix something are wasting their time, and will more than likely get ignored. Users who badger him to fix/add things will also likely get ignored. Users who bump their issue every six hours are likely to be ignored. Steven implements new features and fixes bugs as he sees fit. With the complexity and time involved being key factors. Note that I don't speak for him but I just wanted you to have a fuller understanding of who is behind MB and how he operates

Thanks for clarification. I was aware of that he is the key person but didnt know how the actual status is, because I had no time to track this forum much.

What you all do here, and which is highly appreciated, I do in other forums around recording and also in the RME user forum.

Steven was in the past already much helpful and fixed something in the selection of output devices for ASIO devices with a lot of output channels.

And now I simply hope that he has time and interested to fix this as well.

Its only a hope. And when Steven would speak up we could also talk about a donation, but then based on success.

I am the kind of guy that also spends and spended a lot of private time for free, so dont tell me about that ;-)
I am best familiar with that concept ;)

If Steven says no to this, ok ... then I have to live with it.

As you might have noticed I addressed Steven in my start post as I thought already that he is "the man".

hiccup

  • Sr. Member
  • ****
  • Posts: 7785
Strictly from a technical interested point of view, and not to discredit your request:
What specifically would mess-up your workflow or results if you would set MusicBee to use Wasapi for your ADI-2 Pro?

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
Strictly from a technical interested point of view, and not to discredit your request:
What specifically would mess-up your workflow or results if you would set MusicBee to use Wasapi for your ADI-2 Pro?

https://en.wikipedia.org/wiki/Audio_Stream_Input/Output

ASIO drivers are high quality drivers developed by the vendor for a particular sound card up to recording interfaces being used in studios which can have plenty of inputs and outputs and of different type (analog, digital: ADAT, AES, SPDIF, MADI, ...)

By using ASIO drivers an application is able to directly access the audio hardware with nothing in between.
The advantages:
- less subsystems in between the application and the hardware
- lower latency
- no quality degradation by Windows sound infrastructure
- bit perfect transmission
- optimum performance (highly optimized driver for the particular sound device)

The windows sound system is known to add latency and to alter the content by not being able to fully accurately process the audio.
The only driver model with Windows which has more quality is WASAPI but only in a special mode, which I think is the so called kernel mode.

But I personally do not want to use WASAPI stuff, as I have for my devices high quality ASIO drivers, so to say "the real thing".
WASAPI is nice for audio hardware that has no ASIO driver, agreed. But if you have an ASIO driver its best practise to use this.

For me (using RME recording devices and converters) an ASIO driver has additional benefits: while listening to Music using MusicBee with the RME ASIO driver I can additionally make use of the RME analysis toolkit called DigiCheck. Some of these tools included are described here on the RME page: https://www.rme-audio.de/en/support/techinfo/totalyser.php

But I can only make use of them when I playback audio in MusicBee using the RME ASIO driver. Then DigiCheck can read this audio stream as the ASIO driver is prepared for "multi-client" operation.

Looking at the output of some of these tools is useful for me if I want i.e. compare my mixed and mastered music with some other music which I regard as a "reference track". Or simply to watch it while listening / enjoying music.

And now please lets again concentrate on ASIO and my bugreport, thanks.
If you want to discuss advantages of this over the other protocol, then please open a thread in another subforum.
This makes it also easier for Steve to get the relevant information out of this thread without having go though many lines of text which have nothing to do with the bug report itself.

Update: I updated the start post with latest status. From now on I will update new / relevant findings to the start post,
to make it easier for Steven to find latest relevant information to this bug report.
Last Edit: December 21, 2017, 04:12:56 PM by tubescreamer

c0dybrown

  • Newbie
  • *
  • Posts: 6
Hello,

Just saw this topic. I have been experiencing this exact behavior, just wanted to add the thread I started under Questions for completeness. I have done some research on this, it doesn't seem to be caused by the underlying BASS libraries

https://getmusicbee.com/forum/index.php?topic=23718.0

tubescreamer

  • Jr. Member
  • **
  • Posts: 83

purplesoup

  • Newbie
  • *
  • Posts: 6
I have this issue as well.


I found its related to the sound card and higher sample rates. My device supports upto 96 driverless, and 192 with drivers, but when playing asio 192khz I get crazy distortion, then when I play 172khz I get distortion as well. When I play 96 then play 172 it plays fine (I think the device is down sampling it since it doesn't support it)


I'm not entirely sure this is musicbee's fault, since all <96khz works no mater how fast I change songs, sounds more hardware related.

tubescreamer

  • Jr. Member
  • **
  • Posts: 83
I have this issue as well.


I found its related to the sound card and higher sample rates. My device supports upto 96 driverless, and 192 with drivers, but when playing asio 192khz I get crazy distortion, then when I play 172khz I get distortion as well. When I play 96 then play 172 it plays fine (I think the device is down sampling it since it doesn't support it)


I'm not entirely sure this is musicbee's fault, since all <96khz works no mater how fast I change songs, sounds more hardware related.

Cross tested with foobar2000. There I had zero issues as I wrote. So its not the ASIO driver at all for me.