Skip to content
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

Error when using Apple Airpods as output device on Mac M1 #38

Open
hamav8tor opened this issue Dec 31, 2022 · 2 comments
Open

Error when using Apple Airpods as output device on Mac M1 #38

hamav8tor opened this issue Dec 31, 2022 · 2 comments

Comments

@hamav8tor
Copy link

hamav8tor commented Dec 31, 2022

Any ideas? Works fine on Mac speaker output.

$ remoteAudio enumerate

Available audio devices and supported Host APIs:

Detected 1 host API(s):

Name:                   Core Audio
Default input device:   'Dave’s AirPods Pro'
Default output device:  'Dave’s AirPods Pro'
Devices:
	Name:                      'Dave’s AirPods Pro'
	MaxInputChannels:          1
	MaxOutputChannels:         0
	DefaultLowInputLatency:    12.666666ms
	DefaultLowOutputLatency:   10ms
	DefaultHighInputLatency:   31.333333ms
	DefaultHighOutputLatency:  100ms
	DefaultSampleRate:         24000

	Name:                      'Dave’s AirPods Pro'
	MaxInputChannels:          0
	MaxOutputChannels:         1
	DefaultLowInputLatency:    10ms
	DefaultLowOutputLatency:   12.666666ms
	DefaultHighInputLatency:   100ms
	DefaultHighOutputLatency:  31.333333ms
	DefaultSampleRate:         24000

	Name:                      'MacBook Air Microphone'
	MaxInputChannels:          1
	MaxOutputChannels:         0
	DefaultLowInputLatency:    33.6875ms
	DefaultLowOutputLatency:   10ms
	DefaultHighInputLatency:   43.020833ms
	DefaultHighOutputLatency:  100ms
	DefaultSampleRate:         48000

	Name:                      'MacBook Air Speakers'
	MaxInputChannels:          0
	MaxOutputChannels:         2
	DefaultLowInputLatency:    10ms
	DefaultLowOutputLatency:   24.416666ms
	DefaultHighInputLatency:   100ms
	DefaultHighOutputLatency:  33.75ms
	DefaultSampleRate:         48000

	Name:                      'Microsoft Teams Audio'
	MaxInputChannels:          2
	MaxOutputChannels:         2
	DefaultLowInputLatency:    10ms
	DefaultLowOutputLatency:   1.333333ms
	DefaultHighInputLatency:   100ms
	DefaultHighOutputLatency:  10.666666ms
	DefaultSampleRate:         48000

$ remoteAudio client nats --config remoteAudio-bt.toml
Using config file: remoteAudio-bt.toml
unable to open playback audio stream on device Dave’s AirPods Pro: Invalid number of channels

$ cat remoteAudio-bt.toml
[nats]
broker-url = "home-shack"
broker-port = 4222
username = "km3t"
password = "xxxxxxxxxx"

[input-device]
device-name = "default"
samplerate = 48000
latency = "5ms"
channels = 1
hostapi = "default"

[output-device]
device-name = "Dave’s AirPods Pro"
samplerate = 48000
latency = "5ms"
channels = 1
hostapi = "default"

[opus]
application = "restricted_lowdelay"
bitrate = 24000
complexity = 5
max-bandwidth = "wideband"

[audio]
rx-buffer-length = 5 # 10x10ms (@framesize=480 & samplerate=48kHz)

opus does not accept arbitrary frame length! Check OPUS documentation

frame-length = 480 #10ms @ 48kHz (should work for most cases)
tx-volume = 70
rx-volume = 90
stream-on-startup = false
vox = false
vox-threshold = 0.1
vox-holdtime = "500ms"

[http]
host = "localhost"
port = 9090

@hamav8tor
Copy link
Author

Actually, solved just using default. Problem likely stemmed from both devices having the same name.

@dh1tw
Copy link
Owner

dh1tw commented Jan 5, 2023

Hi Dave,

interesting problem. Glad to hear, that using the default device solved the problem.

Out out curiosity, do you have two sets of AirPods or does each Airpod (Left & Right) show up as an output device?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants