All times are UTC+02:00




Post new topic  Reply to topic  [ 162 posts ]  Go to page Previous 110 11 12 13 1417 Next
Author Message
PostPosted: Tue Aug 17, 2021 7:19 pm 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 11213
Quote:
Quote:
  • Rewrote sqrt(x) to x * 1 / sqrt(x), which is faster
rofl
If you're interested, search for Quake 3 inverse square root. I was already using that whereever I needed to divide by a square root, but after testing, I found out that even x * 1 / sqrt(x) is more than twice as fast as sqrt(q).

The old 1990's game Quake 3, which was open sourced at some point, had some very weird code in its source that was estimating 1 / sqrt of a value, using an extremely weird trick. This is that code, including the "what the fuck" comment:
Code:
float Q_rsqrt( float number )
{
	long i;
	float x2, y;
	const float threehalfs = 1.5F;

	x2 = number * 0.5F;
	y  = number;
	i  = * ( long * ) &y;                       // evil floating point bit level hacking
	i  = 0x5f3759df - ( i >> 1 );               // what the fuck? 
	y  = * ( float * ) &i;
	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//	y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

	return y;
}
A 2-parter YouTube-series of someone who tried to find out who invented this can be found here: https://www.youtube.com/watch?v=uCv5VRf8op0

Intel, AMD and ARM have all included an instruction in their CPU's for 1 / sqrt(x), so there's no need to use this weird code anymore - but it seems to be what those instructions do internally.


Top
   
PostPosted: Tue Aug 17, 2021 7:41 pm 

Joined: Sun Feb 03, 2013 2:39 pm
Posts: 334
Thanks for the detailed explanation. :)
So it's actually x * inv_sqrt(x) without the slow division. That makes much more sense.


Top
   
PostPosted: Tue Aug 17, 2021 7:53 pm 
User avatar

Joined: Wed Nov 08, 2017 3:16 pm
Posts: 191
Quote:
Quote:
Quote:

Hi, I've just fixed the MPX spectrum drawing. Something broke when I fixed another issue (disabled waveforms were enabled again after restarting).

About input 2: I don't see any problems with it here, so I need more info. Is this a new problem, do you know if it occurred with older versions? And does the same sound card work if you select it as the first input sound card?
i will provide the relevant information shortly after i perform some various tests as you requested but at the moment, i am working.
this is using 64bit beta 38 stand alone.
the issue did not occur with beta 37.
O, that's very odd. I haven't touched the I/O code at all since 037. Just to make sure, can you also verify that 037 is really still ok on your end? It might be broken due to a Windows update or something like that.
sure.
i can record a video capture and show you later on after work, its EST time here.
37 operates perfectly with my current settings. (full STS file attached)
38 has the issue i described using the same STS file.
the program has "admin" rights for execution.
windows version 64 bit, 21H1, build 19043.1165, fully updated.
generally, the buffer for input 2 rapidly depletes despite what setting for input/output (overrule block size = no or suggested or blocksize makes no difference)
edit: i cannot attach the STS file as the size is too large so here is the link from my domain.
http://scpdny.com/PC.sts


Top
   
PostPosted: Wed Aug 18, 2021 1:31 am 
User avatar

Joined: Tue Mar 17, 2009 2:56 pm
Posts: 4165
O something different on input2? Till now, it never be usefull for me since it will eventually overflow buffer on input1, slowly but eventually. Will try b038..

edit: no, same.

_________________
control point
control point2


Top
   
PostPosted: Thu Aug 19, 2021 4:08 pm 
User avatar

Joined: Wed Nov 08, 2017 3:16 pm
Posts: 191
the issue i posted about has been resolved by turning off "give exclusive mode applications priority"
this was causing the sound card for input 1 to be prioritized over the sound card for input 2 which resulted in the buffer for input 2 to rapidly deplete.


Attachments:
exclusive-mode.jpg
exclusive-mode.jpg [ 5.68 KiB | Viewed 2511 times ]
Top
   
PostPosted: Thu Aug 19, 2021 6:32 pm 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 11213
Quote:
the issue i posted about has been resolved by turning off "give exclusive mode applications priority"
this was causing the sound card for input 1 to be prioritized over the sound card for input 2 which resulted in the buffer for input 2 to rapidly deplete.
Hm.. that doesn't really make sense if it's not the same sound card I think? Anyway, I have seen several (mainly niche) sound cards that don't appear to implement these settings very well.


Top
   
PostPosted: Thu Aug 19, 2021 6:46 pm 
User avatar

Joined: Wed Nov 08, 2017 3:16 pm
Posts: 191
Quote:
Quote:
the issue i posted about has been resolved by turning off "give exclusive mode applications priority"
this was causing the sound card for input 1 to be prioritized over the sound card for input 2 which resulted in the buffer for input 2 to rapidly deplete.
Hm.. that doesn't really make sense if it's not the same sound card I think? Anyway, I have seen several (mainly niche) sound cards that don't appear to implement these settings very well.
for Windows OS it does.
if one sound card has priority over another sound card.
think of it similar to process priority level for an executable file.
giving exclusive mode to applications with priority to a sound card enables the application to take control of the sound card and significantly reduces the latency for the application using the sound card.
giving exclusive mode to applications without priority allows the application to take control of the sound card and will reduce latency to the application using the sound card but not as significantly as priority mode will reduce latency.
enabling exclusive mode for the sound card allows only one application at a time to access the sound card.
priority mode for two sound cards being used on one application will "battle" each other for priority, the first sound card to receive priority will be the one that gets priority, the second sound card will not have priority despite having priority enabled.
this explains why the buffer depletion would change from one sound card to the other if i switched sound card ordering.
apparently, input 1 is enabled first before input 2 on Stereo Tool which results in input 1 taking the first priority.
not sure if any of this makes sense to you.


Top
   
PostPosted: Fri Aug 20, 2021 7:19 pm 

Joined: Wed Dec 04, 2019 6:12 am
Posts: 32
Dequantizer seems broken in beta 038 and 039. (Win10, 64bit, standalone)

When turns ON, all sounds blocked after this filter.


Top
   
PostPosted: Sat Aug 21, 2021 1:39 am 
Site Admin
User avatar

Joined: Mon Mar 17, 2008 1:40 am
Posts: 11213
Quote:
Dequantizer seems broken in beta 038 and 039. (Win10, 64bit, standalone)

When turns ON, all sounds blocked after this filter.
Found it, it was caused by the sqrt(x) = x * 1 / sqrt(x) issue - it went wrong when x is 0. Oops...

I was actually just running a release build, but this bug is a bit too scary (and might affect different CPU's differently) - so there'll be one more beta before release.

Edit: It seems that... 1 / (1 / sqrt(x)) is both faster and should solve this issue. Testing now..... This stuff is weird :)


Top
   
PostPosted: Sat Aug 21, 2021 2:53 am 
User avatar

Joined: Fri Jul 08, 2011 6:23 am
Posts: 82
UPDATE: Duplicate bug - turning off the Dequantizer fixes this issue.

Windows 10
64-Bit
Winamp v5.666 Build 3516
ST 9.71 Beta039 (Winamp Plug-In)

Error
GUI: Saw NAN.

This is not a serious problem but it should not happen.

Screenshot attached. Error repeats immediately - no GUI updates in the processing meters and no sound. GUI updates in the INPUT meters.

Video: AMD Radeon R9 200 Series
CPU: Intel i7-5820K
RAM: 40GB

Drivers and updates for Windows and AMD are current.


Attachments:
Beta 39 - Windows 10 64-bit - Winamp Plugin.png
Beta 39 - Windows 10 64-bit - Winamp Plugin.png [ 10.91 KiB | Viewed 2322 times ]

_________________
Great Hits and More!
http://RadioDAVE.US
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 162 posts ]  Go to page Previous 110 11 12 13 1417 Next

All times are UTC+02:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited