boxerfan88
Major Contributor
- Joined
- Oct 23, 2018
- Messages
- 1,147
- Likes
- 1,342
- Thread Starter
- #61
import sys, os, argparse, acoustics
import numpy as np
import sounddevice as sd # {sounddevice} is different from {soundcard} library
# Updated 2023-11-28
# Created by boxerfan88
#
# This tool sets sample rate of SMSL DAC & Soekris DAC
# Takes in sample rate as argument
# Generates pink noise @ sample rate for 3 secs
# then plays it to SMSL DAC and Soekris DAC.
#
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("-s", "--samplerate", required=True, type=int, help="sample rate")
args = parser.parse_args()
# set sample rate (defaults to 176400)
srt = {44100,48000,88200,96000,176400,192000,352800,384000}
mysamplerate = 176400
if args.samplerate:
if args.samplerate in srt:
mysamplerate = args.samplerate
print('Sample rate set to: ',mysamplerate)
else:
print('Invalid sample rate: ',args.samplerate)
else:
print('No sample rate provided.')
print('Final sample rate: ',mysamplerate,'\n')
# generate pink noise (3secs)
left = acoustics.generator.pink(mysamplerate*3,None)
# scale it by -80dB
left = left * 0.0001
# copy pink noise from left to right channel
right = left
# generate stereo data
stereo_data = np.array([left,right]).T
# Playback to SMSL DAC
print('Playing pink noise at',mysamplerate,'sps to SMSL...')
wasapi_exclusive = sd.WasapiSettings(exclusive=True)
# play stereo data to SMSL device (subwoofer)
try:
sd.play(stereo_data,samplerate=mysamplerate,blocking=True,device='SMSL DO100 (SMSL USB DAC), Windows WASAPI',extra_settings=wasapi_exclusive)
except:
print('Encountered problem playing data to SMSL.')
print('Finish playing...','\n')
# Playback to Soekris DAC
print('Playing pink noise at',mysamplerate,'sps to Soekris...')
wasapi_exclusive = sd.WasapiSettings(exclusive=True)
# play stereo data to Soekris device (main speakers)
try:
sd.play(stereo_data,samplerate=mysamplerate,blocking=True,device='Soekris dac1541 (Soekris dac1xx1), Windows WASAPI',extra_settings=wasapi_exclusive)
except:
print('Encountered problem playing data to Soekris.')
print('Finish playing...','\n')
sys.exit (0)
#===============================================
I seem to have a problem that when the PC returns from sleep mode, I no longer get system audio unless I either disable/enable the device in Control Panel > Sounds, or sometimes restarting the Matrix audio engine works. This is despite the fact that all USB is set to not power-down at sleep.No, you can use both of VAIO (as Windows default audio output device) and VASIO routings "simultaneously" if you like to do so. Please carefully read and look at my such routing diagram shared in my above post #48.
In this case (since you would use Out 1-2 only), on Windows default output "properties" settings, you need to configure the audio device in 2-CH stereo and also make them full-range stereo so that avoiding loss of low-Fq bass sound.
And, please be careful enough that the default gain settings in VAIO routing is Windows maximum full gain (maximum sound volume level), and you usually need digital gain attenuation/suppression (in my case in #48, I carefully set -16 dB, as you know well some of the Youtube clips has very high audio gain!) for routing/redirect into VASIO routings for proper/suitable level matching with your VASIO audio device(s).
I believe this flexible digital gain attenuation in VAIO on VB Matrix's Routing Grid is really nice when I (we) use either of JRiver MC's YouTube window (which feeds stereo 2CH into VAIO as Windows default audio) and usual SSD music library play (which feeds stereo 2CH into VASIO).
In my case, both of VAIO(2CH) input and VASIO(2CH) input are then fed into system-wide DSP Center "EKIO" for multichannel DSP (XO/EQ/Delay/Relative-Gain) processing.
I seem to have a problem that when the PC returns from sleep mode, I no longer get system audio unless I either disable/enable the device in Control Panel > Sounds, or sometimes restarting the Matrix audio engine works. This is despite the fact that all USB is set to not power-down at sleep.
I run the VBMatrix core at 176400 sps, and drive the DACs at the same rate. Recently I started to switch off the SMSL DAC every night, and when I power on the DAC the next day, it defaults to 44100 sps. I found a small little niggle, VBMatrix will operate the DAC at the default 44100 sps (which is not what I want). There is no way to configure VBMatrix to "force" or initialize the DAC to a preferred sample rate before the VBMatrix routing engine starts.
If you would be interested, please refer here post #776 on my project thread for my "Ignition/Start-up Sequences" and full "Shutdown Sequences" .
Hi boxerfan88, have you tried setting your SMSL DO100 as Master? I try VB Matrix with Benchmark DAC3 and Topping DX1, and the time shift on the Topping is horrible. But the DAC3 has none. Since I cannot set Topping as Master, I guess this has something to do with the time shiftBoth.
The Master DAC drives the LR channel. Master DAC is a Soekris dac1541. VB Matrix is configured to use the Soekris ASIO driver as master.
The slave DAC drives the subwoofer. Slave DAC is a SMSL DO100. VB Matrix is configured to use the SMSL WDM driver as slave.
It was playing background music throughout my workday (at home) ... I did not hear any click/pop/dropout.
Nor detect any DAC drift.
//
If you're wondering how I detect DAC clock drifted (ASIO4ALL):
- usually happens after 25-45 mins of playback
- songs with reasonable bass content will have this weird "whoop whoop" bass tune
- and it progressively gets worse.
- when I stop playback & start playback of the same song ... the weird "whoop whoop" bass sound does not happen anymore
- until 25-45 mins later ... it repeats
=> after I switched over from ASIO4ALL to VB Matrix this "whoop whoop" bass has never occurred once. Even after hours of continuous playback.
Hi boxerfan88, have you tried setting your SMSL DO100 as Master? I try VB Matrix with Benchmark DAC3 and Topping DX1, and the time shift on the Topping is horrible. But the DAC3 has none. Since I cannot set Topping as Master, I guess this has something to do with the time shift
Thanks for your reply. I gave up on VB Marix and am looking into DM7 too.Hi there,
I have tried all 3 combinations:
a. Soekris as master
b. SMSL as master
c. internal as master
All resulted in phase shift around the crossover point.
That’s why I went to buy another DAC - the Topping DM7 which has 8 channels. No more phase shift.
First question : how can I manage crossover with VB-Audio MATRIX & Hang Loose Host ?
Roon - VB-Audio MATRIX - Hang Loose Host (from Accurate Sound) - Dirac Live processor VST Plugin - 2.2 audio system with DLBC
These things can be a complete pain in the butt. If you have a complex pipeline and no sound, you need to have a disciplined diagnostic mindset. "I have no sound because something in my signal chain is broken. Where is it broken?". Most software gives you an indication of activity, e.g. dancing bars, a blinking indicator, or some kind of animation. This is what you want to look for. So let us look at your signal chain. We can break it down into sections. Start from where the signal starts, and check activity in every link in the signal pipeline, like this:
Roon --> VB Audio Matrix (2 channels). Check:
1. Is Roon sending out audio signal? (You should see some kind of indicator that signal is being played)
2. Do you see input in VB Matrix? (you should see dancing bars indicating that VB Matrix is receiving signal).
If the answer to both questions is "no" there is something broken in this part of the chain. You need to examine all the settings.
VB Matrix --> Hang Loose Host (2 channels).
1. Did you route sound from VB Matrix to the correct output? This step can be very tricky if you have never used a mixer before!
HLH has a blinking indicator. Dead when I use first vaio as Roon zone...2. Is Hang Loose Host set up to receive input from the correct outputs in VB Matrix?
3. Is Hang Loose Host giving an indication that it is receiving signal? (NOTE: I don't use HLH, so I don't know if it has a blinking indicator or not).
No sound at the input...so I will check Dirac vst when I will be able to play a stereo sound without any plugin on the chain.Hang Loose Host --> Dirac VST (2 channels)
Once again, look to see if the Dirac VST has a blinking indicator.
OktoDac ProDirac VST --> DAC (4 channels)
I don't know what DAC you have, but my RME indicates that it is receiving input signal, and shows me that it is sending output signal. If your DAC has this feature, check it. If the entire pipeline is intact (dancing bars in every individual link in the chain) and you still have no sound, then the problem is downstream of the DAC. For example, something is unplugged, fuse is blown, etc.
I agree....but I think that I need more than 2 channels because Dirac is doing crossover and send low frequencies to output 3 and 4 of my dacOnce you isolate the problem, then you know where you need to focus your attention. IMO, sending audio from Roon to HLH is only 2 channels, so I don't know why Mitch thinks you need more than 2 channels. Unless for some reason you need to send the output from Dirac's VST to your DAC via a software cable. Maybe there is something you haven't told us? Simplicity is best, and VB Matrix is overkill for sending only 2 channels. It is more complex than what you need, and you are likely to make mistakes when setting it up if you have never seen anything like it before. I would personally suggest a 2ch cable like VAC.