DIYing a DSP Processor engine. (Solution) - Page 6 - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
 17Likes
Reply
 
Thread Tools
post #151 of 172 Old 12-19-2016, 07:44 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Well good news...

I was looking into the feasibility of bridging between not just ASIO, but the other sound device-types.

So I looked at the NAudio demo apps again, and at least on the output side... they have working solutions for WASAPI, DirectSound, WaveOut and ASIO.

So I think I'll just steal/hack and slash/reverse engineer that.

I might as well code all of them all at the same time.
Hopefully there are no additional gotcha's...

Input side, I'm not so sure about.

I think at this point in time there are very few apps, if any, that are able to bridge between all of these sound device-types in real-time.

This could very possibly be the first Windows app that can.

Ignoring the expensive and bloated DAW's that is (which are geared for effects-loops and music production on iMac's, rather than EQ'ing/XO'ing in Windows...)

I'm pretty sure that Windows limits non-ASIO devices to 8-ch I believe. So I'd really only be adding it for completeness, and increasing the number of supported sound cards.

7.1 might have been considered fancy 10 years ago, but not any more...
It's more like: YAWN! Is that all? Today.
Attached Thumbnails
Click image for larger version

Name:	5678.jpg
Views:	213
Size:	49.5 KB
ID:	1842065  

Last edited by BassThatHz; 12-19-2016 at 07:55 PM.
BassThatHz is online now  
Sponsored Links
Advertisement
 
post #152 of 172 Old 12-19-2016, 08:28 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
There I got all the devices enumerated into the list.


It was as if the NAudio core was written by 3 or more different programmers (probably because it was!)
They all have their own styles of getting the device names. (Kind of a pain if you ask me, standardization people!)
Code:
            var DeviceList = new List<string>();
            //ASIO
            var ASIODevices = dsp.GetDriverNames();
            foreach (var device in ASIODevices)
            {
                DeviceList.Add("ASIO: " + device);
            }

            //DirectSound
            var DirectSoundDevices = NAudio.Wave.DirectSoundOut.Devices;
            if (DirectSoundDevices != null)
            {
                foreach (var device in DirectSoundDevices)
                {
                    if (device != null)
                    {
                        DeviceList.Add("DirectSound: " + device.Description);
                    }
                }
            }

            //WASAPI
            var enumerator = new NAudio.CoreAudioApi.MMDeviceEnumerator();
            var WASAPIDevices = enumerator.EnumerateAudioEndPoints(NAudio.CoreAudioApi.DataFlow.Render, NAudio.CoreAudioApi.DeviceState.Active);
            if (WASAPIDevices != null)
            {
                foreach (var device in WASAPIDevices)
                {
                    if (device != null)
                    {
                        DeviceList.Add("WASAPI: " + device.DeviceFriendlyName);
                    }
                }
            }

            //WaveOut
            for (int deviceId = 0; deviceId < NAudio.Wave.WaveOut.DeviceCount; deviceId++)
            {
                var capabilities = NAudio.Wave.WaveOut.GetCapabilities(deviceId);
                DeviceList.Add("WaveOut: " + capabilities.ProductName);
            }
Attached Thumbnails
Click image for larger version

Name:	5462.jpg
Views:	210
Size:	256.3 KB
ID:	1842177  

Last edited by BassThatHz; 12-19-2016 at 09:43 PM.
BassThatHz is online now  
post #153 of 172 Old 12-21-2016, 01:44 PM
AVS Forum Special Member
 
DreamWarrior's Avatar
 
Join Date: Nov 2005
Posts: 1,166
Mentioned: 13 Post(s)
Tagged: 0 Thread(s)
Quoted: 334 Post(s)
Liked: 242
Is that the input device drop-down? If so, why are there, seemingly, output devices listed therein?
DreamWarrior is offline  
 
post #154 of 172 Old 12-21-2016, 07:45 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Quote:
Originally Posted by DreamWarrior View Post
Is that the input device drop-down? If so, why are there, seemingly, output devices listed therein?
The computer is just doing what it was told to do.
Someone's gotta code the blue screens of death... if not me, then Who?
BassThatHz is online now  
post #155 of 172 Old 12-22-2016, 01:06 AM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
A lot of people don't know this but...

you can code Assembler in C++ and you can reference C++ dll's in C#, all built in the same solution at once.


You could even use pointers if you wanted to:
Code:
    private unsafe void Add() {
        int a, b; a = 1; b = 1;
        int* y, z; y = &a; z = &b;
        int x = MathLib.Add(y, z);
    }
    public unsafe class MathLib {
        [System.Runtime.InteropServices.DllImport("MathLib.dll")]
        public static extern int Add(int* a, int* b);
    }
    extern "C" __declspec(dllexport) int __stdcall Add(int* a, int* b)
Just in case you ever really wanted to do something low-level and uber-fast.

This allows you to manipulate the L-cache memory of the CPU directly. Bare metal computation.
You can also pick and choose which language you prefer to perform a given action with.
Such as LINQ, Vertexes or CPU ID's and IRQ's.

ASM isn't very human readable, and very hard to debug, but it is as fast as it gets.
C# is very human readable and easy to use and memory management-safe, but also far slower.
C++ is somewhere in the middle, still readable and moderately fast; slightly more error prone but far easier to debug than ASM.
Attached Thumbnails
Click image for larger version

Name:	5378.jpg
Views:	170
Size:	240.0 KB
ID:	1847121  

Last edited by BassThatHz; 12-22-2016 at 02:13 AM.
BassThatHz is online now  
post #156 of 172 Old 02-16-2017, 07:46 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
[Post Moved:]

Work has just been crazy busy lately.
I took a break from this so i don't burn out. Doing this stuff is really draining on me, especially when ASIO is so picky like it is.

This is like my 3rd variant of trying to make multi-ASIO work.
I'm pretty sure it will work this time around because I have working "example code" to glean off of. (Somehow I didn't look close enough and missed it back when I started, probably would have saved me 4 days of coding time.)
I just have to reverse engineer it into some code that actually does it in the way that I want it to.

If ASIO was easier to use I'd have been finished this app before Christmas already.

I was hoping that by now my work load would have diminished but it has only increased, with no end in sight. That's just how it is.
My car has been sucking up all my money, I need 4 new brakes and a new windshield now... this is eating into my audio budget greatly. Like $4000.
Then there was 1 other large unexpected bill that popped up in November, eating into another $1500 of my audio budget.
I've been spending money faster than I've been making it. I'm just now starting out at where I thought I would have been in early November. Another words: less than no progress at all. It's just nuts considering the amount of disposable income I have, I don't know how average people are surviving. I suppose they aren't...

Oh well, I guess I can't complain too hard, I'm still better-off than 80% of the people out there...
BassThatHz is online now  
post #157 of 172 Old 02-17-2017, 12:56 PM
AVS Forum Special Member
 
Augerhandle's Avatar
 
Join Date: Jan 2009
Location: About 25" away from my computer screen
Posts: 4,416
Mentioned: 15 Post(s)
Tagged: 0 Thread(s)
Quoted: 752 Post(s)
Liked: 651
Quote:
Originally Posted by BassThatHz View Post
[Post Moved:]

Work has just been crazy busy lately.
I took a break from this so i don't burn out. Doing this stuff is really draining on me, especially when ASIO is so picky like it is.

This is like my 3rd variant of trying to make multi-ASIO work.
I'm pretty sure it will work this time around because I have working "example code" to glean off of. (Somehow I didn't look close enough and missed it back when I started, probably would have saved me 4 days of coding time.)
I just have to reverse engineer it into some code that actually does it in the way that I want it to.

If ASIO was easier to use I'd have been finished this app before Christmas already.

I was hoping that by now my work load would have diminished but it has only increased, with no end in sight. That's just how it is.
My car has been sucking up all my money, I need 4 new brakes and a new windshield now... this is eating into my audio budget greatly. Like $4000.
Then there was 1 other large unexpected bill that popped up in November, eating into another $1500 of my audio budget.
I've been spending money faster than I've been making it. I'm just now starting out at where I thought I would have been in early November. Another words: less than no progress at all. It's just nuts considering the amount of disposable income I have, I don't know how average people are surviving. I suppose they aren't...

