-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tixml locale / Presets don't parse in locales which don't use "." as a decimal separator #710
Comments
|
To clarify your last comment: ubuntu studio live dvd, a different distribution, you can load surge and play every preset successfully? So these presets are only broken in your xubunutu install? Any ideas on what's different between the two distributions? Thank you for the clear report. |
|
Yes, with ubuntustudio dvd, everything works. Don't have any idea what is difference. I have also one xubuntu machine where surge works, but at least all libraries which surge depends are identical. Tried also build surge myself, no difference |
|
OK so @jsakkine and I just pushed the first version of a headless which actually plays samples to an internal buffer. This will be useful to understand how it works on your system, especially since you can build the synth. So if you don't mind could you do us the following on the broken system
this will start a program running which plays every pad with a C major scale into a buffer and then prints the min and max sample. You should see output like this So the question is
Thank you! |
|
There is few with 0-0, but they are really minor. Some are outside [-1,1], does that say something? |
|
Yeah I think that outside the -1,1 range is either misconfigured patch or the ‘pop n click’ problem. I’m still investigating But if most work for you in headless then it is a mystery what causes them to not sound in synth. The control paths aren’t that different. That makes me think something is broken between surge doing a process in the synth and the host transporting it to the control somehow. But I’m not sure how. Bit of a loss right now. I’ll continue pondering. Than you for testing. |
|
I have a theory that there’s a bit of ininitialized memory somewhere which is causing things to wedge. Your problem, the other click and pop, then wedge when changing sample rate on Mac. But I haven’t found it yet. |
|
Heya I was in there anyway and #721 adds RMS and L1 norms to the headless display. Should push it in the next 20 minutes. When I do can you try again? Thanks! |
|
Tested, and RMS or L1 values do not explain anything. Playing and non-playing patches are on same ranges. |
|
Opening my eyes: on 'broken' patches, Output volume slider is in zero. So next thing is to find out why on certain systems it is zero, or at least fix it not to be zero. I don't think this is only thing that is somehow weird, but at least towards better. If you push something (can be branch also) I can rebuild & test. |
|
OK useful to know. It is not the raw synth it is somewhere in the synth -> plugin -> audio layer. That “output slider at zero” - that’s the surge output volume slider? |
|
Yes, on 'Output' section, 'volume' slider, above 'pan' slider. And that value is from patch, so it is individually set for every patch, and for most of the patches it is on zero. |
|
Looking at Behemoth and Crush Bass presets:
|
|
Indeed, your preset makes much more sense :-) Preset loading has some strangeness |
|
@tavasti can ya zip the presets up and attach them so i can attempt to load them just to see if the files themselves are somehow magically corrupted? |
|
tried a diff: seems like the files have no differences.. if diff is how i figure this thing out, that is :) |
|
KaleidoscopeApp also reports the same thing. they're the same file. so something funky going on with Stock Xubuntu :O |
|
Running gdb on vst plugin load may be tricky? So some debug prints? Where is preset loading code? |
|
Follow from surgesynthesizer::loadpatch downwards Print and run in Carla single is how I debug Linux mostly yeah |
|
Loading with carla-single, patches seem to load presets ok (volume not zero), but when loading with carla, mixbus or ardour, they don't. |
|
huh. Well that's concerning. |
|
have a bit of time this morning. let me build a xubuntu and try and replicate. "something" is wrong. |
|
This shows where it goes wrong: If value is 0.xxxxx it will result 0. So all values below 1 will result 0. Why, don't really know.... |
|
Now I got it, it is locale dependent. I have LC_NUMERIC=fi_FI.UTF-8 |
|
Everything works with: |
|
OK that generally didn't work very well. I got a VM working in parallels but couldn't get the resolution off of 800x600 Any tips on how to do those steps? |
|
Forget that xubuntu, most likely any linux with 'export LC_NUMERIC=fi_FI.UTF-8' will fail. And maybe also OSX and Windows also? |
|
ooooh that sounds like some very good debugging. What have you found? |
|
I'll test OSX now too with that set |
|
Problem is sscanf( value.c_str(), "%lf", dval ) And same problem is also most likely on saving presets. |
|
Right. That makes perfect sense I don't have fi locale installed on my machines. but this is a very very good find. |
|
it's only two places in tinyxml which use sscanf for double values (there's a few which use it for integers and hex but that's all fine). |
then this program produces this output There is no std library function which uses locale("C") by default. So I think we need to go to those sscanf and sprintf calls and do a setlocale("C") around them but I'm out of my depth here. I have not done a lot of locale specific programming. Your thoughts? |
|
here's what a solution looks like |
|
So @tavasti do you think you can use that stream imbued with locale change to modify the sscanf and sprintf in the tinyxml lib? I confirmed it works on macOS and linux both. We can check windows if you get a PR together. |
|
And great find! Thank you! I would (obviously) have never found that!! |
|
My C++ is badly rusted while not used in 15 years, but with that clear example I should be capable to do it. |
|
OK! If you get stuck I can bang it out in the pipeline also. Not that hard. But if you do get it together that would be wonderful. Give me a minute and I'll give you a crystal clear template. Sound good? |
|
Sounds good. Busy right now, but I expect this to get this done in next 48 hours. |
|
OK here's a great sample to follow which gives this output for me |
|
And I see 4 printfs and 2 scanf in libs/tinyxml which need changing. Thanks! |
|
PR created. Replacement of sprintf in tinyxml.cpp are not tested, because I don't know even if they are used. Preset writing sprintf is in src/common/Parameter.cpp |
Preset loading and saving used sscanf and sprintf. This will fail with locales which have some other decimal separator than '.' Closes #710
…#745) Preset loading and saving used sscanf and sprintf. This will fail with locales which have some other decimal separator than '.' Closes surge-synthesizer#710 Former-commit-id: befacc3a1d6e61ab006edfec9cc7395f6041f223 [formerly e13e82c] Former-commit-id: 17a68ec5743989c49f5346a9b289fc0edd015973 Former-commit-id: f966ae6970193a642045e57a8b75b3f45e55ab4b



Edit: this Original description and beginning if discussion is on false assumptions of reason. Read more at the end
When running surge in xubuntu 18.04, bit part of the presets do not produce any sound. With failing presets, surges own output meter stays on zero.
Steps to reproduce the behavior:
Presets that work:
From beginning of Bass presets:
Bass 10, Deep end, Distorted MW, FM Bass 1
From beginning of pads: Ghost pad
Tested with 48k and 44.1k and different Frames/period (256,512,1024)
Have tested with 2 different USB audio interfaces, and also with virtual machines default audio interface.
Same virtual machine with ubuntu studio live dvd, all presets work, so it is verified that this is not hardware problem.
The text was updated successfully, but these errors were encountered: