[pulseaudio-discuss] PulseAudio on MacOS - Microphone not working

Timo timoreg at tutanota.com
Sat Aug 29 06:07:48 UTC 2020


Hi,

My goal is to record sound from my microphone in a container (for use with Kaldi / DragonFly / Caster) on MacOS.

I've installed and activated pulseaudio on MacOS via

```
brew install pulseaudio
brew services start pulseaudio
```

I can successfully do
```
paplay <some_example>.wav
```
which audibly plays it back.

I can also do
```
parec -d Channel_1__Channel_2.2.monitor test.wav
```
during the playback and afterwards listen to it with
```
pacat test.wav
```
(which plays back part of the original <some_example>.wav).

I can also successfully play audio from the container after enabling the tcp module and pointing the container to the host IP (with PULSE_SERVER env var): `pactl load-module module-native-protocol-tcp auth-anonymous=1`.


However, microphone input does not seem to work:
```
parec -d Channel_1__Channel_2 test.wav
pacat test.wav
```
This yields no audible sound (though I've been rather noisy myself during recording..).


`sox` seems to do the job:
```
sox -d test.wav
paplay test.wav
```
-> Great, I can hear myself!!

But why does the PulseAudio source not work? : /

The sources list shows:
```
> pactl list sources                                                                                                               
Source #0
        State: SUSPENDED
        Name: Channel_1__Channel_2
        Description: Built-in Microphone
        Driver: module-coreaudio-device.c
        Sample Specification: float32le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 6
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: n/a
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY
        Properties:
                device.string = "Built-in Microphone"
                device.product.name = "Built-in Microphone"
                device.description = "Built-in Microphone"
                device.access_mode = "mmap"
                device.class = "sound"
                device.api = "CoreAudio"
                device.buffering.buffer_size = "4096"
                device.vendor.name = "Apple Inc."
                device.icon_name = "audio-card"
        Formats:
                pcm

Source #1
        State: SUSPENDED
        Name: Channel_1__Channel_2.2.monitor
        Description: Monitor of Built-in Output
        Driver: module-coreaudio-device.c
        Sample Specification: float32le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 7
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: Channel_1__Channel_2.2
        Latency: 0 usec, configured 0 usec
        Flags: DECIBEL_VOLUME LATENCY
        Properties:
                device.description = "Monitor of Built-in Output"
                device.class = "monitor"
                device.string = "Built-in Output"
                device.icon_name = "audio-card"
        Formats:
                pcm
```

Any hints on where I might take a deeper look into?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20200829/e38f4388/attachment.htm>


More information about the pulseaudio-discuss mailing list