The first press of a given key doesn’t play the right sound on a Mac.
Just installed this on a new Mac OS Sierra, on a new Touch Bar MacBook pro.
When I press an alphanumeric key for the first time, I hear the appropriate background noise, but not the main “click” component of the sound. If I press the same key again quickly, I get the expected clicky sound.
Arrow keys seem to exhibit the right behaviour.
I tried all the alternative options available in ~/.alsoftrc, but nothing helped.
That's funny; if you get the background sound, but not the click, it seems that the start of the first sample is not properly played at startup; maybe there is some kind of issue in OpenAL or Alure on your platform, but I have no clue at this time why this is happening.
I'l keep this issue open, maybe there is someone else who can shed a light on this.
I have downloaded the source and attempting some troubleshooting. I'm starting to think the problem is the Mac implementation of openAL. I am experiencing the same symptoms as mwichary. I've sprinkled a few printd around in main.c and mac.c, but so far haven't found a problem. I have also forced the same .wav files to play no matter which key is pressed and it doesn't help, so it doesn't look like a buffer issue. Still looking.
Does anyone know which OpenAL implementation is used on Mac OS?
Has anyone had any luck fixing this? I got so used to bucklespring on linux (thank you zevv ♥️ ), can't live without it now that I've switched to mac :(
I’m like you. I love Bucklespring on my Linux machines. I’ve found a similar product for the Mac called “Keyclick” ( http://www.sustworks.com/keyclick_pref/index.html http://www.sustworks.com/keyclick_pref/index.html ). It isn’t free, but it is reasonable at $9.99. It installs as a preference pane and works really well with lots of sound options including mouse clicks.
Joe Kelley [email protected] mailto:[email protected] http://www.mactexan.com http://www.mactexan.com/
http://www.mactexan.com/ http://www.mactexan.com/
On Jul 19, 2018, at 07:03, roko-p [email protected] wrote:
Has anyone had any luck fixing this? I got so used to bucklespring on linux (thank you zevv ♥️ ), can't live without it now that I've switched to mac :(
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zevv/bucklespring/issues/60#issuecomment-406287360, or mute the thread https://github.com/notifications/unsubscribe-auth/ACHabLbZZ1LSqxeXtvxiyKOn6On58tdqks5uIJHDgaJpZM4OHFfc.
Quoting Joe Kelley (2018-07-19 18:15:33)
I’ve found a similar product for the Mac called “Keyclick”. It isn’t free, but it is reasonable at $9.99. It installs as a preference pane and works really well with lots of sound options including mouse clicks.
What, $9.99 you say! I could have been rich! RICH!
@mactexan Thank you for the alternative, I've tried KeyClick, not bad, fills a part of the hole in the heart, but definitely not as awesome as bucklespring.
@zevv How much do you ask to try to fix this issue for mac? 💰
Quoting roko-p (2018-07-24 15:01:10)
@zevv How much do you ask to try to fix this issue for mac? 💰
Well, having a mac would help :)
-- :wq ^X^Cy^K^X^C^C^C^C
😄 damn.
Really, if I had a mac this would have been fixed long ago. I created the mac port on a borrowed machine a long time ago, but unfortunately I don't have that any longer...
My guess is that the audio subsystem goes to some kind of idle state when no sound is playing, and only switches on when there is something to play. The switching on takes a short amount of time, and is a bit too late to play the actual click.
I could try to make a workaround for that by playing silence in the background all of the time, even when no keys are pressed, that might keep the audio driver awake and prevent the problem from happening.
Now that I think if it: having a kind of comfort noise on the background might be a good idea anyway to mask the starting and stopping of the individual samples.
I will see if I can hack something up one of these days.
-- :wq ^X^Cy^K^X^C^C^C^C
😍 😍 😍 😍
Sounds very viable! 🤞
Thank you!!!
I've added a quick test in a branch:
https://github.com/zevv/bucklespring/tree/issue-60-test
This plays a (almost) silent sample in a continuous loop as long as buckle is running - does that solve the issue on the Mac>
@zevv Still only the background sound without the main click on first press 😔 ...at least for me.
(To test it, I checked out the issue-60-test, ran make and then sudo ./buckle, not sure if I also should have done something else as well)
Quoting roko-p (2018-07-25 17:19:09)
@zevv Still only the background sound without the main click on first press 😔 ...at least for me.
Hm, that's nasty, and I have no clue how to fix this then. If I would add leading silence to all individual wav files, we would end up with too much lag for the key presses, which is also unbearable.
My only hope is to wait for someone to show up with openAL experience on the mac, as there might be some tunables somewhere, but without having access to the hardware it is kind of hard for me to fix this...
(To test it, I checked out the
issue-60-test, ranmakeand thensudo ./buckle, not sure if I also should have done something else as well)
Yes, that should do.
-- :wq ^X^Cy^K^X^C^C^C^C
Yeah, I understand 😔 ok, let's hope some openAL guru stumbles upon this. Thank you very much for giving it a blind try like that!
I have a sneaking suspicion that it's because of all of the sample loading, what if we tried just caching the played keys in memory?
Another possible solution would be to load raw PCM instead of WAV files, then (programtically) add X amount of silent samples if it's compiled on a mac.
Quoting Clipsey (2018-07-26 15:52:48)
I have a sneaking suspicion that it's because of all of the sample loading, what if we tried just caching the played keys in memory?
Well, it's not supposed to matter because the playing is only triggered after the sample is loaded - but I can give it a try. I'll hack something up!
-- :wq ^X^Cy^K^X^C^C^C^C
Aswell, a thing that could make code consistency; we could compile and link directly to openal-soft, which does support macOS.
Quoting Clipsey (2018-07-26 15:52:48)
I have a sneaking suspicion that it's because of all of the sample loading, what if we tried just caching the played keys in memory?
Please try the preload-samples branch
-- :wq ^X^Cy^K^X^C^C^C^C
I do not have my hackintosh on me currently @zevv, so @roko-p could you try the preload-samples branch?
Sorry for the late answer and thank you for the efforts, I've just tried the preload-samples branch, but still the same behaviour (only background sounds except for presses done very shortly after another press)
I haven't asked about the output I get when running make -- this is all normal, right?
cc -O3 -g -Wall -Werror -DVERSION=\"1.4.0\" -DPATH_AUDIO=\""./wav"\" -I/usr/local/Cellar/alure/1.2/include -c main.c -o main.o
cc -O3 -g -Wall -Werror -DVERSION=\"1.4.0\" -DPATH_AUDIO=\""./wav"\" -I/usr/local/Cellar/alure/1.2/include -c scan-mac.c -o scan-mac.o
cc -g -framework ApplicationServices -framework OpenAL -o buckle main.o scan-mac.o -L/usr/local/Cellar/alure/1.2/lib -lalure
What is the difference between the background sounds and the actual clicking sounds?
Quoting roko-p (2018-07-29 18:04:27)
Sorry for the late answer and thank you for the efforts, I've just tried the
preload-samplesbranch, but still the same behaviour (only background sounds except for presses done very shortly after another press)
That's too bad - it seems that the AL implementation on Mac is simply dropping the first few milliseconds of every sample, making it kind of useless for real time audio.
I haven't asked about the output I get when running
make-- this is all normal, right?cc -O3 -g -Wall -Werror -DVERSION=\"1.4.0\" -DPATH_AUDIO=\""./wav"\" -I/usr/local/Cellar/alure/1.2/include -c main.c -o main.o cc -O3 -g -Wall -Werror -DVERSION=\"1.4.0\" -DPATH_AUDIO=\""./wav"\" -I/usr/local/Cellar/alure/1.2/include -c scan-mac.c -o scan-mac.o cc -g -framework ApplicationServices -framework OpenAL -o buckle main.o scan-mac.o -L/usr/local/Cellar/alure/1.2/lib -lalure
Yes, that's all there is to it. Just two source files to compile...
What is the difference between the background sounds and the actual clicking sounds?
Well, the background sound is just the natural backround noise/hiss of the mic and the environment that is in every sample. I recorder all the keys for approx half a second to capture the reverb and the typical 'clanggg' sound of the springs, but after every sample there is still a bit of background hiss.
-- :wq ^X^Cy^K^X^C^C^C^C
Again @zevv we could force bucklespring to use openal-soft, which is free software (and works on mac), we'd have to change the buildfile, but i know that works properly.
Quoting Clipsey (2018-07-30 14:14:21)
Again @zevv we could force bucklespring to use openal-soft, which is free software (and works on mac), we'd have to change the buildfile, but i know that works properly.
But as long as I don't have a mac, you're on your own here. I'd be happy to accept any pull request, though :)
-- :wq ^X^Cy^K^X^C^C^C^C
But openal-soft is cross-platform? 😬
@Member1221 I know C and openAL as much as I speak Swedish (I don't), but what would I have to do if I took this on me, and what do you think how difficult it would be for a web developer?
You’d have to link the program against OpenAL soft by first compiling and installing openal-soft. Then change the makefile to link to the openal soft version
It does require some knowledge of how makefiles work and such. But shouldn’t be too difficult
Soo... I've installed openal-soft with brew install openal-soft
That produced this output:
==> Downloading https://homebrew.bintray.com/bottles/openal-soft-1.18.2.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e1/e166ede768b1bdef14b5ae85043e05b34ac6c53e57bb6f73b4fc4b0954f8aab4?__gd
######################################################################## 100.0%
==> Pouring openal-soft-1.18.2.high_sierra.bottle.tar.gz
==> Caveats
openal-soft is keg-only, which means it was not symlinked into /usr/local,
because macOS provides OpenAL.framework.
If you need to have openal-soft first in your PATH run:
echo 'export PATH="/usr/local/opt/openal-soft/bin:$PATH"' >> ~/.bash_profile
For compilers to find openal-soft you may need to set:
export LDFLAGS="-L/usr/local/opt/openal-soft/lib"
export CPPFLAGS="-I/usr/local/opt/openal-soft/include"
For pkg-config to find openal-soft you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openal-soft/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/openal-soft/1.18.2: 30 files, 902KB
...but I am now not sure how to merge that with:
ifeq ($(OS), Darwin)
BIN := $(NAME)
PKG_CONFIG_PATH := "./mac/lib/pkgconfig"
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs alure openal)
CFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags alure openal)
LDFLAGS += -framework ApplicationServices -framework OpenAL
SRC += scan-mac.c
else
...to have bucklespring use openal-soft. (that is what I should do, right?)
ifeq ($(OS), Darwin)
BIN := $(NAME)
PKG_CONFIG_PATH := "./mac/lib/pkgconfig"
LIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs alure openal)
CFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags alure -I/usr/local/opt/openal-soft/include)
LDFLAGS += -framework ApplicationServices -L/usr/local/opt/openal-soft/lib
SRC += scan-mac.c
else
Something like this @roko-p