You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If cmus is open and I plug in a USB headset, it does not detect and use it, despite the fact that it is set to be preferred in System Preferences -> Sound -> Output. To use the headset, I must restart cmus. On the other hand, if cmus is open and I unplug the headset, it does detect this and switch to the laptop speakers correctly.
By contrast, audio from (eg) the browser will switch back and forth anytime I plug or unplug the headset.
(The headset I'm using is a Logitech USB - sorry, model unknown.)
uname -a:
Darwin Nathans-MBP-2 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
I downloaded a zip of master (currently 9d37708), unzipped it, and ran
./configure CONFIG_COREAUDIO=y && make install DESTDIR=/Users/nathanl/tmp/cmus.
It appeared to run without errors (output below), but when I cd to ~/tmp/cmus/usr/local/bin and run ./cmus, I see only zsh: segmentation fault ./cmus.
Here's the output when I configure and make:
~/Downloads/cmus-master: ./configure CONFIG_COREAUDIO=y && make install DESTDIR=/Users/nathanl/tmp/cmus
checking for program gcc... /usr/bin/gcc
checking for program gcc... /usr/bin/gcc
checking for CFLAGS -std=gnu99 -pipe -Wall -Wshadow -Wcast-align -Wpointer-arith -Wwrite-strings -Wundef -Wmissing-prototypes -Wredundant-decls -Wextra -Wno-sign-compare -Wformat-security... yes
checking for CFLAGS -Wold-style-definition... yes
checking for CFLAGS -Wno-pointer-sign... yes
checking for CFLAGS -Werror-implicit-function-declaration... yes
checking for CFLAGS -Wno-unused-parameter... yes
checking if CC can generate dependency information... yes
checking byte order... little-endian
checking for DL_LIBS (-ldl -Wl,--export-dynamic)... no
checking for DL_LIBS (-ldl -rdynamic)... yes
checking for PTHREAD_LIBS (-lpthread)... yes
checking for realtime scheduling... yes
checking for program pkg-config... no
checking for NCURSES_LIBS (pkg-config)... no
checking for NCURSES_LIBS (-lncursesw)... no
checking for NCURSES_LIBS (pkg-config)... no
checking for NCURSES_LIBS (-lncurses)... yes
*** Your ncurses does not support wide characters!
*** Install ncursesw if you need wide character support,
*** you can ignore this warning otherwise.
checking for working ncurses setup... yes
checking for function resizeterm... yes
checking for function use_default_colors... yes
checking for ICONV_LIBS (-liconv)... yes
taking iconv from libiconv
checking for working iconv... yes
checking for header <byteswap.h>... no
checking for function strdup... yes
checking for function strndup... yes
checking for CDDB_LIBS (pkg-config)... no
checking for CDDB_LIBS (-lcddb)... no
checking for CDIO_LIBS (pkg-config)... no
checking for CDIO_LIBS (-lcdio_cdio -lcdio -lm)... no
checking for FLAC_LIBS (pkg-config)... no
checking for FLAC_LIBS (-lFLAC -lm)... yes
checking for MAD_LIBS (pkg-config)... no
checking for MAD_LIBS (-lmad -lm)... yes
checking for MODPLUG_LIBS (pkg-config)... no
checking for MODPLUG_LIBS (-lmodplug -lstdc++ -lm)... no
checking for header <mpc/mpcdec.h>... no
checking for header <mpcdec/mpcdec.h>... no
checking for VORBIS_LIBS (pkg-config)... no
checking for VORBIS_LIBS (-lvorbisfile -lvorbis -lm -logg)... yes
checking for OPUS_LIBS (pkg-config)... no
*** pkg-config required for OPUS
checking for LIBSYSTEMD_LIBS (pkg-config)... no
*** pkg-config required for LIBSYSTEMD
checking for WAVPACK_LIBS (pkg-config)... no
checking for WAVPACK_LIBS (-lwavpack)... no
checking for header <mp4v2/mp4v2.h>... yes
checking for header <neaacdec.h>... yes
checking for MP4_LIBS (-lmp4v2 -lfaad -lm)... yes
checking for header <neaacdec.h>... yes
checking for AAC_LIBS (-lfaad -lm)... yes
checking for FFMPEG_LIBS (pkg-config)... no
*** pkg-config required for FFMPEG
checking for CUE_LIBS (pkg-config)... no
*** pkg-config required for CUE
checking for CUE_LIBS (pkg-config)... no
*** pkg-config required for CUE
checking for header <ayemu.h>... no
checking for PULSE_LIBS (pkg-config)... no
*** pkg-config required for PULSE
checking for ALSA_LIBS (pkg-config)... no
*** pkg-config required for ALSA
checking for JACK_LIBS (pkg-config)... no
*** pkg-config required for JACK
checking for SAMPLERATE_LIBS (pkg-config)... no
*** pkg-config required for SAMPLERATE
checking for AO_LIBS (pkg-config)... no
checking for AO_LIBS (-lao)... yes
checking for COREAUDIO_LIBS (-framework CoreAudio -framework AudioUnit)... yes
checking for program artsc-config... no
checking for header <sys/soundcard.h>... no
checking for header <sys/audioio.h>... no
checking for ROAR_LIBS (pkg-config)... no
*** pkg-config required for ROAR
rm: .tmp-0-prog.dSYM: is a directory
rm: .tmp-1-prog.dSYM: is a directory
rm: .tmp-10-prog.dSYM: is a directory
rm: .tmp-11-prog.dSYM: is a directory
rm: .tmp-12-prog.dSYM: is a directory
rm: .tmp-13-prog.dSYM: is a directory
rm: .tmp-14-prog.dSYM: is a directory
rm: .tmp-15-prog.dSYM: is a directory
rm: .tmp-16-prog.dSYM: is a directory
rm: .tmp-17-prog.dSYM: is a directory
rm: .tmp-18-prog.dSYM: is a directory
rm: .tmp-2-prog.dSYM: is a directory
rm: .tmp-3-prog.dSYM: is a directory
rm: .tmp-4-prog.dSYM: is a directory
rm: .tmp-5-prog.dSYM: is a directory
rm: .tmp-6-prog.dSYM: is a directory
rm: .tmp-7-prog.dSYM: is a directory
rm: .tmp-8-prog.dSYM: is a directory
rm: .tmp-9-prog.dSYM: is a directory
INSTALL /Users/nathanl/tmp/cmus/usr/local/bin/cmus
INSTALL /Users/nathanl/tmp/cmus/usr/local/bin/cmus-remote
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/ip/flac.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/ip/mad.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/ip/vorbis.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/ip/wav.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/ip/mp4.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/ip/aac.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/op/coreaudio.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/lib/cmus/op/ao.so
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/cyan.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/default.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/gray-88.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/green-mono-88.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/green.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/gruvbox-alt.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/gruvbox.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/jellybeans.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/night.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/rc
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/solarized-dark.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/solarized-light.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/xterm-white.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/cmus/zenburn.theme
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/man/man1/cmus.1
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/man/man1/cmus-remote.1
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/man/man7/cmus-tutorial.7
INSTALL /Users/nathanl/tmp/cmus/usr/local/share/doc/cmus/examples/cmus-status-display
Tried that. It overwrote /usr/local/bin/cmus and does open and play, but the bug remains. Also, oddly, cmus --version now shows cmus v2.7.0 - previously it was v2.7.1.
When system default audio device is used, which means:
dsp.coreaudio.device is set to empty string
dsp.coreaudio.enable_hog_mode is false
dsp.coreaudio.sync_sample_rate is false,
in this case cmus has no idea what the device is. It just output to kAudioObjectSystemObject. The operating system will decide which device to use. It will always output to your system default output (be it headphone jack, usb audio, internal speaker, thunderbolt display, s/pdif).
I cleared my settings, started cmus with dac unplugged. audio came out from internal speaker. Then I connectted USB DAC to my computer, audio switched to use the DAC, which showed the correct behavior.
I'd like to share something else.
The problem does occur, however, when you have selected a specific device in the setting, but having the device unplugged when starting cmus. Our code currently assumes user having the device ready when initializing the output plugin.
There are two potential solutions to this issue:
It would be better if user could switch device during runtime. Many media players support that. Device initialization work is currently done only when the plugin is initialized (coreaudio_init()). It's possible to call the following functions in order when coreaudio_set_device() is called: coreaudio_close() -> coreaudio_exit -> coreaudio_init -> coreaudio_open. This essentially closes previous device, and initialize the current device, when user changes the setting. This is easy to implement.
Be more user friendly --- It's possible to automatically monitor plug-and-play device status in CoreAudio. One needs to do very low level programming using AudioUnitEvents and AUEventListeners. When a device that matches coreaudio_device_name is connected, we perform steps in the previous solution.
Generally console applications are not written this way --- users are responsible to make sure the config file reflect right environment when the application is started. Though in the plug and play era, we could do a lot better. Patches are welcomed!
dsp.coreaudio.device is set to empty string
dsp.coreaudio.enable_hog_mode is false
dsp.coreaudio.sync_sample_rate is false,
I just checked and I see exactly these settings. (I think the only setting I've changed since installation is setting softvol to true.) If I understand correctly, that means I'm using whatever device the operating system decides to for output, so if it doesn't switch correctly, that's the OS's fault?
I could have a setting wrong somehow with OS X, but as I said, it does switch if I unplug or plug in while playing video in the browser (for example).
Weird. The music playback does not switch over, even though other sounds do. Eg, I just unplugged and plugged back in. Cmus is still playing through my laptop speakers, but the "alarm bell" sound comes through the headphones.
Maybe there is some weird interaction between my specific model of headphones and cmus. 😕 Oh, well. Thanks for discussing.
I can reproduce a flavor of this issue in 100% of cases. I have a USB sound card plugged into external thunderbolt monitors. Playback through this soundcard works fine in cmus. If I unplug the macbook from the monitors and replug, system sounds and apps like Spotify resume playing through the USB soundcard, but cmus does not. I must restart cmus, and then playback works. I restart cmus multiple times per day because of this, which led me to file this feature request to reduce frustration.
OP here. I just downloaded a zip of b595b8c (which reports v2.8.0-rc0 from /usr/local/bin/cmuss --version) and compiled with ./configure CONFIG_COREAUDIO=y && make install. After starting up /usr/local/bin/cmus, I :set output_plugin=coreaudio.
With this, I can plug and unplug a USB headset and playback moves back and forth between the headset and the laptop speakers as expected. 👍
Since this affects Mac users, and most Mac users install via homebrew, and the homebrew formula author will probably not track an RC release, can we cut a 2.8.0 final release? We've been on 2.8.0-rc0 for 1.5 years now (released Nov 2016). Related: #583.
Activity
flyingmutant commentedon Jul 6, 2016
Is the issue present when using CoreAudio output plugin? (You'll need to compile HEAD version of cmus for that).
nathanl commentedon Jul 13, 2016
Hmm, I can't get that to run at all.
I downloaded a zip of master (currently 9d37708), unzipped it, and ran
It appeared to run without errors (output below), but when I
cdto~/tmp/cmus/usr/local/binand run./cmus, I see onlyzsh: segmentation fault ./cmus.Here's the output when I configure and make:
mahkoh commentedon Jul 13, 2016
./configure CONFIG_COREAUDIO=y && make install DESTDIR=/Users/nathanl/tmp/cmusRemove the DESTDIR argument.
nathanl commentedon Jul 13, 2016
Tried that. It overwrote
/usr/local/bin/cmusand does open and play, but the bug remains. Also, oddly,cmus --versionnow showscmus v2.7.0- previously it wasv2.7.1.flyingmutant commentedon Jul 13, 2016
cmus --versionshould mention the commit hash – does it? And what is the output ofcmus --plugins?nathanl commentedon Jul 15, 2016
It doesn't mention the commit hash.
plugins looks like this:
flyingmutant commentedon Jul 15, 2016
@Wang-Yue any ideas, what might cause this behavior?
Wang-Yue commentedon Jul 16, 2016
I cannot reproduce the problem.
When system default audio device is used, which means:
dsp.coreaudio.device is set to empty string
dsp.coreaudio.enable_hog_mode is false
dsp.coreaudio.sync_sample_rate is false,
in this case cmus has no idea what the device is. It just output to kAudioObjectSystemObject. The operating system will decide which device to use. It will always output to your system default output (be it headphone jack, usb audio, internal speaker, thunderbolt display, s/pdif).
I cleared my settings, started cmus with dac unplugged. audio came out from internal speaker. Then I connectted USB DAC to my computer, audio switched to use the DAC, which showed the correct behavior.
I'd like to share something else.
The problem does occur, however, when you have selected a specific device in the setting, but having the device unplugged when starting cmus. Our code currently assumes user having the device ready when initializing the output plugin.
There are two potential solutions to this issue:
Generally console applications are not written this way --- users are responsible to make sure the config file reflect right environment when the application is started. Though in the plug and play era, we could do a lot better. Patches are welcomed!
Wang-Yue commentedon Jul 24, 2016
This bug can be closed. Not reproducible. Probably the person who reports the bug has wrong configuration settings.
nathanl commentedon Jul 29, 2016
I just checked and I see exactly these settings. (I think the only setting I've changed since installation is setting
softvolto true.) If I understand correctly, that means I'm using whatever device the operating system decides to for output, so if it doesn't switch correctly, that's the OS's fault?I could have a setting wrong somehow with OS X, but as I said, it does switch if I unplug or plug in while playing video in the browser (for example).
flyingmutant commentedon Aug 25, 2016
FWIW, I can not reproduce the issue. Plugging and unplugging the headphones just works — no matter if I started cmus with them plugged or not.
nathanl commentedon Aug 26, 2016
Weird. The music playback does not switch over, even though other sounds do. Eg, I just unplugged and plugged back in. Cmus is still playing through my laptop speakers, but the "alarm bell" sound comes through the headphones.
Maybe there is some weird interaction between my specific model of headphones and cmus. 😕 Oh, well. Thanks for discussing.
philc commentedon Oct 5, 2017
I can reproduce a flavor of this issue in 100% of cases. I have a USB sound card plugged into external thunderbolt monitors. Playback through this soundcard works fine in cmus. If I unplug the macbook from the monitors and replug, system sounds and apps like Spotify resume playing through the USB soundcard, but cmus does not. I must restart cmus, and then playback works. I restart cmus multiple times per day because of this, which led me to file this feature request to reduce frustration.
sijad commentedon May 4, 2018
I can reproduce in
cmus v2.8.0-rc0macOS 10.12sijad commentedon May 4, 2018
I can't reproduce using
coreaudio,:set output_plugin=coreaudio.it seems to be related to
ao.Wang-Yue commentedon May 5, 2018
@sijad just use coreaudio. don't use the legacy ao plugin.
sijad commentedon May 5, 2018
with coreaudio some high-res audio have playing problem. I'm not sure if is that a known problem?it seems this only happens with 96khz audios, by changing DAC output format to 96000 in midi application problem solved.
Wang-Yue commentedon May 7, 2018
@sijad apart from that, coreaudio.sync_sample_rate will also sync the sample rate automatically for you based on the audio you are playing.
nathanl commentedon May 8, 2018
OP here. I just downloaded a zip of b595b8c (which reports
v2.8.0-rc0from/usr/local/bin/cmuss --version) and compiled with./configure CONFIG_COREAUDIO=y && make install. After starting up/usr/local/bin/cmus, I:set output_plugin=coreaudio.With this, I can plug and unplug a USB headset and playback moves back and forth between the headset and the laptop speakers as expected. 👍
Wang-Yue commentedon May 8, 2018
this issue can be closed
philc commentedon May 22, 2018
Since this affects Mac users, and most Mac users install via homebrew, and the homebrew formula author will probably not track an RC release, can we cut a 2.8.0 final release? We've been on 2.8.0-rc0 for 1.5 years now (released Nov 2016). Related: #583.