ChanServ changed the topic of ##yamahasynths to: Channel dedicated to questions and discussion of Yamaha FM Synthesizer internals and corresponding REing. Discussion of synthesis methods similar to the Yamaha line of chips, Sound Blasters + clones, PCM chips like RF5C68, and CD theory of operation are also on-topic. Channel logs: https://freenode.irclog.whitequark.org/~h~yamahasynths
Xyz_39808 has quit [Write error: Connection reset by peer]
Xyz_39808 has joined ##yamahasynths
_whitelogger has joined ##yamahasynths
andlabs has joined ##yamahasynths
<andlabs> hey ValleyBell, kode54
<kode54> hello
<andlabs> I'm reading the documentation for AudioQueueNewOutput
<kode54> I probably misused it
<andlabs> inCallbackRunLoop
<andlabs> The event loop on which the callback function pointed to by the inCallbackProc parameter is to be called. If you specify NULL, the callback is invoked on one of the audio queue’s internal threads.
<andlabs> you are passing NULL
<andlabs> this explains the segfault: the render function is not being called on the thread you think it is being called on
<kode54> I can't run an event loop
<andlabs> right
<kode54> it works here, why isn't it working for you?
<andlabs> no idea
<andlabs> it only happens when skipping tracks
<kode54> oh
<andlabs> that's the race
<kode54> I didn't know you could load more than one track per instance of the player
<andlabs> but that also explains why threadsanitizer yells
<andlabs> pass them as successive arguments
<kode54> technically, for this driver, it should be nulling the callback pointer before destroying the libvgm player instance
<kode54> (nulling the callback pointer will instruct the driver's callback function to simply fill its output buffer with silence)
<andlabs> the race is that if the callback is being called while that happens...
<kode54> yes
<kode54> there should be synchronization
<andlabs> right
<andlabs> well a lock was missing
<andlabs> ValleyBell added one
<kode54> it needs more locks then
<kode54> good
<kode54> does the lock fix it?
<andlabs> I'm not sure if that is a proper fix though, because I get stale buffer data sometimes
<andlabs> no segfaults though, and no further glitching
<kode54> probably needs a complete teardown and restart
<kode54> or a restart issued to the player
<kode54> er
<andlabs> yeah
<kode54> restart issued to Audio Toolbox
<andlabs> out of my depth though
<kode54> same
<kode54> and I'm not on a Mac much any more now
<andlabs> I'm just looking into writing my own Core Audio shim for tying to other libraries just for personal use
<kode54> no Hac, and this machine may not be receptive to Hac either
<andlabs> (libkss and hopefully also a SPC player)
<andlabs> (and also a (mini)gbs player at some point too)
<andlabs> so I'm reading yours
<andlabs> I get that switching to using CFRunLoop would require rewriting that secondary thread in the player binary
<andlabs> and I'm not sure how to expose that abstraction in a fully abstract way
<andlabs> but that does explain the segfaults
<cr1901_modern> I should prob get a Mac at some point for cross-plat dev
<cr1901_modern> even tho I honestly don't give a shit about the platfornm
<cr1901_modern> it's only fair
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andlabs has joined ##yamahasynths
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
l_oliveira has quit [Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805]]
andlabs has joined ##yamahasynths
_whitelogger has joined ##yamahasynths
_whitelogger has joined ##yamahasynths
<ValleyBell> andlabs: About those stale buffers - does it happen only when switching/loading VGMs?
<ValleyBell> maybe it hangs inside of the FillBuffer function (due to the lock) and then CoreAudio just replays the last few buffers
<ValleyBell> that's the only reason I can think of ATM
<ValleyBell> So far I never got stale buffers on Windows or Linux, but I think most of those APIs just stop playing any audio if you lag behind.
_whitelogger has joined ##yamahasynths
cr1901_modern1 has joined ##yamahasynths
cr1901_modern has quit [Ping timeout: 245 seconds]
<andlabs> ok
cr1901_modern has joined ##yamahasynths
cr1901_modern1 has quit [Ping timeout: 245 seconds]
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andlabs has joined ##yamahasynths
andlabs has quit [Ping timeout: 248 seconds]
andlabs has joined ##yamahasynths
andlabs has quit [Ping timeout: 276 seconds]
andlabs has joined ##yamahasynths
l_oliveira has joined ##yamahasynths
SceneCAT has joined ##yamahasynths
ej5 has quit [Read error: Connection reset by peer]
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]