Oh well, I guess I can't complain too hard, I'm still better-off than 80% of the people out there...
We don't blow our money on stupid stuff like brakes and windshields, we save it for important audio visual equipment

Seriously, though, I hope the brakes and windshield didn't go in the same incident.


"The wise understand by themselves; fools follow the reports of others"-Tibetan Proverb
_____________________ http://www.scientificamerican.com/article/auger-handle/ ____________________________
Augerhandle is offline  
post #158 of 172 Old 02-17-2017, 03:49 PM
AVS Forum Special Member
 
mynym's Avatar
 
Join Date: Nov 2004
Location: Columbus, OH
Posts: 1,220
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 25 Post(s)
Liked: 20
2 cents..

This code could be easily ported to .NET core and run on a cheap PI box running lightweight Raspien. Add a ADAU1701 (i/o) or perhaps some cheaper alternative and you got a sub $50 flexible DSP.

If you haven't already throw this on github and lets start building OpenDSP!

Last edited by mynym; 02-17-2017 at 03:53 PM.
mynym is offline  
post #159 of 172 Old 02-17-2017, 06:46 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Quote:
Originally Posted by Augerhandle View Post
I hope the brakes and windshield didn't go in the same incident.
Nothing bad, the brakes are the factory originals from 7.25 years ago. Just worn from general use.
BassThatHz is online now  
post #160 of 172 Old 02-17-2017, 07:07 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Quote:
Originally Posted by mynym View Post
2 cents..

This code could be easily ported to .NET core and run on a cheap PI box running lightweight Raspien. Add a ADAU1701 (i/o) or perhaps some cheaper alternative and you got a sub $50 flexible DSP.

If you haven't already throw this on github and lets start building OpenDSP!
But first, I would have to get it to actually work before bothering to put it on git...
No sense clogging github with useless code.


I'm not sure if it would work well with Net Core or any non-windows OS either, not so much because of my code, but because of the NAudio sound device hooks.

The buses and bi-quads and my general DSP engine would likely port cleanly without any code modifications at all.

The WinForm GUI would not port at all probably (as you'd expect), nor the NAudio stuff I already mentioned.

At the very least you would definitely want to prune the NAudio core to the bare essentials, both to increase speed and to reduce memory allocation and disk space, and ease the difficulty of porting to Core.
Pruning is easily done in .Net, it's just a matter of doing it...

I will be pruning my NAudio references prior to RTM, but right now this code isn't even RC1 or Beta 1.0, it's more like Alpha 3.0 code.

Last edited by BassThatHz; 02-17-2017 at 07:19 PM.
BassThatHz is online now  
post #161 of 172 Old 02-17-2017, 07:26 PM
AVS Forum Special Member
 
mynym's Avatar
 
Join Date: Nov 2004
Location: Columbus, OH
Posts: 1,220
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 25 Post(s)
Liked: 20
Quote:
Originally Posted by BassThatHz View Post
But first I would have to get it to "actually work" before bothering to put it on git...
No sense clogging github with useless code.


I'm not sure if it would work well with Net Core or any non-windows OS either, not so much because of my code, but because of the NAudio sound device hooks.

The buses and bi-quads and my general DSP engine would likely port cleanly without any code modifications at all.

The GUI would not port at all probably (as you'd expect), nor the NAudio stuff I already mentioned.

At the very least you would definitely want to prune the NAudio core to the bare essentials, both to increase speed and to reduce memory allocation and disk space, and ease the difficulty of porting to Core.
Pruning is easily done in .Net, it's just a matter of doing it...

I will be pruning my NAudio references prior to RTM, but right now this code isn't even RC1 or Beta 1.0, it's more like Alpha 3.0 code.

Don't feel obligated to do all of this yourself. Use the community

FWIW I'm a developer of an Android alternative OS that is available on hundreds of devices. If I had not exposed it to the Android ROM community, it would have been only available to a handful of mobile devices.

However... If you feel like their is a monetization strategy.. That's another story.
mynym is offline  
post #162 of 172 Old 02-17-2017, 08:33 PM
AVS Forum Special Member
 
zeus33's Avatar
 
Join Date: Dec 2012
Posts: 3,294
Mentioned: 5 Post(s)
Tagged: 0 Thread(s)
Quoted: 1345 Post(s)
Liked: 1015
Quote:
Originally Posted by mynym View Post
FWIW I'm a developer of an Android alternative OS that is available on hundreds of devices.

Which ROM?
zeus33 is offline  
post #163 of 172 Old 02-18-2017, 01:18 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Quote:
Originally Posted by mynym View Post
Don't feel obligated to do all of this yourself. Use the community
There is no and will be no, monetization.
My goal is to actually use this in my system on a daily basis. So I do feel obligated because otherwise it won't get done, or it will be done all WRONG. hehe

Besides... NAudio has already been on the internet since 2007
https://github.com/naudio/NAudio
So... if anyone "in the community" really wanted to make what I'm making they would have long since done it by now...
there has been absolutely nothing stopping them.

The fact that they haven't tells me that they are either:
-Too lazy
-don't care about such things
-haven't thought of it yet
-are unable to.
or some combination thereof.


-Trinnov's costs more than a Tesla car
-Same with Dolby cinema-grade products
-Oppo hasn't provided a solution, neither have any major brands like Yam, H/K etc No 32-channel Atmos DSP'ing for us!
-I don't trust Emo processors (RMC-1)
-Behringer doesn't have any good high-channel count solutions
-DCX maxes out at only 3 inputs (one really noisy)
-miniDSP is rumoured to have some hiss and only supports up to 10-channels per box anyway.
-JRiver is limited to 32 channels and isn't really designed for real-time
-everything else isn't windows-based or is some bloated 50GB DAW app.
-Motu DP9 DAW app isn't very good (IMO).
-Motu doesn't support onboard XO'ing, and has limited EQ. <-- me-->SAD
-Same for an Orion32 (and it costs MORE, with less channels.)
-apo equalizer doesn't do ASIO and never will.

and so I'm forced to roll my own.

Last edited by BassThatHz; 02-18-2017 at 01:36 PM.
BassThatHz is online now  
post #164 of 172 Old 02-18-2017, 06:13 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Brakes are done. Did them myself. $38 per tire. Disc. Not bad.
Had I taken it to a shop they probably would have charged me $400 easy... no doubt.

Just one less non-audio thing I have to waste money on. (Which means: louder bass. LOL )

Last edited by BassThatHz; 02-19-2017 at 09:44 AM.
BassThatHz is online now  
post #165 of 172 Old 02-19-2017, 07:04 AM
AVS Forum Special Member
 
LastButNotLeast's Avatar
 
Join Date: Feb 2007
Location: 08077
Posts: 7,787
Mentioned: 33 Post(s)
Tagged: 1 Thread(s)
Quoted: 1497 Post(s)
Liked: 1099
Quote:
Originally Posted by BassThatHz View Post
-apo equalizer doesn't do ASIO and never will.
Please understand that I don't know what I'm talking about and this question comes from ignorance:
Wouldn't it be possible to modify Equalizer APO (which I happen to like a lot, BTW) to work with ASIO?
(Remember: answer needs to be in baby talk. )
Michael

Did you really need to quote that entire post in your reply?
Downloadable FREE demo discs: Demonstration Blu-Ray Discs (Independently Authored)
Welcome to AVS - Get out while you still can!
For most of the time, the here and now is neither now nor here. Graham Swift
LastButNotLeast is offline  
post #166 of 172 Old 02-19-2017, 09:25 AM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Quote:
Originally Posted by LastButNotLeast View Post
Please understand that I don't know what I'm talking about and this question comes from ignorance:
Wouldn't it be possible to modify Equalizer APO (which I happen to like a lot, BTW) to work with ASIO?
(Remember: answer needs to be in baby talk. )
Michael
The Equalizer APO developer really dropped the ball on that one.There is no good reason why he/she couldn't have added it.
Maybe you should tell them to stop being lazy and just add the feature already as it is far easier for the original developer to add it in than for another developer to add it; they are already familiar with every line of code...

All they have to do is change the Input and Output streams to allow ASIO, maybe also change where the engine is being hosted and how the GUI and APO can access it. Obviously ASIO streams wouldn't be automatic like APO, it would require manual assignment (which isn't hard to allow.) APO-Auto being the default.
Windows sounds are limited to 7.1 mostly, so only those channels would be mappable by default (which isn't a big deal.)
ASIO supports (at least) 256channels to 256channels, so that part wouldn't change.
They'd probably have to allow for greater channel-count support; I'd bet they are currently limited to 7.1 or 24 channels at-most.

Last edited by BassThatHz; 02-19-2017 at 09:41 AM.
BassThatHz is online now  
post #167 of 172 Old 02-19-2017, 07:06 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Just working on adding an o-scope, RTA and level-meter per channel.
The scope and level is easy the RTA is a bit more involved, I have a working example to glean off of though...
Always nice being able to have basic monitoring of the ASIO channel data.
Attached Thumbnails
Click image for larger version

Name:	234.jpg
Views:	56
Size:	164.2 KB
ID:	1981177  
BassThatHz is online now  
post #168 of 172 Old Yesterday, 03:20 PM
Member
 
datrumole's Avatar
 
Join Date: Apr 2008
Posts: 163
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Quoted: 30 Post(s)
Liked: 46
Quote:
Originally Posted by BassThatHz View Post
Just working on adding an o-scope, RTA and level-meter per channel.
The scope and level is easy the RTA is a bit more involved, I have a working example to glean off of though...
Always nice being able to have basic monitoring of the ASIO channel data.
This feature sounds amazing! would this be a combined view? or per channel?

EDIT: also put me down for beta testing. my entire system runs off EAPO right now, so i potentially should be a good candidate

Last edited by datrumole; Yesterday at 03:43 PM.
datrumole is offline  
post #169 of 172 Old Yesterday, 09:23 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Each channel will have its own.



Each RTA/O-Scope popping up in a separate window (fast computers only if you do many at once!)

Each window will run in it's own thread. [You know: To take advantage of that 8-socket $9000x8 24-core /w HT Xeon-8800 cpu's you are running. ]
Attached Thumbnails
Click image for larger version

Name:	64.jpg
Views:	31
Size:	184.6 KB
ID:	1983233   Click image for larger version

Name:	8.jpg
Views:	31
Size:	254.4 KB
ID:	1983241  

Last edited by BassThatHz; Yesterday at 10:26 PM.
BassThatHz is online now  
post #170 of 172 Old Yesterday, 10:23 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
The BassThatHz Level Meter:

Why have one subwoofer? when you can have a million subwoofers???

Yes it is scrollable too, just in case a million channels don't all fit on your 8K monitor. Because it won't... Because: never enough bass!
Attached Thumbnails
Click image for larger version

Name:	76.jpg
Views:	34
Size:	355.4 KB
ID:	1983281  

Last edited by BassThatHz; Yesterday at 10:30 PM.
BassThatHz is online now  
post #171 of 172 Old Yesterday, 11:04 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
There we go! Enough RTA to choke even the worlds fastest supercomputer...


Ok your computer can run Crysis, but...
Can it run my DSP app with maxed-out settings?

NOPE!
Attached Thumbnails
Click image for larger version

Name:	8769.jpg
Views:	32
Size:	427.5 KB
ID:	1983297  
BassThatHz is online now  
post #172 of 172 Old Today, 07:47 PM - Thread Starter
AVS Forum Special Member
 
BassThatHz's Avatar
 
Join Date: Apr 2008
Location: Northern Okan range (NW Cascades region)
Posts: 7,240
Mentioned: 74 Post(s)
Tagged: 0 Thread(s)
Quoted: 2040 Post(s)
Liked: 1570
Here is a load tester for the Level Meter GUI.
This is like a worst-case senario (5120 updates per second.)
https://drive.google.com/open?id=0Bw...klFcUZrWUo4RG8

I'll have to create a load tester app for the RTA windows next...
BassThatHz is online now  
Sponsored Links
Advertisement
 
Reply DIY Speakers and Subs

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off