I am a trying to write a Python script that does synchronous 2-channel playback on an AD2 of arbitrary data that is continuously sent to the device using the FDwfAnalogOutNodePlayData call.
Most of this works; I get gapless playback at a rate of 48 kHz on both channels without issue.
However, I just noticed that the playback doesn't start at the precisely the same instant on both channels, which is what I want to achieve.
My sequence of calls (omitting the FDwfAnalogOut prefix) is:
- Configure both channel's "Carrier" node to Enabled, FUNC.Play, frequency 48000.0 ;
- Feed an initial 4096 samples to both channels using nodePlayData();
- Perform a MasterSet(1, 0), which (if I understand correctly) slaves Channel 2 to Channel 1 for starting purposes;
- Call Configure(0, True) which starts the output on both channels;
- In a loop, repeatedly call nodePlayStatus() and nodePlayData() to keep the samples flowing into the device.
As indicated, this all works except for proper synchronization. Both channels show a nice generated 100 Hz sine which should be identical on both channels, but there is a significant time offset between the two.
If I just configure the channels for FUNC.Sine output, do the MasterSet(1, 0), followed by Configure(0, True), I do see perfectly aligned sines.
The time difference seems to be reproducible, and depends on the sample frequency.
At 48 kHz, it's 4 ms. (~ 200 samples).
At 96 kHz. it's 2 ms. (~ 200 samples)
At 192 kHz, it's 6 ms. (~ 1200 samples)
Question
Guest
Hi,
I am a trying to write a Python script that does synchronous 2-channel playback on an AD2 of arbitrary data that is continuously sent to the device using the FDwfAnalogOutNodePlayData call.
Most of this works; I get gapless playback at a rate of 48 kHz on both channels without issue.
However, I just noticed that the playback doesn't start at the precisely the same instant on both channels, which is what I want to achieve.
My sequence of calls (omitting the FDwfAnalogOut prefix) is:
- Configure both channel's "Carrier" node to Enabled, FUNC.Play, frequency 48000.0 ;
- Feed an initial 4096 samples to both channels using nodePlayData();
- Perform a MasterSet(1, 0), which (if I understand correctly) slaves Channel 2 to Channel 1 for starting purposes;
- Call Configure(0, True) which starts the output on both channels;
- In a loop, repeatedly call nodePlayStatus() and nodePlayData() to keep the samples flowing into the device.
As indicated, this all works except for proper synchronization. Both channels show a nice generated 100 Hz sine which should be identical on both channels, but there is a significant time offset between the two.
If I just configure the channels for FUNC.Sine output, do the MasterSet(1, 0), followed by Configure(0, True), I do see perfectly aligned sines.
The time difference seems to be reproducible, and depends on the sample frequency.
At 48 kHz, it's 4 ms. (~ 200 samples).
At 96 kHz. it's 2 ms. (~ 200 samples)
At 192 kHz, it's 6 ms. (~ 1200 samples)
Any help would be appreciated!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now