Best way to start audio programming? [closed] - audio

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I want to start programming a synthesizer. I reckoned that I would need to use the sound card, so I started to google. After a while, discovered many options:
  - WaveOut API - I've heard that this one is outdated, so I scrapped this one.
  - WASAPI - Seemed a little bit too low level for what I wanted.
  - DirectSound, XAudio, XAudio2 - Seem reasonably fine, but I want to have as little latency as possible.
  - Asio - Seemed like exactly what I want!
I did find a couple of tutorials and source code to get me started on audio programming. Sadly, the only one I got to work uses the waveOpen API, which I don't want to use.
Then I found this tutorial, which seemed perfect for my needs.
This tutorial is, suprisingly, the only usable (well, not that usable since I can't get it to work) resource I can find on using ASIO. Thing is, I can't get it to work. When I run the demo I get a 'Application has stopped working'-error, followed by the console output:
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'BlueWave.Interop.Asio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'BlueWave.Interop.Asio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at BlueWave.Interop.Asio.Test.TestConsole.Main(String[] args)
WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
When I try to compile, I got a whole lot of Rosie errors:
This is after I manually placed msvcr90.dll and msvcd90.dll in C:\Windows\System32 (I couldn't get them to install any other way). Ow yeah, and of course I installed ASIO4ALL before all this.
So, this is not really a question, but I'm merely asking for general advice. I think it shouldn't be THAT hard to get asio working, but at the same time a link to another resource for learning the ASIO API would be great, as well as any other advice. (Maybe it's easier to just go and try to get Xaudio2 working? I don't know...)
Thanks in advance, and sorry if you think my question is a long or boring read!
EDIT: Thanks for the reactions. I have come across the ASIOHost API by TropicalProgrammer. No idea if it's any good, but it looks promising. I'm looking into it currently. There may be better options, but I have to admit that I got my mind set on ASIO currently.

I suggest having a look at Juce which is a dual-licensed audio framework for writing both audio plug-ins and host applications. Quite a few commercial applications have been built using it.
Since your objective is to build a synthesiser, the path of least resistance is to build it as a VST plug-in. JUCE provides a host application that takes care of managing the OS's audio APIs, good documentation and numerous examples. All you will need to do is implement the render-callback for your synth.
As for ASIO, a great many pro-audio applications have been built with it, mainly because of the traditional shortcomings of the normal audio APIs on successive versions of Windows - particularly where latency or high channel-count is concerned. On Windows, ASIO uses dedicated drivers for the audio hardware and bypasses the host operating system's audio stack. I suspect Juce will take care of this for you.

Not a really helpful answer, but I decided to go with XAUDIO2. I wouldn't really say it's easy to use, but at least there are tutorials available (I use this one, but microsoft has a serie available as well).

Related

WPP tracing for linux

I'm looking for a way to output traces to a log file in my code, which runs on linux.
I don't want to include the printing information in the binary, in every place I deploy it.
It windows, I simply used WPP to trace without putting the actual traces strings in my binary.
How can this by achieved in Linux?
I'm not very familiar with Linux tools in this area, so maybe there is a better system. However, since nobody else has made any good suggestions, I'll make a suggestion. (Probably not a very good suggestion, but the best I can think of right now.)
In theory, you could continue to use wpp. Wpp is simply a template system. It scans the configuration and input files to create data structures. Then it runs a template, fills in the data values it got from the scan, producing the tmh files. You could create a new set of templates that would use Linux apis instead of Windows apis, and would record the message strings in a way that works with some other log decoder system.
I noticed this question only now and would like to add my two cents to the story just for a case. Personally, I truly appreciate Windows WPP Tracing and consider it probably the best engineering solution for practical development troubleshooting among similar tools.
It happened I extended WPP use to Unix-like platforms twice. We wanted to use strong sides of WPP concept in general and yet use it in a multi-platform pieces of code. This was not a porting but rather a wrapper to specific WPP use we configured on Windows. One time we had a web service to perform actual WPP pre-processing on Windows; it may sound a bit insane but it worked fine and effective within the local network. A wrapper script that was executed before each compilation sent a web request, got a processed file and post-processed the generated include file to make it suitable for Unix-like platforms. The second time we implemented a simplified WPP pre-processor of our own (we found yet additional use for it - we could generate the tracing statements differently for production and unit testing, for example). This was a harsh solution: you anyway need to use some physical tracing framework behind the wrapper on non-Windows platform (well, the first time we apparently implemented our own lower level).
I do not think the Linux world has a framework comparable to WPP. Once I even thought it could be a great idea to make an open source porting project for WPP. I am not sure it would be much requested though. I said it is a great engineering solution. But who wants to do dirty engineering work? Open source community prefer abstract object-oriented and generic solutions, streaming and less necessity in corresponding tools (WPP requires special management tools and OS support).Ease of code writing is the today's choice.
There could be Microsoft fault (or unwillingness) in the lack of WPP popularity too. They kept it as an internal framework that came out just by a case with Windows DDK because they have to offer some logging/tracing solution for driver developers. Nobody even noticed much that WPP is well suitable for the user-space code too. And WPP pre-processor for C#, for example, has never been exposed to public at all.
Nevertheless, I still think that WPP porting to Unix/Linux work can be a challenging, interesting and maybe even useful attempt. If someone decides to lead it. :)

Stackoverflow Exception raising only without Visual Studio [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have a difficult WPF application, which works with PTL, many third-party libraries and network. In developer workstation it works fine (in release mode too), but when I run it in client workstation - I got stackoverflow exception in same input data. Also app crashed always in different places.
So, my questions are:
I know, that its impossible to catch stackoverflow exception by try-catch-finally. But may be exists any workaround to understand which module generate this problem?
What different between client and developer environment, if all third-party libraries are equals?
I know, that its impossible to catch a StackOverflowError exception using try-catch-finally.
It is not impossible. Just highly inadvisable, and it probably won't fix the issue. (The best a handler could do would be to abandon what ever caused the problem and try to continue. But what if the application needed the result that was being computed? Or what if the application tries the same computation again?)
But may be exists any workaround to understand which module generate this problem?
Without knowing the real cause of the problem, there is no good workaround.
How do you find the real cause of the problem? Debug the application!
What different between client and developer environment, if all third-party libraries are equals?
In general it could be any of the following:
Different Java versions
Different OS versions
Containers and/or virtualization
Different networking environments
Different external tools installed
Different file system layouts
Different users or file permissions
Different Java application configs
Different input data / databases.
and probably a few more besides. In short there are potentially lots of things that could be different that could cause different behaviors. You might be able to discount some of these as not relevant, but it is also possible to be wrong about that.
IMO, looking for the differences is the wrong approach. A better idea is to debug your application in the client environment. Read the stacktrace, read the code, attach a debugger to the JVM and set breakpoints, etc to try and find out what is actually happening.

Print exception stack trace in JavaME, for the Samsung JET

My research shows the general question is an exceptionally popular.
And in the main there is no one solution for all phones using CLDC/MIDP framework.
I have developed an app that works on all the phones I have tested so far (mostly nokia's) but it throws an IOException on the Samsung jet S8003.
Any ideas as to how can possibly obtain a trace on this specific phone?
I can't answer specifically for your platform, but over the years I've found that the best approach to these kinds of problems is to implement some kind of tracing facility in your code so that you can see the code path that led to the exception. See the answers to this SO question for some ideas on how to accomplish this: Logging in J2ME.
The nice thing about this approach is that it makes it a lot easier to debug customer problems when they run your app on a phone model you've never heard of, especially if there's an easy way for them to enable the tracelog and have it sent to you automatically.
After years of frustration I created a tool that does what you want: http://jarrut.sourceforge.net/
It's not as easy to setup as it could be, but it comes with a working example. After you get it working you will no longer do JME stuff without it.

If you had to redo a site that has 150 tables and 250,000 visitors/day in any web platform, what would it be? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
If you had to redo a site that has around 150 tables and 250,000+ visitors/day in any web platform, what would your choice be and why?
Some points
The team has experienced developers
The old application is written in unrefactored PHP. It's unusable.
Much of the database is not normalized, and there are columns in the wrong spots. Many new features and the database can't support them now.
Desired goals:
Excellent and fast testing (grails is bad for this)
Good seperation of concerns (domain, controllers, views) with ability to not duplicate anything
Concise code & Elegant design - no code bloat
Flexible - we don't want to run into a leaky abstraction problem
Coding and testing are fast - it shouldn't take 1 hour to write a controller test, or we shouldn't have to spend more than 1 minute or so writing a reusable tag, for example.
Scala is on our minds, but we are having a hard time seeing how that can work as the tooling is not mature yet. We actually don't like Grails. A lot of us are used to Java/Spring/Hibernate, but are sick of the low-level nature of it and want something more expressive.
I would put together a detailed study group to analyze our choices, and see what we can use, and how it scales up to the load and tasks it must stand up to. After that, pick out like the top 5 choices for closer inspection, and see what floats with the team. Personally, I've come to like RoR over PHP.
Depending on the status of the old/current project, make sure everything is backed up and version controlled before it gets touched. Some people leave half their project un-vcs'd, or use none at all!
This is a pretty unanswerable question, because there a large number of factors that need to be taken into consideration which you haven't mentioned. For example, what are the skill sets of the developers who will be rewriting it? How is it currently implemented? Can existing code be reused? What are the performance requirements?
If it was my decision, I would choose Groovy/Grails because:
I like Groovy/Grails and know these technologies well
Offers good performance as it's built mostly on Java and mature Java libraries like Spring and Hibernate
Update
Excellent and fast testing (grails is bad for this)
I am not aware of any web framework that puts more effort into testability into Grails. It makes testing all types of artifacts (controllers, domains, services, tag libraries) very straightforward.
We actually don't like Grails
If you already know Java, Spring, and Hibernate, I find it very hard to understand why you don't like Grails.
good old php / mysql / apache on a linux environment is the most stable I've seen .I'm working since 3 year on a Asp.Net / SQL Server / IIS / Windows and only SQL server is stable, but it's really expensive so if you don't know really where you're going (about money), you better have to take care of this parameter.
And on an open environment you'll find more help, I think.

Best distributed filesystem for commodity linux storage farm [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a lot of spare intel linux servers laying around (hundreds) and want to use them for a distributed file system in a web hosting and file sharing environment. This isn't for a HPC application, so high performance isn't critical. The main requirement is high availability, if one server goes offline, the data stored on it's hard drives is still available from other nodes. It must run over TCP/IP and provide standard POSIX file permissions.
I've looked at the following:
Lustre (http://wiki.lustre.org/index.php?title=Main_Page): Comes really close, but it doesn't provide redundancy for data on a node. You must make the data HA using RAID or DRBD. Supported by Sun and Open Source, so it should be around for a while
gfarm (http://datafarm.apgrid.org/): Looks like it provides the redundancy but at the cost of complexity and maintainability. Not as well supported as Lustre.
Does anyone have any experience with these or any other systems that might work?
check also GlusterFS
Edit (Aug-2012): Ceph is finally getting ready. Recently the authors formed Inktank, an independent company to sell commercial support for it. According to some presentaions, the mountable POSIX-compliant filesystem is the uppermost layer and not really tested yet, but the lower layers are being used in production for some time now.
The interesting part is the RADOS layer, which presents an object-based storage with both a 'native' access via the librados library (available for several languages) and an Amazon S3-compatible RESP API. Either one makes it more than adequate for adding massive storage to a web service.
This video is a good description of the philosophy, architecture, capabilities and current status.
In my opinion, the best file system for Linux is MooseFS , it's quite new, but I had an opportunity to compare it with Ceph and Lustre and I say for sure that MooseFS is the best one.
Gluster is getting quite a lot of press at the moment:
http://www.gluster.org/
Lustre has been working for us. It's not perfect but it's the only thing we have tried that has not broken down over load. We still get LBUGS from time to time and dealing with 100TB + file systems is never easy but the Lustre system has worked and increased both performance and availability.
If not someone forces you to use it, I would also highly recommend using anything else than Lustre. From what I hear from others and what also gave myself nightmares for quite some time is the fact that Lustre quite easily breaks down in all kinds of situations. And if only a single client in the system breaks down, it puts itself into an endless do_nothing_loop mode typically while holding some important global lock - so the next time another client tries to access the same information, it will also hang. Thus, you often end up rebooting the whole cluster, which I guess is something you would try to avoid normally ;)
Modern parallel file systems like FhGFS (http://www.fhgfs.com) are way more robust here and also allow you to do nice things like running server and client components on the same machines (though built-in HA features are still under development, as someone from their team told me, but their implementation is going to be pretty awesome from what I've heard).
Ceph looks to be a promising new-ish entry into the arena. The site claims it's not ready for production use yet though.
I read a lot about distributed filesystems and I think FhGFS is the best.
http://www.fhgfs.com/
It worth a try. See more about it at:
http://www.fhgfs.com/wiki/

Resources