Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.
CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 25th September 2020, 01:56 PM   #871
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by NickKUK View Post
Just a quick question - which version of openssl ("openssl -v") are you using?

If it's 1.1.1d I'd advise moving given it has security flaws and updating (note that Debian's docker image upgrade to 1.1.1g is "unstable" but works for example). Alternatively if you can upgrade to v3 which is an alpha.
I don't specify any particular version. When compiling it uses pkgconfig to find the installed version, and it works with OpenSSL versions 1.0.1 through 1.1.1 and LibreSSL versions 2.5 through 2.8.
  Reply With Quote
Old 25th September 2020, 03:45 PM   #872
seashell is offline seashell
diyAudio Member
 
Join Date: Sep 2020
Quote:
Originally Posted by phofman View Post
What else would you suggest? IMO that is the only logical way.
I don't suggest anything else. I agree that is the correct default behavior. I was just putting some context to my question and I wasn't certain that's what all
programs do. This is my first > 16 bit DAC and I just got it. It seems alsa itself doesn't do anything for you automatically as I tried to use aplay this morning to send a 16 bit wav file directly to the DAC hardware and aplay simply reported S16_LE wasn't supported. I'm happy to see that behavior as well.

There's probably a plug device available in alsa that will do the described conversion.

Quote:
Originally Posted by HenrikEnquist View Post
If you leave the pipeline empty, then in practice CamillaDSP will do this too. But let's elaborate a bit.
In the capture thread all input samples are converted to 64-bit float in the range -1.0 to +1.0. This is done by casting to float, and then dividing by 2^(nbr_of_bits - 1), which is 32768 for 16 bits. This conversion is bit-perfect, since the value bits of the number aren't changed by the power-of-two division. Only the exponent changes.
At the playback thread then, the values are converted to the format the playback device wants. To get an integer the float number is multiplied with 2^(nbr_of_bits - 1). Again, a power-of-two multiplication only changes the exponent. Then it's rounded and cast to an integer.
So let's do a 16 to 32 bit check. For an input value of 8192 (16-bit), this gets converted to float and divided by 2^15 (32768) giving a value of 0.25. Then this is multiplied by 2^31 (2147483648) and cast to int, giving a final value of 536870912. This is the same as just bit-shifting the number.
Thanks for the details. Exactly what I was hoping for. Just wanted to make sure you weren't doing some post processing peak detection before you scaled the output. Probably a stupid question as I didn't figure you applied a running AGC and couldn't think of how it would clip if you didn't used fixed scaling in/out, but it seemed harmless to confirm the behavior.

So I can just use your gain filter to scale down inside CamillaDSP to give my self some head room right? I assume it will go as follows.

(16 bits integer in) => Floating Point / 2^15 => Multiply by Gain in FP => Multiply by 2^31 and round => (32 bit integer out)

Is that right?
  Reply With Quote
Old 25th September 2020, 05:14 PM   #873
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by seashell View Post
So I can just use your gain filter to scale down inside CamillaDSP to give my self some head room right? I assume it will go as follows.

(16 bits integer in) => Floating Point / 2^15 => Multiply by Gain in FP => Multiply by 2^31 and round => (32 bit integer out)

Is that right?
Yes!
  Reply With Quote
Old 25th September 2020, 05:21 PM   #874
seashell is offline seashell
diyAudio Member
 
Join Date: Sep 2020
Perfect. Thanks again.

Regarding headroom for the DAC I mentioned, according to Benchmark Media (audio company) most DAC and SRC chips don't leave enough headroom for their own internal upsampling. (You can get a peak of ~3dB between samples when you upsample/interpolate.) Fortunately either the DAC chips have been improved since the time they wrote their article or the designer who made my finished DAC did the right attentuation before feeding the actual DAC chip as it worked fine on my sinusoidal test signal built for the purpose of exposing any overflow/underflow/clipping caused by the interpolation peaks of a signal already at full scale. So at least I don't have to worry about that.
  Reply With Quote
Old 25th September 2020, 09:17 PM   #875
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Now the secure websocket is optional, and the binaries on github are built without it. This removes the need for having openssl installed.

The new version is here: Release 0.4.0 beta2 * HEnquist/camilladsp * GitHub


I changed the previous cargo feature name "socketserver" into "websocket", and added the new feature "secure-websocket" to enable the secure websocket support.
  Reply With Quote
Old 27th September 2020, 01:05 AM   #876
wineds is offline wineds  Australia
diyAudio Member
 
Join Date: Apr 2006
Location: Melbourne
I finally managed to capture an error from the putty console :

root@DietPi:/home/tc# sudo /home/tc/DSP_Engine/camilladsp /home/tc/DSP_Engine/filters/null_96000.yml -p 3011
Buffer frames 16384
[2020-09-26T11:00:57Z INFO ws] Listening for new connections on 127.0.0.1:3011.
[2020-09-26T11:00:57Z INFO camillalib::alsadevice] Capture device supports rate adjust
[2020-09-26T11:00:57Z INFO camillalib::alsadevice] Starting playback from Prepared state
[2020-09-26T11:00:58Z INFO ws::io] Accepted a new tcp connection from 127.0.0.1:37678.
[2020-09-26T11:01:42Z INFO ws::io] Accepted a new tcp connection from 127.0.0.1:37680.
Buffer frames 8192
[2020-09-26T11:01:42Z INFO ws::io] Accepted a new tcp connection from 127.0.0.1:37682.
[2020-09-26T11:01:42Z INFO camillalib::alsadevice] Capture device supports rate adjust
[2020-09-26T11:01:42Z INFO camillalib::alsadevice] Starting playback from Prepared state
[2020-09-26T11:02:34Z INFO ws::io] Accepted a new tcp connection from 127.0.0.1:37688.
Buffer frames 16384
[2020-09-26T11:02:35Z INFO ws::io] Accepted a new tcp connection from 127.0.0.1:37690.
[2020-09-26T11:02:35Z INFO camillalib::alsadevice] Capture device supports rate adjust
[2020-09-26T11:02:35Z INFO camillalib::alsadevice] Starting playback from Prepared state
thread 'AlsaCapture' panicked at 'called `Result::unwrap()` on an `Err` value: SystemTimeError(893.27409ms)', src/alsadevice .rs:345:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Could this be because I am concurrently running HTOP in another putty session to monitor CPU usage?
  Reply With Quote
Old 27th September 2020, 09:29 AM   #877
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Great! In short the SystemTimeError means that time went backwards when I measure a duration. Sounds weird but this can happen when the system clock is adjusted by ntp for example. Now the code assumes it will never happen and panics if it does. I'll put in some logic to handle this!
  Reply With Quote
Old 27th September 2020, 10:26 AM   #878
wineds is offline wineds  Australia
diyAudio Member
 
Join Date: Apr 2006
Location: Melbourne
Ok thanks a bunch. I tried to move to V4 today but I am wondering if it is compatible with Jespers script? I think I really need auto sample rate switching. Seemed like the websocket stuff wasn't working anymore with V4 and I got 404 errors on the web GUI. When you come up with a fix can you maybe back port it to V3.2? BTW I traced the error back to the source file and line in your rust code and had a geek at it. Pretty cool error messaging to provide for that!
  Reply With Quote
Old 27th September 2020, 12:19 PM   #879
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
The warning message should of course say something like WARN: Temporal anomaly detected

It's acually very simple to update Jespers script to work with 0.4.x, I think this is both easier and faster than backporting the fix. I'll post the changes you need to do as soon as I can.
Errors on the web gui probably means you need to update the gui itself and/or pycamilladsp.
  Reply With Quote
Old 28th September 2020, 09:06 AM   #880
wineds is offline wineds  Australia
diyAudio Member
 
Join Date: Apr 2006
Location: Melbourne
Lol Temporal anomaly detected haha. Yes I updated the web gui. pycamilladsp to 4.0. Verified using pip list. Is websocket or websocket-client required? I get errors about importing with websocket when starting Python3 main.py. Is there any error in the backend documentation for debian in this respect? Python3 main.py starts ok though when websocket-client is installed but 404 error and no html files are present in the gui build folder. Maybe my folder structure is wrong?

Last edited by wineds; 28th September 2020 at 09:13 AM.
  Reply With Quote

Reply


CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The room correction or speaker correction? What can we do with dsp power now availabl Raimonds Full Range 233 28th January 2017 07:51 AM
Introducing OpenDRC, Open Digital Room Correction engine minidsp miniDSP 20 20th January 2016 05:37 PM
What the difference between dsp room correction eq and software correction erez1012 PC Based 0 10th March 2014 07:07 PM
Writing a Cross-Platform, Free Software Modeling Tool and TS-Parameter DB justinzane Software Tools 6 31st December 2013 06:55 AM
FS: DAC, room-correction, active crossovers, amp, speakers! taloyd Swap Meet 4 14th April 2009 03:16 PM


New To Site? Need Help?

All times are GMT. The time now is 03:47 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio
Wiki