Code Monkey home page Code Monkey logo

Comments (4)

dechamps avatar dechamps commented on May 22, 2024

According to the log, the problem might be on REW's side - it seems to be using the ASIO API incorrectly. I have a FlexASIO log that shows the issue; here's the relevant part:

--- ENTERING CONTEXT: setSampleRate()
Request to set sample rate: 44100
--- EXITING CONTEXT: setSampleRate() [OK]
--- ENTERING CONTEXT: ~CFlexASIO()
--- EXITING CONTEXT: ~CFlexASIO() [OK]

...

--- ENTERING CONTEXT: CFlexASIO()
--- EXITING CONTEXT: CFlexASIO() [OK]
--- ENTERING CONTEXT: init()

... (setSampleRate() is never called here!)

Opening PortAudio stream with...
...sample rate: 48000 Hz

Here's what's happening according to that log:

  1. REW loads and initializes the ASIO driver (ASIOInit()).
  2. REW sets the sample rate (ASIOSetSampleRate())
  3. REW closes the driver (ASIOExit()).
  4. REW opens the driver again (ASIOInit()).
  5. REW starts streaming audio.

Notice that REW doesn't set the sample rate again after it re-opens the driver. Since no sample rate was set after the last driver initialization, FlexASIO naturally uses its default sample rate (here, 48 kHz), not the sample rate that REW thinks it's using. This is completely reasonable behaviour on the part of FlexASIO - in my opinion it's REW that's at fault here.

Two action items come to mind:

  • I will get in touch with the author of REW so that we can debate this.
  • In the mean time, I should be able to implement a workaround in FlexASIO where it will try to keep the sample rate setting around in some global variable so that it can survive driver resets.

from flexasio.

dechamps avatar dechamps commented on May 22, 2024

Same story with REW 5.20 Beta 1.

from flexasio.

johnmgithub avatar johnmgithub commented on May 22, 2024

A change was made in REW in July last year to reload the ASIO driver after making a sample rate change as some drivers seemed to behave a bit strangely otherwise. It works for Steinberg and RME drivers (for example) so perhaps they persist the sample rate selection. I'll add a further setting of sample rate after reloading the driver for the next beta, shouldn't have any effect on drivers that persist the selection.

from flexasio.

dechamps avatar dechamps commented on May 22, 2024

@johnmgithub: I see that you have released REW 5.20 beta 2 with the following entry in the changelog:

Reapply ASIO sample rate after reloading the ASIO driver

After testing I can indeed confirm that REW is correctly calling setSampleRate() before createBuffers() now, making the workaround I just implemented in FlexASIO unnecessary. Thanks for the fix!

(I will keep the workaround anyway just in case one uses FlexASIO with a previous REW version, or uses some other ASIO host application that happens to have the same problem.)

from flexasio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.