Questions tagged [asio]

ASIO stands for Audio Stream Input/Output, a digital audio protocol. For questions about the Boost.Asio C++ library for asynchronous I/O, use the [boost-asio] tag to avoid ambiguity.

Audio Stream Input/Output is a low-latency protocol for sending and receiving audio data from sound interfaces. It was developed by Steinberg, which offers a licensed ASIO SDK among other audio software technology such as VST plugins.


Please note that in order to avoid ambiguity, questions about Boost.Asio should be tagged with as discussed on meta.

479 questions
10
votes
1 answer

co_await custom awaiter in boost asio coroutine

I am currently trying to use the new C++20 coroutines with boost::asio. However I am struggling to find out how to implement custom awaitable functions (like eg boost::asio::read_async). The problem I am trying to solve is the following: I have a…
ACB
  • 1,607
  • 11
  • 31
8
votes
1 answer

Using cppcoro and ASIO's co_spawn together

I've a library is written using cppcoro and wish to use it with ASIO. But whenever I try to co_spawn a coroutine from said library. Boost complain that the awaitable type isn't correct. For example: #include #include…
Mary Chang
  • 865
  • 6
  • 25
7
votes
1 answer

What's the difference between asio::io_context and asio::thread_pool?

Whats the difference between an asio::thread_pool and an asio::io_context whose run() function is called from multiple threads? Can I replace my boost::thread_group of threads that call io_context::run() with an asio::thread_pool? Or do I need…
7
votes
2 answers

What is the difference between post and dispatch in boost::asio?

I am trying to use boost:asio library to create a threadpool. The official documentation says : dispatch : Request the io_service to invoke the given handler. post: Request the io_service to invoke the given handler and return immediately. Could…
6
votes
1 answer

Asio difference between prefer, require and make_work_guard

In the following example I start a worker thread for my application. Later I post some work to it. To prevent it from returning prematurely I have to ensure "work" is outstanding. I do this with a work_guard object. However I have found two other…
raldone01
  • 405
  • 4
  • 14
6
votes
0 answers

C++20 asio::co_spawn - constraints are not statisfied

I tried to create an application using stackless C++20 coroutines and asio (without boost). Therefore I am using the MSVC Compiler. The following code snippet can be compiled with the /await flag: #include int main(){ asio::io_context…
CHF
  • 264
  • 4
  • 17
5
votes
1 answer

Recording an audio stream in C# from C++ ASIO library

I need to find the best way to record an audio stream. I have already built the low level code in C++ and interfaced parts of it to C#. So i have a C++ callback that gives me an array of array of floats - the audio signal. At the moment, my C++ lib…
pablox
  • 643
  • 2
  • 8
  • 17
5
votes
1 answer

Asio sync-read random-access with exceptions, how many bytes were read?

How can we know how many bytes were read when calling a synchronous read operation on a random-access device and it throws an exception, for example random_access_file ? Is this not supported, and to know how many bytes were read, one is supposed to…
Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212
5
votes
1 answer

Coroutines are not distributed over asio::thread_pool threads

I wanted to try out to c++20 coroutines together with asio. In a simple test three are coroutines which would be executed on a asio::thread_pool with 4 threads. When I run the test all the coroutines are executed one-by-one after each other, and not…
hammurapi
  • 51
  • 3
5
votes
1 answer

How to attach a boost::asio::tcp::io_stream to my io_service?

I'm used to using boost::asio::ip::tcp::sockets where I construct them with an io_service. This has been useful because I have a single io_service for all sockets and these sockets share a threadpool. Now, I'm trying to work with a…
Stewart
  • 4,356
  • 2
  • 27
  • 59
5
votes
0 answers

Use ASIO with Gervill Synthesizer in Java

I am using Gervill's software synthesizer to load an SF2 soundbank, and play music from a Midi keyboard, and I was wondering if it's possible to play the output through ASIO, probably through JAsioHost. I've been trying to look through the Gervill…
Josh Wood
  • 1,598
  • 3
  • 16
  • 21
5
votes
1 answer

input delay with PortAudio callback and ASIO sdk

I'm trying to get the input from my guitar to be played through my computer using the portaudio library and the ASIO sdk. I have been following some of the tutorials on the official website to get the basics set up. Currently I got it working so…
Dries
  • 995
  • 2
  • 16
  • 45
5
votes
2 answers

Multichannel PyAudio with ASIO Support

I'm attempting to interface to a PreSonus AudioBox 1818VSL with PyAudio on Win7, but am having some trouble recording more than 2 channels (stereo) at a time. The PreSonus driver creates many stereo input audio devices (ex. stereo channels 1&2, 3&4,…
Fitzy
  • 83
  • 1
  • 1
  • 5
5
votes
2 answers

How to calculate FFT using NAudio in realtime (ASIO out)

I am programming clone of guitar (violin) Hero as a final project for this school year. The idea is to take input from my electric violin, analyse it via FFT, do some logic and drawing and output it through speakers. Perhaps some steps in parallel…
Lucause
  • 113
  • 1
  • 1
  • 7
4
votes
1 answer

"redefinition; different type modifier" in VS2010

I'm trying to compile some code I downloaded in visual studio. The code was intended for msvc 6, and I imported it to VS2010. The code is for providing ASIO support for labview by compiling a DLL. see here for the whole code. I get the following…
brneuro
  • 326
  • 1
  • 5
  • 15
1
2 3
31 32