Branch: refs/heads/master
Home: https://github.com/jackaudio/headers
Commit: 23c29914806edefb496af098e937cc09e472bbbe
https://github.com/jackaudio/headers/commit/23c29914806edefb496af098e937cc0…
Author: Paul Davis <paul(a)linuxaudiosystems.com>
Date: 2015-07-02 (Thu, 02 Jul 2015)
Changed paths:
M jack.h
Log Message:
-----------
add new public API: jack_port_rename
This is semantically similar to jack_port_set_name() but because it is also passed a jack_client_t*, it can
contact the server to ensure that not only the rename is done but that port rename callbacks are delivered
appropriately
A few months ago we'd digged jackd code in #alsa IRC trying to find why itfails with "ALSA: could not start playback (File descriptor in bad state)"when run on top "type bluetooth" pcm. The reason was in a single line (both in jack1/drivers/alsa/alsa_driver.cand jack2/linux/alsa/alsa_driver.c): if ((err = snd_pcm_start (driver->playback_handle)) < 0) {which always fails after snd_pcm_mmap_commit() filling the buffer,because pcm's already in RUNNING state and can't be started again:> http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html> For playback, if samples in ring buffer is equal or greater than> the start threshold parameters and the stream is not running,> the stream will be started automaticallyThe following small patch fixes it for both jack1 and jack2:--- alsa_driver.c+++ alsa_driver.c @@ -1055,7 +1055,8 @@ alsa_driver_start (alsa_driver_t *driver driver->user_nperiods * driver->frames_per_cycle); - if ((err = snd_pcm_start (driver->playback_handle)) < 0) {+ if (snd_pcm_state(driver->playback_handle) != SND_PCM_STATE_RUNNING+ && (err = snd_pcm_start (driver->playback_handle)) < 0) { jack_error ("ALSA: could not start playback (%s)", snd_strerror (err)); return -1;