Quicr / quicr-mac

quicr-mac is a proof of concept Media over QUIC application allowing audio / video conferencing using libquicr.
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Audio capture not working on Mac Studio M1 #407

Open fluffy opened 6 months ago

fluffy commented 6 months ago

Audio never seems to work on cullens mac studio computer.

RichLogan commented 6 months ago

@fluffy I have some code here to be more forgiving for missing devices: https://github.com/Quicr/WxQ/pull/353. I need to do some verification testing on that but if you want to try it locally it may help you. It does now gracefully handle the reproducible case on my studio where I have no camera or microphone and only the builtin speaker and previously things would (silently) not work.

This also resolves the issue with Apple's aggregate device restriction that previously disallowed us from playing out audio if there's no input device (...yeah) - that should also help tvOS out.

However, if your problem is specifically with capture, we might need to dig into it on your machine, because out of all the things I now make allowances for I don't think any of them cover no captured audio when there is a valid mic.

fluffy commented 6 months ago

One little update up on this. If I plug and extern 1/8 inch audio headset in, it works. And I can use the system sounds setting to select input from the headset and play sound output to speaker in the display. I'm thinking that the issue is when I select the input as the "Studio Display Microphone" (it's over USB) in the system sound input panel.

fluffy commented 6 months ago

The device reports as

Studio Display Microphone:

  Default Input Device: Yes
  Input Channels:   1
  Manufacturer: Apple Inc.
  Current SampleRate:   48000
  Transport:    USB
  Input Source: Default
fluffy commented 6 months ago

Poking around in log messages ...

For the external microphone which works, I see

      AggregateDevice.mm:760   New aggregate device dictionary (208 49):
{
    master = "AppleUSBAudioEngine:Apple Inc.:Studio Display:00008030-001240943C0A802E:8,9";
    name = "CADefaultDeviceAggregate-1217-5";
    private = 1;
    subdevices =     (
                {
            "channels-in" = 1;
            "channels-out" = 0;
            drift = 1;
            name = "External Microphone";
            uid = BuiltInHeadphoneInputDevice;
        },
                {
            "channels-in" = 6;
            "channels-out" = 8;
            drift = 1;
            name = "Studio Display Speakers";
            uid = "AppleUSBAudioEngine:Apple Inc.:Studio Display:00008030-001240943C0A802E:8,9";
        }
    );
    uid = "CADefaultDeviceAggregate-1217-5";
}

while for the studio display mic that does not, I see

     AggregateDevice.mm:760   New aggregate device dictionary (54 49):
{
    master = "AppleUSBAudioEngine:Apple Inc.:Studio Display:00008030-001240943C0A802E:8,9";
    name = "CADefaultDeviceAggregate-1217-1";
    private = 1;
    subdevices =     (
                {
            "channels-in" = 4;
            "channels-out" = 0;
            drift = 1;
            name = "Studio Display Microphone";
            uid = "AppleUSBAudioEngine:Apple Inc.:Studio Display:00008030-001240943C0A802E:6,7";
        },
                {
            "channels-in" = 6;
            "channels-out" = 8;
            drift = 1;
            name = "Studio Display Speakers";
            uid = "AppleUSBAudioEngine:Apple Inc.:Studio Display:00008030-001240943C0A802E:8,9";
        }
    );
    uid = "CADefaultDeviceAggregate-1217-1";
}

On this one we have channels-in=4, I have no idea what 4 even means here. There is some discussion of 4-channel mics in some macs.

fluffy commented 6 months ago

Hmm - the apple specs for the display says that is has "Studio-quality three-mic array with high signal-to-noise ratio and directional beamforming"