Faint high pitch noise when using Audio Board & USB

Status
Not open for further replies.

ftrias

Well-known member
There is a very faint continuous high pitch noise when I'm using the Teensy Audio board and USB Audio as an input device to the computer.

I have a Teensy 3.1. Arduino 1.8.8. Teensyduino 1.4.5. Audio Shield Rev B. MacOS 10.14. But problem also heard on Windows 10.

Steps to reproduce on Mac (similar to Windows)

1. Open Examples / PassThroughUSB.

2. Compile & upload.

3. Plug in headphones to audio adapter.

4. Go to the Sound Preferences (speaker icon on top menu bar)

5. Click Input tab and select Teensy Audio.

6. High pitch sound starts.

7. If you click a different input it stops.

When trying to diagnose this I was able to get rid of the noise if I make the following change that basically disables sending any USB Audio data back to the computer.

usb_audio.cpp:318

Code:
unsigned int usb_audio_transmit_callback(void)
{
return 0; // BUG: eliminate buzz
        static uint32_t count=5;
        uint32_t avail, num, target, offset, len=0;

Is anyone else experiencing this problem? My "fix" isn't really a fix, but more of a clue.
 
Last edited:
I've seen USB audio issues discussed at length in a couple different threads including a detailed one with Paul and FrankB though that was addressing clicks, rather than high pitch noise harmonics. If it's noise from the USB, try using the Teensy on a laptop that is not plugged into the wall via charger. This will help eliminate ground loops.

If it's at all related to the problem discussed in the thread I linked, I think the final conclusion was the non-standard audio rate used by the Teensy of 44117 Hz causes buffering issues with USB where it's expecting 44100, but I could be mis-remembering.

I've never been able to get fully clean audio over USB from the Teensy to a PC. I tried everything including multiple laptops/desktops, OSes and applications. I'm quite familiar with low-noise audio design so I know it wasn't my cables, ground loops ,etc.
 
I remember there were one or two little bugs, too. I had fixed them, but don't remember where the code is.. :)
 
I've seen USB audio issues discussed at length in a couple different threads including a detailed one with Paul and FrankB though that was addressing clicks, rather than high pitch noise harmonics. If it's noise from the USB, try using the Teensy on a laptop that is not plugged into the wall via charger. This will help eliminate ground loops.

If it's at all related to the problem discussed in the thread I linked, I think the final conclusion was the non-standard audio rate used by the Teensy of 44117 Hz causes buffering issues with USB where it's expecting 44100, but I could be mis-remembering.

I've never been able to get fully clean audio over USB from the Teensy to a PC. I tried everything including multiple laptops/desktops, OSes and applications. I'm quite familiar with low-noise audio design so I know it wasn't my cables, ground loops ,etc.

It's really time to move the audio lib completely over to 48kHz sample rate, I think. The 8.8% increase in the audio file size should be worth an immediate resolution of all these tiny timing things here and there.
 
This means to be incompatible to existing code and most wav-files.
However, a switch somewhere would be good.
Audio in-and outputs for the new T4 can support 48KHz without any code change (and for some outputs 48KHz really would be good), however, for T3.x it means some work (not too much..)
 
perhaps a new audio.h, called "audio48.h" could do it.. ? that would make it simple and the user has the choice which to use. it is included by all audio-objects and would be ideal.
 
Status
Not open for further replies.
Back
Top