-
Notifications
You must be signed in to change notification settings - Fork 29
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
occasional clicks in playback #120
Comments
** light static means some clicking/ticking like when you take off your sweater. These are single-sample bad values with extreme out of range values. There seems no data loss (like we would have if data would be missing), just some bad samples as if some bits get flipped.
|
I read here a suggested relation with date&time panel. But I could not reproduce that. I got just some system sounds through my recording but no clicks or crackle. |
Interesting is that I can only reproduce some crackle so far at 88200. But nothing really disturbing at any other rates, just a slightly above normal noise, which I think is not what the fuzz is about. |
I checked a video here But it does sound similar to the click here (at 2:40) |
I re-routed the cable mess and checked the connections. I lowered the gain on the line-out and set the gain on the line-in a bit higher. Then I did another run of the tests. Same machine. Ethernet now connected in all tests (because I need it on another machine)
|
Conclusion There are issues with glitches in the recording. The noise in the previous test seems to be a cabling/amp setting issue and was solved in the 2nd test. |
I tried to find messages in system.log. However I ran the acceptance test at 88200Hz for 20 minutes and there was not a single glitch ?? Is the console.app that I need to run to see the system log somehow changing system behaviour? |
What I can still try is to disable "set Date and Time automatically" in system preferences as suggested here https://noisegate.com.au/apples-latest-macs-workaround-for-audio-performance-bug/ |
Testing in different configurations now. Next test, MacBook Pro (Retina, 15-inch, Late 2013) clamshell mode, 2.3 GHz Intel Core i7, 16 GB 1600 MHz DDR3, 10.12.6 (16G29) note, the HP adapter is this from conrad, Artikelnummer: 1665682 Fabrikantnummer: 38772 EAN: 192018097759
88200Hz previously had noise so we tested twice. The 480000 now gave two ticks, so we re-tested twice. |
The driver internally is not doing any filtering. So this appears to be some filter deep inside OSX. Another reason to suspect a digital filter here is that there is more pre-ripple than post-ripple, suggesting someone is trying to minimize converter latency. The first suspect to me seems a buffer underrun in a sample rate converter in CoreAudio |
Next test, MacBook Pro (Retina, 15-inch, Late 2013) clamshell mode, 2.3 GHz Intel Core i7, 16 GB 1600 MHz DDR3, 10.12.6 (16G29)
|
Next test, MacBook Pro (Retina, 15-inch, Late 2013) laptop mode, 2.3 GHz Intel Core i7, 16 GB 1600 MHz DDR3, 10.12.6 (16G29) Fresh install of OSX. No additional extensions have been installed, only the EMU ext. Set reaper to request 128byte buffer. Keyboard and mouse also connected to display. OSX 'special effect' sounds of finder are going to laptop speakers, not to EMU.
|
Next test, MacBook Pro (Retina, 15-inch, Late 2013) laptop mode, 2.3 GHz Intel Core i7, 16 GB 1600 MHz DDR3, 10.12.6 (16G29) Fresh install of OSX. No additional extensions have been installed, only the EMU ext. Set reaper to request 128byte buffer. Keyboard and mouse also connected to display. OSX 'special effect' sounds of finder are going to laptop speakers, not to EMU. `tests were done with ethernet disconnected
|
internal speaker output rate changed to 88400Hz, otherwise same as previous Does not make difference,
|
Doing a test on High sierra with same system Next test, MacBook Pro (Retina, 15-inch, Late 2013) clamshell mode, 2.3 GHz Intel Core i7, 16 GB 1600 MHz DDR3, 10.13.6 (17G8030)
|
Something seems not to work with the reaper audio settings , if I request 192 kHz from reaper I still get 96kHz, even though the reaper panel shows 192. In the menu, reaper still shows 96 |
The EMU works perfect under sierra on an older MBP so the EMU works perfect. |
Read up a bit on USB3.
Also on the hardware layer there is separate wires for the USB2 data. So it seems that USB3 is backwards compatible with USB2 by just having a a competely separate hardware layer for USB2. This makes the problem even weirder as this would suggest all the old USB2 driver software could still be inplace , there would just have to be a separate USB driver added to it? I need to look at how OSX integrates the two (USB2 and USB3) |
I can try a few more things
|
There are no EMU messages when the ticks happen. There were a large number of ticks in the first minute yet not a single EMU message. So the EMU seems happlily receiving and processing. |
Again had a run at 88.2kHz with large number of ticks in first 30secs. I don't see special messages in the console (no filters are on) |
There seem 2 possibilities remaining
|
Checking if the problem might be in Reaper. Tested twice with quicktime / Audacity combo, both record and play at 88200. No ticks. |
Tried to record and play back with audacity directly. It gives a bad effect where the 550Hz beep is truncated in blocks of 0.23s with a 0.005s silence between subsequent blocks. Not sure what is going on |
Testing same driver in Mojave, with only power cable and EMU attached through the varta adapter.
Ok, this really is the solution. Except that I need to do the proper correction for the offset The 176 anf 192k rates are now probably failing because these have only 2 input streams while the others have 4. I compute the frame start time now as 1ms before the end time The start of the frame is 0.5ms before end time in the 192k and 176 k rates. I can either store the start time, or compute it as part of the StreamInfo. |
Fixed driver with a 'quick hack': assume frame time 0.5ms if rate>96000 else use 1ms Strictly we should check the frame time but that needs more work to get the value in the StreamInfo. First we need to see if this is a solution |
Acceptance tests . Mojave. Clamshell. EMU connected directly with VARTA adapter. Keyboard, mouse and ethernet through HP adapter. Dell3214Q attached through displayport.
Huh, this driver worked perfect 4 days ago , today not? |
I notice that the EMU noise level goes UP when I UNPLUG the ethernet network cable ?? |
Tried to change the lowpass filter to use mass 1000 instead of 10000, and damping 36 instead of 100. Tested in High Sierra, blocksize 64. Works fine for 44.1 and 88.2 but clicks at 192. Maybe I can still try this in Mojave. blocksize 128 might be acceptable at 192 |
Testing driver with subframe sync, hack for frametime (using 1.0ms offset, or 0.5ms if rate>96000), plus a lowpass filter with 1000 mass. Acceptance tests . Mojave. Clamshell. EMU connected directly with VARTA adapter. Keyboard, mouse and ethernet through HP adapter. Dell3214Q attached through displayport.
|
It seems that with this latest setup, the clicking is more like an all-or-nothing: either it works fine from start to end or you have some clicking from throughout. Also I can do webbrowsing at the same time without influencing the audo (if it doesn't click, it does not start clicking with browser activities). |
Previously I wrote this Checking the delay at the various rates
But it seems I did not explain this difference fully. If the first USB framelist would contain larger-than-normal frames, then these sizes would have been stored in the frameSizeQueue and be compensated in the first following write framelist. Apparently that is never happening but I don't understand why not. |
@dnadlinger thanks for the pointer. I did not yet see this page but there are many pages reporting similarly. For instance it was suggested that unloading timed, turning on/off wifi/network/bluetooth etc etc might help. I did not find evidence that the USB traffic is now all going through T2. The single hardware diagram of a similar mac does not suggest so either. And if it's not then I don't see why the T2 chip would affect USB. Somewhere in this thread I also tested unloading the timed and other stuff but could not find a definitely working fix. |
Maybe the explanation that the delta is never corrected is simple. The first framelist, the writelist guesses 44, 88, 176 samples in each frame. However some read lists have 1 extra sample. Therefore the writelist is behind some delta. The second framelist, the write stream uses the 'correct' number, but that just matches the current readlst size. Therefore the initial delta remains. It is not clear to me how the exact deltas are reached. At 44.1 we have typically 1/10th of 64 = 6 or 7 sampleframes = 42 bytes delta. But it's not clear why there is 114 bytes = 19 sampleframes at 88.2 The 228 at 176k is exactly double the delta at 88.2 so it's consistent but still not clear why. Nevertheless I can plug in these values hard to compensate already in the first sampleframe |
I was mistaken about the frame sizes, see also the wireshark table I reported already above. Here we can also see the max #framesamples in the frame and #frames per second I abbreviate #sampleframes as #s and framelist as flist
274 bytes at 176k4 has been checked with wireshark. 192k is what I remember: 2 frames per ms, but only 2 instead of 4 channels to compensate |
The number of #flists that make up the measured mismatch (right column) is weird in all cases. I would expect that the first TWO frames are a mismatch because the first 2 frames would have the rounded sizes. But there never actually is a 2 frame difference. Does this match with the number of times we get the message "guessing framesize"? |
Checking number of times "guessing some queue size" appears when the sound starts (using reaper). Testing both changing the rate in reaper and change rate then start reaper.
|
Usually there appear
|
So we have never more than 2 of these framelists. The idea of 3 or even 6 framelists with extra samples seems out. These extra samples must all be crammed into the first 2 framelists. Can this be the effect of some buffer (of varying size)in the EMU? |
At 88200 this are the sizes of first incoming frames flist 1: |
This is exactly as expected, 44 sframes in each usbframe and 1 sframe extra roughly each 10 frames. There is no excessive number of input. isochronous out 1,2 all have exactly 44 sframes as expected. 2nd isochronous in also as expected. Nothing excessive. 3rd isochronous out mimics output sizes from isochronous in 1 properly. |
At 88.2k the output is 44 sframes for the first 2 full framelists. The input has extra sframes: 2 initially plus 6 + 6 = 14 extra. This is still short of the measured 19 but pretty close. Let's first check the 176.4 |
176k4 first input framelist has 9 usb frames with 274 instead of 268 BYTES. Notice that sframes have 2 samples or 3 bytes now. That is therefore 90 instead of 88 sframes. Why are we getting 2 sframes extra now instead of 1? There is roughly 1 such 2 extra sframes every 10 usbframes instead of 1 extra sframe every 5 usbframes. So it DOES match expected 12.8 per framelist on average, but the distribution is nonstandard (officialy the frames can have only 1 excess sframe). Additionally the 3rd isochronous OUT again has all usbframes set to default 264, so it's not using the just received sizes. Maybe the input is not yet processed when the output is prepared. The fourth isochronous OUT does use the sizes from the first usbframe input. So in this case the output lags 3 flists, should be 38.4 sframes rather than 76? |
Does osx keep the requested distance from the reported head? |
The logs should show the requested sample offset "sample offset X samples" |
I forgot that we also have 4 extra bytes for the windows bug workaround. And each sframe is now 2*3=6 bytes. So there is really 45 instead of 44 sframes which is correct. |
I got another idea that might be worth trying. Maybe I can just push some extra zero data into the stream at the start. |
Let's try a really simplistic hack in EMUUSBOutputStream - add 1 sample extra to frames
|
Testing driver with subframe sync, plus the 'simplistic hack' above. Acceptance tests . High Sierra and Mojave. Clamshell. EMU connected directly with VARTA adapter. Keyboard, mouse and ethernet through HP adapter. Dell3214Q attached through displayport.
|
Amazing how simple that fix was given the effort it took to find it |
There appear to be lots of problems with recording audio over USB in OSX due to the new T2 security chip
I want to do the acceptance tests https://github.com/Wouter1/EMU-driver/blob/master/Acceptance.md with this new chip now that my new macbook pro has such a chip.
Setup:
MacBook Pro 2019 touchbar, 2.8GHz quad core i7.
macOS Mojave 10.14.6
13', 16GB 2133MHz LPDDR3 RAM,
Iris Plus Graphics 655
Generic HP-Type-C to HDMI 4K Gigabit Ethernet RJ45 Port USB 3.0 Adapter Converter
Both Ethernet and EMU were attached in part of the tests.
Audio rate is set from Reaper. Buffer is set to 512.
I'm not using the computer for other tasks while doing the test. So no keyboard, mouse, trackpad use. No other open apps.
The text was updated successfully, but these errors were encountered: