FlexASIO and Jamulus
tilllt opened this issue · 16 comments
I am trying to get FlexASIO running with Jamulus (https://jamulus.io/) since i had some audio problems with ASIO4ALL and wanted to check if FlexASIO has less problems.
To my knowledge the config should be OK, but Jamulus says something is not working. Here is an excerpt of the FlexASIO.log
https://gist.github.com/tilllt/a1829462e4c020460f57cb2677f68add
The Audio Card is a cheapo class compliant Behringer U-COntrol UCA222, this is on
Edition Windows 10 Home Version 20H2 Installed on 29-11-20 OS build 19042.746 Experience Windows Feature Experience Pack 120.2212.551.0
Would be great if someone had an idea how to solve this!
cheers
Your config contains:
backend = "Windows DirectSound"
bufferSizeSamples = 256
There is a known issue where DirectSound inputs do not work with such small buffer sizes. This is somewhat alluded to in the documentation of the bufferSizeSamples
option. To make it work you will need to increase your buffer size to at least 10 ms (i.e. 480 samples at 48 kHz), or use a different backend.
Unfortunately WASAPI fails as well, even if it seems a different underlying error:
backend = "Windows WASAPI" bufferSizeSamples = 256 [input] device = "Microphone (4- USB Audio CODEC )" suggestedLatencySeconds = 0.0 wasapiExclusiveMode = true wasapiAutoConvert = true channels = 2 [output] device = "Speakers (4- USB Audio CODEC )" suggestedLatencySeconds = 0.0 wasapiExclusiveMode = true wasapiAutoConvert = true channels = 2
https://gist.github.com/tilllt/6867080340454fa04e3c6aeaa4f1db62
This seems to work though.
Backend = "Windows WDM-KS" bufferSizeSamples = 256[input]
device = "Microphone (USB Audio CODEC)"
suggestedLatencySeconds = 0.0
wasapiExclusiveMode = true
wasapiAutoConvert = true
channels = 2
[output]
device = "Speakers (USB Audio CODEC)"
suggestedLatencySeconds = 0.0
wasapiExclusiveMode = true
wasapiAutoConvert = true
channels = 2
... no, it doesnt, if you select input and output of different hardware devices (necessary for jamulus)
backend = "Windows WDM-KS" bufferSizeSamples = 256 [input] device = "Microphone (USB Audio CODEC)" suggestedLatencySeconds = 0.0 wasapiExclusiveMode = false wasapiAutoConvert = true channels = 2 [output] device = "Headphones ()" suggestedLatencySeconds = 0.0 wasapiExclusiveMode = false wasapiAutoConvert = true channels = 2
https://gist.github.com/tilllt/313072dd7d936410d767cf40c120db70
WASAPI only advertises 1 channel on your input device. Attempting to use it with channels = 2
will fail, as apparent in the log:
2021-01-31T10:20:00.5600905+01:00 18764 880 WARNING: input channel count is higher than the max channel count for this device. Input device initialization might fail.
…
2021-01-31T10:20:00.5603608+01:00 18764 880 Opening PortAudio stream with...
2021-01-31T10:20:00.5603786+01:00 18764 880 ...input parameters: PortAudio stream parameters for device index 17, 2 channels, sample format 2147483656 [Int16, NonInterleaved], suggested latency 0s, host API specific: 56 bytes structure, type 13 [WASAPI], version 1, WASAPI specific: flags 97 [Exclusive, ExplicitSampleFormat, AutoConvert], channel mask 0, host processor output 0000000000000000, host processor input 0000000000000000, thread priority 0 [None], stream category 0 [Other], stream option 0 [None]
2021-01-31T10:20:00.5604505+01:00 18764 880 ...output parameters: none
2021-01-31T10:20:00.5604726+01:00 18764 880 ...sample rate: 48000 Hz
2021-01-31T10:20:00.5604923+01:00 18764 880 ...frames per buffer: 0
2021-01-31T10:20:00.5605101+01:00 18764 880 ...stream flags: 8 [PrimeOutputBuffersUsingStreamCallback]
2021-01-31T10:20:00.5605290+01:00 18764 880 ...stream callback: 00007FFEBCE59FE0 (user data 0000000000000000)
2021-01-31T10:20:00.5605548+01:00 18764 880 [PortAudio] WASAPI ERROR PAERROR: -9998 : Invalid number of channels
[FUNCTION: OpenStream FILE: C:\Users\edechamps\Documents\FlexASIO2\src\portaudio\src\hostapi\wasapi\pa_win_wasapi.c {LINE: 3739}]
In contrast WDM-KS sees 2 input channels, which likely means your Windows audio device is misconfigured.
Regarding your WDM-KS config, the log indicates that it's the output device that's failing this time. I'm suspicious that Headphones ()
is not a viable device as it doesn't appear in other backends; you might want to try some other device.
A word of advice: please take it one step at a time when troubleshooting this stuff. It's not a good idea to pass lots of options just "because you can". FlexASIO defaults are designed to work in the majority of cases - overriding them makes failures more likely. Users are only expected to override options if they are trying to tweak the behaviour of a known good initial configuration, which is not what we have here. So my advice would be to stop trying to override options such as suggestedLatencySeconds
, wasapiExclusiveMode
, wasapiAutoConvert
or channels
, for now. Just start with a minimal config, verify that it works, then add them back one at a time.
I was not randomly passing options, but selecting the different HW Devices and Backend Drivers from the FlexASIO GUI. IF FlexASIO knows about certain configurations that will not work, it should probably mention these config problems in layman terms to the user, i guess it would be pretty easy for your software tools to output i.e. the number of available channels per HW device so this could be passed to the GUI. For a regular user it is VERY difficult to find out this info and ultimately (for me) would mean i use a tool which manages to present this info in a understandable way. Like Asio4all does.
Or do you seriously think you can expect a regular user to browser your log files, understand what is happening there and come to a conclusion about what the problem is?
BTW
Headphones () probably is the Onboard Realtek Minijack Output of my Laptop, it is called "Headphone ()" by whatever software involved in this process, definitely has 2 outputs and also works correctly in Windows.
Keep in mind that FlexASIO and FlexASIO GUI are two different projects maintained by different people. If FlexASIO GUI allows you to set invalid options (such as a channel count that is not valid for the currently selected device and backend), then that's a bug in FlexASIO GUI, not FlexASIO.
When troubleshooting issues, I would recommend editing the configuration file directly so that you have direct control over the options used. I would only recommend using FlexASIO GUI as a convenience editor when things do work.
the number of available channels per HW device so this could be passed to the GUI. For a regular user it is VERY difficult to find out this info and ultimately (for me) would mean i use a tool which manages to present this info in a understandable way.
Yes, as far as I know, FlexASIO GUI does not tell you how many channels a device has. To get that information you would need to use PortAudioDevices
(which is easier to read than the log). This could be a feature request against FlexASIO GUI.
But again, you don't need to know this. Just use the default channel count and see what happens. Overriding the channel count in FlexASIO configuration won't help except in very specific use cases. In FlexASIO GUI it looks like the default can be used by leaving the "Channels" fields at their default value (zero).
Or do you seriously think you can expect a regular user to browser your log files, understand what is happening there and come to a conclusion about what the problem is?
Not necessarily. However I would expect a regular user to understand the options they are explicitly overriding in the config file and not override them unless they have a good reason to (especially when faced with failures).
Is that user-friendly? Of course not. But keep in mind this is a free project with basically zero resources. Unless someone steps in and contributes improvements (e.g. better GUI, better error reporting), I'm afraid that's the way it is.
Headphones () probably is the Onboard Realtek Minijack Output of my Laptop
Are you sure that's not Speakers (Realtek HD Audio output)
?
Don't get me wrong, i am greatful there is an alternative to ASIO4All, but I think you should not expect people to get to an inside knowledge of ASIO, Windows Audio Drivers or the apparently numerous bugs which exist in this ecosystem. A simple command to test the actual config and say "yes this will work" or "no this will not work" would be a good starting point. The Output of FlexASIOTest is NOT a comprehensible config test and I would position me in the upper third of people in terms of computer knowledge.
A simple command to test the actual config and say "yes this will work" or "no this will not work" would be a good starting point. The Output of FlexASIOTest is NOT a comprehensible config test.
That's a good idea. Filed a feature request at #111.
OK, sorry to bother you againwith this but i seriously have no clue what the problem is now.
- so i selected the correct Device(s) now,
- removed the channel amount to choose default
https://gist.github.com/tilllt/53b8be4b725a035bab26fa459809e9da
2021-01-31T14:05:44.0251203+01:00 2792 11760 Opening PortAudio stream with...
2021-01-31T14:05:44.0251377+01:00 2792 11760 ...input parameters: PortAudio stream parameters for device index 27, 2 channels, sample format 2147483649 [Float32, NonInterleaved], suggested latency 0s
2021-01-31T14:05:44.0251613+01:00 2792 11760 ...output parameters: PortAudio stream parameters for device index 20, 2 channels, sample format 2147483649 [Float32, NonInterleaved], suggested latency 0s
2021-01-31T14:05:44.0251831+01:00 2792 11760 ...sample rate: 48000 Hz
2021-01-31T14:05:44.0252015+01:00 2792 11760 ...frames per buffer: 256
2021-01-31T14:05:44.0252189+01:00 2792 11760 ...stream flags: 8 [PrimeOutputBuffersUsingStreamCallback]
2021-01-31T14:05:44.0252372+01:00 2792 11760 ...stream callback: 00007FFD36093008 (user data 0000000002A36430)
2021-01-31T14:05:44.0252600+01:00 2792 11760 [PortAudio] OpenStream:sampleRate = 48000.000000
2021-01-31T14:05:44.0252790+01:00 2792 11760 [PortAudio] OpenStream:framesPerBuffer = 256
2021-01-31T14:05:44.0253901+01:00 2792 11760 [PortAudio] Pin create result = 0x00000000
2021-01-31T14:05:44.0254267+01:00 2792 11760 [PortAudio] Capture pin frames: 480
2021-01-31T14:05:44.0264517+01:00 2792 11760 [PortAudio] Pin create result = 0x00000000
2021-01-31T14:05:44.0265024+01:00 2792 11760 [PortAudio] Render pin frames: 0
2021-01-31T14:05:44.0265241+01:00 2792 11760 [PortAudio] Input frames chosen:480
2021-01-31T14:05:44.0265432+01:00 2792 11760 [PortAudio] Output frames chosen:0
2021-01-31T14:05:44.0265656+01:00 2792 11760 [PortAudio] Input buffer allocated (size = 3840)
2021-01-31T14:05:44.0265857+01:00 2792 11760 [PortAudio] Input buffer start = 0000000007CB0C90 (size=3840)
2021-01-31T14:05:44.0266142+01:00 2792 11760 [PortAudio] Failed to get buffer with notification
2021-01-31T14:05:44.0266406+01:00 2792 11760 [PortAudio] Failed to get buffer without notification
2021-01-31T14:05:44.0266603+01:00 2792 11760 [PortAudio] Buffer size on 128 byte boundary, still fails :(
2021-01-31T14:05:44.0266787+01:00 2792 11760 [PortAudio] Failed to get output buffer (with notification)
Not quite sure what's going here. It might be that WDM-KS is not happy with your buffer size, which in turn might be caused by the suggestedLatencySeconds = 0.0
setting. Again, it would be best to reduce your config to the bare minimum, and then add things back one at a time.
WASAPI might be easier to work with. If you fix your Windows settings it should provide the correct channel counts.
Since choosing 0 in the GUI seems to translate to "Use Default" for the channel count assumed that 0.0 for Latency defaults to "use defaults" as well. That seems to be a wrong assumption So you were right, deleting it from the config makes jamulus work. I couldn't find ANY config that works with wasapi but I will give it another try later.
Since choosing 0 in the GUI seems to translate to "Use Default" for the channel count assumed that 0.0 for Latency defaults to "use defaults" as well.
What counts is what's in the configuration file which is shown to the right of FlexASIO GUI. To use the defaults, the setting should not appear in the configuration file. You can delete the lines manually to make sure.
I filed flipswitchingmonkey/FlexASIO_GUI#11 to request that FlexASIO GUI stop messing with the FlexASIO defaults.
Closing due to inactivity.