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

Audio Output Switching #536

Open
jrleeman opened this issue Aug 22, 2015 · 8 comments
Open

Audio Output Switching #536

jrleeman opened this issue Aug 22, 2015 · 8 comments
Labels

Comments

@jrleeman
Copy link

When switching audio outputs from system preferences in OS X 10.10.5 the audio disappears. Piano bar must be restarted to get it back after every output switch.

@PromyLOPh
Copy link
Owner

Can you set debug=1 in your ~/.libao and post a log of pianobar’s
output immediately before/after switching audio outputs?

@jrleeman
Copy link
Author

No problem. Just did it and found that if the song plays to completion, it will switch, but switching mid song either changes nothing or the audio totally dies. Looks like switching stations will make the audio switch properly too.

jleeman:~/ $ pianobar                                                                                                             [8:27:27]
debug: Loaded driver null (built-in)
debug: Loaded driver wav (built-in)
debug: Loaded driver raw (built-in)
debug: Loaded driver au (built-in)
debug: Loading driver plugins from /usr/local/Cellar/libao/1.2.0/lib/ao/plugins-4...
debug: Loaded driver macosx
Welcome to pianobar (2014.09.28)! Press ? for a list of commands.
[?] Email: jrl1209@psu.edu
[?] Password:
(i) Login... Ok.
(i) Get stations... Ok.
     0) q   Alternative Endurance Training Radio
     1) q   Antonio Vivaldi Radio
[?] Select station: 1
|>  Station "Antonio Vivaldi Radio" (1296840382709275929)
(i) Receiving new playlist... Ok.
|>  "Concerto Alla Rustica, For Strings & Continuo In G Major, RV 151" by "Vivaldi, Antonio" on "Takako Nishizaki, Vivaldi: The Four Seasons; Concerto Alla Rustica"
debug: Testing drivers to find playback default...
debug: ...testing macosx
debug: OK, using driver macosx
ao_macosx debug: Starting audio output unit
|>  "Cavalleria Rusticana, Opera (Melodramma) In 1 Act" by "Mascagni, Pietro" on "National Philharmonic Orchestra, Mascagni: Cavalleria Rusticana"
debug: Testing drivers to find playback default...
debug: ...testing macosx
debug: OK, using driver macosx
ao_macosx debug: Starting audio output unit

@PromyLOPh
Copy link
Owner

No problem.
Hm, the “debug” output is a little less verbose than I though.

Just did it and found that if the song plays to completion, it will
switch, but switching mid song either changes nothing or the audio
totally dies. Looks like switching stations will make the audio switch
properly too.
That makes sense. We’re closing and reopening the audio device every
time a new song is played. So I assume the problem is that ao_play’s
return value is unchecked. Does this patch
(https://gist.github.com/b58e5abca81e96a3fa57) fix the issue?

@jrleeman
Copy link
Author

Just re-compiled with that patch and still have to wait until the end of the song for the audio output device to change.

@PromyLOPh
Copy link
Owner

So apparently libao does not signal this change to the application.
That’s a case for libao’s issue tracker I suppose. Please report it at
https://trac.xiph.org/, reference this issue and post a link here
afterwards.

@jrleeman
Copy link
Author

Issue tracker link:
https://trac.xiph.org/ticket/2217

@serpico7456
Copy link

serpico7456 commented Dec 14, 2020

Updated issue tracker link (moved from Trac to GitLab):
https://gitlab.xiph.org/xiph/libao/-/issues/2217

Doesn't appear to be any progress in libao in the last 5 years. Workaround of Ctrl-C (SIGINT) works well (may be ~5 sec delay)--suggested by @PromyLOPh in #589

@yebo29
Copy link

yebo29 commented Oct 13, 2021

I'm thankful there's at least a workaround! I just used Ctrl+c and it worked for me as well.

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

No branches or pull requests

4 participants