JuliaAudio / PortAudio.jl

PortAudio wrapper for the Julia programming language, compatible with the JuliaAudio family of packages
Other
115 stars 19 forks source link

Use Clang wrappers and reduce thread spawning and separate out SampledSignals #79

Closed bramtayl closed 3 years ago

bramtayl commented 3 years ago

This is near total rewrite of the existing code. However, the front end interface remains the same so there should be no breaking changes. The three main changes are:

1) Use clang wrappers (described in the new readme in the gen folder) 2) Reduce thread spawning: instead of spawning a new thread for each read and write, have a single thread for reads and a single thread for writes 3) Add an internal "scribe" interface that allows users to opt out of SampledSignals if they want to access the buffers directly

codecov[bot] commented 3 years ago

Codecov Report

Merging #79 (9ce4cc1) into master (6a018cf) will increase coverage by 1.52%. The diff coverage is 92.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
+ Coverage   90.00%   91.52%   +1.52%     
==========================================
  Files           2        2              
  Lines         250      342      +92     
==========================================
+ Hits          225      313      +88     
- Misses         25       29       +4     
Impacted Files Coverage Ξ”
src/libportaudio.jl 87.87% <91.93%> (+11.82%) :arrow_up:
src/PortAudio.jl 92.39% <92.30%> (-3.14%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 6a018cf...9ce4cc1. Read the comment docs.

bramtayl commented 3 years ago

Ok, so, I figured as long as I'm doing a rewrite for #63, might as well implement it as well. This could probably use an extra set of eyes.

bramtayl commented 3 years ago

Note: I'm guessing this will tank coverage because of all the new automatically generated and unused wrappers

rob-luke commented 3 years ago

Looking good @bramtayl. Just a few requests.

I appreciate all the love you've been giving this package recently. Awesome stuff.

bramtayl commented 3 years ago

Can you tag a new version before and after each PR?

Sure! I'll tag before merging, if we decide to merge

What is clang? Why would we switch to it? What's the benefit? What's the negative?

The clang generators will automatically generate wrappers for a C library based on its headers. So everything you see in libportaudio.jl is automatically generated from the package. We would presumably switch if the benefits outweigh the costs, namely:

Benefits:

Costs:

Maybe @gnimuc who did the clang stuff might have something to add

What's the potential complications this issue may raise that I should look for

This is entirely a rearrangement of the existing code, so there shouldn't be any performance or functionality changes at all. If there is, it would be due to a mistake on my part.

bramtayl commented 3 years ago

So looking at the code, I realized that there were new threads being spawned during each buffer read and write. This takes time, instead, we can just maintain two demons, one for reading, one for writing, and communicate with them via channels. Since I'm making so many other changes, I've gone ahead and done that too. This seems to have totally eliminated xruns on my end, so I've set xrun warnings to true by default.

bramtayl commented 3 years ago

I've also tried to pepper in many more comments and make the code more self documenting to aid in review

rob-luke commented 3 years ago

Lots of detailed work here πŸ‘ want me to take a listen yet? Or you're still going?

bramtayl commented 3 years ago

Still going...sorry I'll label it as WIP. I think the last commit might have reduced performance, and I could simply it a bit too.

bramtayl commented 3 years ago

@rob-luke ok I think I'm ready now!

rob-luke commented 3 years ago

Hi @bramtayl I pulled your branch to run a few tests and have been receiving overflow errors. I do not get these overflow errors on the master branch.

Here is my terminal demonstrating the overflow warnings: image

And here is the terminal demonstrating no warnings on master: image

Is this expected? It may be that you have changed the warning system in this PR, I haven't read the code yet. But you don't describe this change above so I expect its undesired. It may also be that I am installing the new version wrong?

This is being run on MacOS with an external usb microphone. Once we understand this warning then I can test the audio output using my RME FireFace sound card.

bramtayl commented 3 years ago

Yes, I changed warn_xruns to true by default as described here: https://github.com/JuliaAudio/PortAudio.jl/pull/79#issuecomment-866295761. The xrun warnings are disappointing though; I had hoped they might have disappeared. What results do you get if you add warn_xruns = true on the master branch? Do you get the same number of xruns?

rob-luke commented 3 years ago

Thanks for clarifying @bramtayl. Could you summarise all the changes (specifically ones affecting end users like the warnings that I observed) at the top of the pull request in the initial comment. This makes it easier to review, whereas comments scattered throughout commits get easily lost.

Summarising the changes at the top also allows me to more easily go through and check that all the changes work when I test them locally. As it stands now, its hard for me to know what to test.

What results do you get if you add warn_xruns = true on the master branch? Do you get the same number of xruns?

Using the USB microphone with master I get one overflow. With this branch I get two overflows.

Using my RME I get to overflows on each branch.

I dont use audio input very often, so I cant comment if this is expected or not, but I imagine its not good.

bramtayl commented 3 years ago

Hmm, could you try again, but run the full test suite, adding warn_xruns = true to each call to PortAudioStream on master? I get 5 xruns on master and 1 on this branch.

bramtayl commented 3 years ago

I tried my hand at making performance improvements; maybe it helped a little? Also, I edited the initial comment to summarize the changes here.

bramtayl commented 3 years ago

Ok, no more xruns on my end

rob-luke commented 3 years ago

Wow! Ok I'll run the test suite and send you my results today.

rob-luke commented 3 years ago

Running this branch I still get a few over/underflows. I have pasted the output below for you incase that helps.

For such a major rewrite as this it would be good to get some input and testing from others. Once you are happy with this PR lets ping a few people for a review.

PR output ``` ➜ PortAudio git:(bramtayl/master) βœ— julia --project=. test/runtests.jl 9-element Vector{PortAudioDevice}: "Built-in Input" 2β†’0 "Built-in Line Input" 2β†’0 "Built-in Output" 0β†’2 "Built-in Line Output" 0β†’2 "Built-in Line Output" 0β†’2 "Built-in Digital Output" 0β†’2 "Unknown USB Audio Device" 1β†’0 "Fireface UCX (23634778)" 18β†’18 "ZoomAudioDevice" 2β†’2 Test Summary: | Pass Total Tests without sound | 16 16 Recording... β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 Playing back recording... Testing pass-through Interactive tests: Test Failed at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:144 Expression: sprint(show, sink) == "2 channel sink: $(repr(default_input_device_name))" Evaluated: "2 channel sink: \"Fireface UCX (23634778)\"" == "2 channel sink: \"Built-in Input\"" Stacktrace: [1] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:144 [inlined] [2] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [3] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:123 [inlined] [4] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:122 Interactive tests: Test Failed at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:145 Expression: sprint(show, source) == "2 channel source: $(repr(default_output_device_name))" Evaluated: "2 channel source: \"Built-in Input\"" == "2 channel source: \"Fireface UCX (23634778)\"" Stacktrace: [1] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:145 [inlined] [2] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [3] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:123 [inlined] [4] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:122 β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 β”Œ Warning: libportaudio: Output underflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 done β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 Constructors: Error During Test at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:203 Got exception outside of a @test DomainError with 2: 2 exceeds max output channels for Built-in Input Stacktrace: [1] fill_max_channels @ ~/.julia/dev/PortAudio/src/PortAudio.jl:546 [inlined] [2] PortAudioStream(input_device::PortAudioDevice, output_device::PortAudioDevice, input_channels::Int64, output_channels::Int64; Sample::Type, samplerate::Nothing, latency::Nothing, warn_xruns::Bool, frames_per_buffer::Int64, flags::UInt64, call_back::Ptr{Nothing}, user_data::Ptr{Nothing}, input_info::Ptr{Nothing}, output_info::Ptr{Nothing}, stream_lock::ReentrantLock, writer::PortAudio.SampledSignalsWriter{Float32}, reader::PortAudio.SampledSignalsReader{Float32}) @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:628 [3] PortAudioStream t/runtests.jl+ buffers @ ~/.julia/dev/PortAudio/src/PortAudio.jl:625 [inlined] [4] #PortAudioStream#17 @ ~/.julia/dev/PortAudio/src/PortAudio.jl:742 [inlined] [5] PortAudioStream @ ~/.julia/dev/PortAudio/src/PortAudio.jl:742 [inlined] [6] #PortAudioStream#18 @ ~/.julia/dev/PortAudio/src/PortAudio.jl:757 [inlined] [7] PortAudioStream (repeats 2 times) @ ~/.julia/dev/PortAudio/src/PortAudio.jl:757 [inlined] [8] PortAudioStream(do_function::var"#14#25", arguments::String; keywords::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:775 [9] PortAudioStream(do_function::Function, arguments::String) @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:775 [10] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:207 [inlined] [11] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [12] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:204 [inlined] [13] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [14] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:122 [15] include(mod::Module, _path::String) @ Base ./Base.jl:386 [16] exec_options(opts::Base.JLOptions) @ Base ./client.jl:285 [17] _start() @ Base ./client.jl:485 Test Summary: | Pass Fail Error Total Tests with sound | 25 2 1 28 Interactive tests | 7 2 9 Samplerate-converting writing | No tests Queued Writing | 2 2 Queued Reading | 2 2 Constructors | 1 1 2 Errors with sound | 3 3 libportaudio with sound | 10 10 ```
master output ``` ➜ PortAudio git:(master) βœ— julia --project=. test/runtests.jl β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 Test Summary: | Pass Total Debug messages | 2 2 Test Summary: | Pass Total PortAudio Tests | 3 3 β”Œ Debug: β”” @ Main ~/.julia/dev/PortAudio/src/PortAudio.jl:23 Recording... β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 Playing back recording... β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 Testing pass-through β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 Open Default Device: Test Failed at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:78 Expression: sprint(show, sink) == "2-channel PortAudioSink{Float32}($(repr(default_indev)))" Evaluated: "2-channel PortAudioSink{Float32}(\"Fireface UCX (23634778)\")" == "2-channel PortAudioSink{Float32}(\"Built-in Input\")" Stacktrace: [1] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:78 [inlined] [2] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [3] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:62 [inlined] [4] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:61 Open Default Device: Test Failed at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:80 Expression: sprint(show, source) == "2-channel PortAudioSource{Float32}($(repr(default_outdev)))" Evaluated: "2-channel PortAudioSource{Float32}(\"Built-in Input\")" == "2-channel PortAudioSource{Float32}(\"Fireface UCX (23634778)\")" Stacktrace: [1] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:80 [inlined] [2] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [3] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:62 [inlined] [4] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:61 done β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 β”Œ Debug: β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:23 Test Summary: | Pass Fail Total Local Tests | 20 2 22 Open Default Device | 8 2 10 Samplerate-converting writing | No tests Open Device by name | 2 2 Error handling | 6 6 Queued Writing | 2 2 Queued Reading | 2 2 ERROR: LoadError: Some tests did not pass: 20 passed, 2 failed, 0 errored, 0 broken. in expression starting at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:49 ```
bramtayl commented 3 years ago

Yeah, the 4 xruns is very concerning. I don't see any on master, did you add warn_xruns=true to the PortAudioStream calls?

The show and domain errors are also mildly concerning

bramtayl commented 3 years ago

It's also interesting that all four of your errors are from the input. When googling fireface I get "the Fireface UC provides revolutionary ultra-low latencies". Maybe the xrun errors would go away if you bumped up the latency a bit?

bramtayl commented 3 years ago

Ok, the show errors might have been caused by a source/sink issue I noticed and just fixed. But there's still something funny going on. Is it possible that the devices changed mid-test?

rob-luke commented 3 years ago

did you add warn_xruns=true to the PortAudioStream calls?

No 😒, but now I did. See the output below.

master output with xrun warnings ``` ➜ PortAudio git:(masterwxrun) βœ— julia --project=. test/runtests.jl Test Summary: | Pass Total Debug messages | 2 2 Test Summary: | Pass Total PortAudio Tests | 3 3 Recording... β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/libportaudio.jl:329 β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/libportaudio.jl:329 Playing back recording... Testing pass-through Open Default Device: Test Failed at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:77 Expression: sprint(show, sink) == "2-channel PortAudioSink{Float32}($(repr(default_indev)))" Evaluated: "2-channel PortAudioSink{Float32}(\"Fireface UCX (23634778)\")" == "2-channel PortAudioSink{Float32}(\"Built-in Input\")" Stacktrace: [1] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:77 [inlined] [2] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [3] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:61 [inlined] [4] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:60 Open Default Device: Test Failed at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:79 Expression: sprint(show, source) == "2-channel PortAudioSource{Float32}($(repr(default_outdev)))" Evaluated: "2-channel PortAudioSource{Float32}(\"Built-in Input\")" == "2-channel PortAudioSource{Float32}(\"Fireface UCX (23634778)\")" Stacktrace: [1] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:79 [inlined] [2] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [3] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:61 [inlined] [4] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:60 β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/libportaudio.jl:329 done Test Summary: | Pass Fail Total Local Tests | 20 2 22 Open Default Device | 8 2 10 Samplerate-converting writing | No tests Open Device by name | 2 2 Error handling | 6 6 Queued Writing | 2 2 Queued Reading | 2 2 ERROR: LoadError: Some tests did not pass: 20 passed, 2 failed, 0 errored, 0 broken. in expression starting at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:48 ```

Is it possible that the devices changed mid-test?

I am quite sure it didn't, unless the test code makes it. I have run the tests multiple times and always get the same output.

When googling fireface

I think the tests are actually using the "Built-in Input" 2β†’0 which is some motherboard device ive never used. So I dont think the test are using the Fireface. I would prefer the tests do use the Fireface as its a very standard piece of audio equipment in labs. Is there a way I can force the tests to use that device? I tried setting the input_index variable so that the Fireface was used, but then I got stacks of new errors.

and just fixed.

Yes you did!! And that works great. Here is the new output of the test on my pc incase that helps. I am still getting the constructor error.

PR ``` ➜ PortAudio git:(bramtayl/master) βœ— julia --project=. test/runtests.jl 8-element Vector{PortAudioDevice}: "Built-in Input" 2β†’0 "Built-in Line Input" 2β†’0 "Built-in Output" 0β†’2 "Built-in Line Output" 0β†’2 "Built-in Line Output" 0β†’2 "Built-in Digital Output" 0β†’2 "Fireface UCX (23634778)" 18β†’18 "ZoomAudioDevice" 2β†’2 Test Summary: | Pass Total Tests without sound | 16 16 Recording... β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 Playing back recording... Testing pass-through done β”Œ Warning: libportaudio: Input overflowed β”” @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:100 Constructors: Error During Test at /Users/rluke/.julia/dev/PortAudio/test/runtests.jl:203 Got exception outside of a @test DomainError with 2: 2 exceeds max output channels for Built-in Input Stacktrace: [1] fill_max_channels @ ~/.julia/dev/PortAudio/src/PortAudio.jl:546 [inlined] [2] PortAudioStream(input_device::PortAudioDevice, output_device::PortAudioDevice, input_channels::Int64, output_channels::Int64; Sample::Type, samplerate::Nothing, latency::Nothing, warn_xruns::Bool, frames_per_buffer::Int64, flags::UInt64, call_back::Ptr{Nothing}, user_data::Ptr{Nothing}, input_info::Ptr{Nothing}, output_info::Ptr{Nothing}, stream_lock::ReentrantLock, writer::PortAudio.SampledSignalsWriter{Float32}, reader::PortAudio.SampledSignalsReader{Float32}) @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:628 [3] PortAudioStream @ ~/.julia/dev/PortAudio/src/PortAudio.jl:625 [inlined] [4] #PortAudioStream#17 @ ~/.julia/dev/PortAudio/src/PortAudio.jl:742 [inlined] [5] PortAudioStream @ ~/.julia/dev/PortAudio/src/PortAudio.jl:742 [inlined] [6] #PortAudioStream#18 @ ~/.julia/dev/PortAudio/src/PortAudio.jl:757 [inlined] [7] PortAudioStream (repeats 2 times) @ ~/.julia/dev/PortAudio/src/PortAudio.jl:757 [inlined] [8] PortAudioStream(do_function::var"#14#25", arguments::String; keywords::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:775 [9] PortAudioStream(do_function::Function, arguments::String) @ PortAudio ~/.julia/dev/PortAudio/src/PortAudio.jl:775 [10] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:207 [inlined] [11] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [12] macro expansion @ ~/.julia/dev/PortAudio/test/runtests.jl:204 [inlined] [13] macro expansion @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [14] top-level scope @ ~/.julia/dev/PortAudio/test/runtests.jl:122 [15] include(mod::Module, _path::String) @ Base ./Base.jl:386 [16] exec_options(opts::Base.JLOptions) @ Base ./client.jl:285 [17] _start() @ Base ./client.jl:485 Test Summary: | Pass Error Total Tests with sound | 27 1 28 Interactive tests | 9 9 Samplerate-converting writing | No tests Queued Writing | 2 2 Queued Reading | 2 2 Constructors | 1 1 2 Errors with sound | 3 3 libportaudio with sound | 10 10 ```
bramtayl commented 3 years ago

Am I right in counting three xruns each on master and the PR? Not great but not terrible then.

Is there a way I can force the tests to use that device? I tried setting the input_index variable so that the Fireface was used, but then I got stacks of new errors.

The tests should be using the default input and output devices as given by PortAudio. I don't know where PortAudio gets that information from? I could add a line at the start like testing_input_device_index = [default] so you could edit the script more easily.

I tried setting the input_index variable so that the Fireface was used, but then I got stacks of new errors.

What errors?

bramtayl commented 3 years ago

With the domain error, maybe we could add an adjust = false keyword that if enabled would set the requested device count to the max if the max is exceeded? Then we could enable it in all the tests?

bramtayl commented 3 years ago

Ok, I added an adjust_channels = false to enable the tests not to exceed the max, and pulled out the device names to make them easier to hardcode into the tests

bramtayl commented 3 years ago

Updates: I added real docs (both to document new features, and also cause we didn't really have them before). The doctests don't seem to run, I think it has something to do with https://github.com/JuliaIO/Suppressor.jl/issues/28

bramtayl commented 3 years ago

Well, darn, didn't mean to merge this but guess it's too late now...I do think it should be pretty good quality code though, I've been working on it long enough. I don't think there's anything we can do about the doctest issue; I'm guessing the problem is that redirect_stderr and documenter are competing for access to stderr

rob-luke commented 3 years ago

Please use squash and merge when merging. The commit history is now becoming littered with junk like "fix".

@bramtayl Could you try and look up some git magic to retrospectively fix your commit history from this PR? I am sure it can be done.

bramtayl commented 3 years ago

Ok, sorry. I've squashed all the commits and forced pushed, so hopefully that should be better?

bramtayl commented 3 years ago

Hey, and look at the new docs! https://juliaaudio.github.io/PortAudio.jl/dev/

bramtayl commented 3 years ago

@JuliaRegistrator register

JuliaRegistrator commented 3 years ago

Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue.