2 Copyright (C) 2013 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <boost/scoped_ptr.hpp>
25 #include <glibmm/timer.h>
26 #include <glibmm/spawn.h>
28 #include "pbd/error.h"
30 #include "ardour/audioengine.h"
31 #include "ardour/session.h"
32 #include "ardour/types.h"
34 #include "jack_audiobackend.h"
35 #include "jack_connection.h"
36 #include "jack_utils.h"
37 #include "jack_session.h"
41 using namespace ARDOUR;
47 #define GET_PRIVATE_JACK_POINTER(localvar) jack_client_t* localvar = _jack_connection->jack(); if (!(localvar)) { return; }
48 #define GET_PRIVATE_JACK_POINTER_RET(localvar,r) jack_client_t* localvar = _jack_connection->jack(); if (!(localvar)) { return r; }
50 JACKAudioBackend::JACKAudioBackend (AudioEngine& e, AudioBackendInfo& info, boost::shared_ptr<JackConnection> jc)
51 : AudioBackend (e, info)
52 , _jack_connection (jc)
54 , _freewheeling (false)
55 , _target_sample_rate (48000)
56 , _target_buffer_size (1024)
57 , _target_interleaved (false)
58 , _target_input_channels (0)
59 , _target_output_channels (0)
60 , _target_systemic_input_latency (0)
61 , _target_systemic_output_latency (0)
62 , _current_sample_rate (0)
63 , _current_buffer_size (0)
66 _jack_connection->Connected.connect_same_thread (jack_connection_connection, boost::bind (&JACKAudioBackend::when_connected_to_jack, this));
67 _jack_connection->Disconnected.connect_same_thread (disconnect_connection, boost::bind (&JACKAudioBackend::disconnected, this, _1));
70 JACKAudioBackend::~JACKAudioBackend()
75 JACKAudioBackend::name() const
81 JACKAudioBackend::private_handle() const
83 return _jack_connection->jack();
87 JACKAudioBackend::available() const
89 return (private_handle() != 0);
93 JACKAudioBackend::is_realtime () const
95 GET_PRIVATE_JACK_POINTER_RET (_priv_jack,false);
96 return jack_is_realtime (_priv_jack);
100 JACKAudioBackend::requires_driver_selection() const
106 JACKAudioBackend::enumerate_drivers () const
108 vector<string> currently_available;
109 get_jack_audio_driver_names (currently_available);
110 return currently_available;
114 JACKAudioBackend::set_driver (const std::string& name)
116 _target_driver = name;
120 vector<AudioBackend::DeviceStatus>
121 JACKAudioBackend::enumerate_devices () const
123 vector<string> currently_available = get_jack_device_names_for_audio_driver (_target_driver);
124 vector<DeviceStatus> statuses;
126 if (all_devices.find (_target_driver) == all_devices.end()) {
127 all_devices.insert (make_pair (_target_driver, std::set<string>()));
130 /* store every device we've found, by driver name.
132 * This is so we do not confuse ALSA, FFADO, netjack etc. devices
136 DeviceList& all (all_devices[_target_driver]);
138 for (vector<string>::const_iterator d = currently_available.begin(); d != currently_available.end(); ++d) {
142 for (DeviceList::const_iterator d = all.begin(); d != all.end(); ++d) {
143 if (find (currently_available.begin(), currently_available.end(), *d) == currently_available.end()) {
144 statuses.push_back (DeviceStatus (*d, false));
146 statuses.push_back (DeviceStatus (*d, false));
154 JACKAudioBackend::available_sample_rates (const string& device) const
158 if (device == _target_device && available()) {
159 f.push_back (sample_rate());
163 /* if JACK is not already running, just list a bunch of reasonable
164 values and let the future sort it all out.
167 f.push_back (8000.0);
168 f.push_back (16000.0);
169 f.push_back (24000.0);
170 f.push_back (32000.0);
171 f.push_back (44100.0);
172 f.push_back (48000.0);
173 f.push_back (88200.0);
174 f.push_back (96000.0);
175 f.push_back (192000.0);
176 f.push_back (384000.0);
182 JACKAudioBackend::available_buffer_sizes (const string& device) const
186 if (device == _target_device && available()) {
187 s.push_back (buffer_size());
207 JACKAudioBackend::available_input_channel_count (const string& /*device*/) const
213 JACKAudioBackend::available_output_channel_count (const string& /*device*/) const
218 /* -- parameter setting -- */
221 JACKAudioBackend::set_device_name (const string& dev)
224 /* need to stop and restart JACK for this to work, at present */
228 _target_device = dev;
233 JACKAudioBackend::set_sample_rate (float sr)
236 _target_sample_rate = sr;
240 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
242 if (sr == jack_get_sample_rate (_priv_jack)) {
250 JACKAudioBackend::set_buffer_size (uint32_t nframes)
253 _target_buffer_size = nframes;
257 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
259 if (nframes == jack_get_buffer_size (_priv_jack)) {
263 return jack_set_buffer_size (_priv_jack, nframes);
267 JACKAudioBackend::set_interleaved (bool yn)
269 /* as far as JACK clients are concerned, the hardware is always
279 JACKAudioBackend::set_input_channels (uint32_t cnt)
283 /* can't set a real value for this while JACK runs */
288 _target_input_channels = cnt;
294 JACKAudioBackend::set_output_channels (uint32_t cnt)
298 /* can't set a real value for this while JACK runs */
303 _target_output_channels = cnt;
309 JACKAudioBackend::set_systemic_input_latency (uint32_t l)
312 /* can't do this while JACK runs */
316 _target_systemic_input_latency = l;
322 JACKAudioBackend::set_systemic_output_latency (uint32_t l)
325 /* can't do this while JACK runs */
329 _target_systemic_output_latency = l;
334 /* --- Parameter retrieval --- */
337 JACKAudioBackend::device_name () const
339 if (!_jack_connection->in_control()) {
340 return "???"; // JACK has no way (as of fall 2013) to return
344 return _target_device;
348 JACKAudioBackend::driver_name() const
350 if (!_jack_connection->in_control()) {
351 return "???"; // JACK has no way (as of fall 2013) to return
355 return _target_driver;
359 JACKAudioBackend::sample_rate () const
361 if (!_jack_connection->in_control()) {
363 return _current_sample_rate;
365 return _jack_connection->probed_sample_rate ();
368 return _target_sample_rate;
372 JACKAudioBackend::buffer_size () const
374 if (!_jack_connection->in_control()) {
376 return _current_buffer_size;
378 return _jack_connection->probed_buffer_size ();
381 return _target_buffer_size;
385 JACKAudioBackend::interleaved () const
391 JACKAudioBackend::midi_option () const
393 return _target_midi_option;
397 JACKAudioBackend::input_channels () const
399 if (!_jack_connection->in_control()) {
401 return n_physical (JackPortIsInput).n_audio();
407 return n_physical (JackPortIsInput).n_audio();
409 return _target_input_channels;
415 JACKAudioBackend::output_channels () const
417 if (!_jack_connection->in_control()) {
419 return n_physical (JackPortIsOutput).n_audio();
425 return n_physical (JackPortIsOutput).n_audio();
427 return _target_output_channels;
433 JACKAudioBackend::systemic_input_latency () const
435 return _target_systemic_output_latency;
439 JACKAudioBackend::systemic_output_latency () const
441 return _target_systemic_output_latency;
445 JACKAudioBackend::raw_buffer_size(DataType t)
447 std::map<DataType,size_t>::const_iterator s = _raw_buffer_sizes.find(t);
448 return (s != _raw_buffer_sizes.end()) ? s->second : 0;
452 JACKAudioBackend::setup_jack_startup_command (bool for_latency_measurement)
454 /* first we map the parameters that have been set onto a
455 * JackCommandLineOptions object.
458 JackCommandLineOptions options;
460 get_jack_default_server_path (options.server_path);
461 options.driver = _target_driver;
462 options.samplerate = _target_sample_rate;
463 options.period_size = _target_buffer_size;
464 options.num_periods = 2;
465 options.input_device = _target_device;
466 options.output_device = _target_device;
467 options.input_latency = _target_systemic_input_latency;
468 options.output_latency = _target_systemic_output_latency;
469 options.input_channels = _target_input_channels;
470 options.output_channels = _target_output_channels;
471 if (_target_sample_format == FormatInt16) {
472 options.force16_bit = _target_sample_format;
474 options.realtime = true;
475 options.ports_max = 2048;
477 ARDOUR::set_midi_option (options, _target_midi_option);
479 /* this must always be true for any server instance we start ourselves
482 options.temporary = true;
486 if (!get_jack_command_line_string (options, cmdline, for_latency_measurement)) {
487 /* error, somehow - we will still try to start JACK
488 * automatically but it will be without our preferred options
490 std::cerr << "get_jack_command_line_string () failed: using default settings." << std::endl;
494 std::cerr << "JACK command line will be: " << cmdline << std::endl;
496 write_jack_config_file (get_jack_server_user_config_file_path(), cmdline);
499 /* ---- BASIC STATE CONTROL API: start/stop/pause/freewheel --- */
502 JACKAudioBackend::_start (bool for_latency_measurement)
506 if (_jack_connection->in_control()) {
507 /* we will be starting JACK, so set up the
508 command that JACK will use when it (auto-)starts
510 setup_jack_startup_command (for_latency_measurement);
513 if (_jack_connection->open ()) {
518 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
520 /* get the buffer size and sample rates established */
522 jack_sample_rate_callback (jack_get_sample_rate (_priv_jack));
523 jack_bufsize_callback (jack_get_buffer_size (_priv_jack));
525 /* Now that we have buffer size and sample rate established, the engine
526 can go ahead and do its stuff
529 if (engine.reestablish_ports ()) {
530 error << _("Could not re-establish ports after connecting to JACK") << endmsg;
534 if (!jack_port_type_get_buffer_size) {
535 warning << _("This version of JACK is old - you should upgrade to a newer version that supports jack_port_type_get_buffer_size()") << endmsg;
538 set_jack_callbacks ();
540 if (jack_activate (_priv_jack) == 0) {
543 // error << _("cannot activate JACK client") << endmsg;
546 engine.reconnect_ports ();
552 JACKAudioBackend::stop ()
554 _running = false; // no 'engine halted message'.
555 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
557 _jack_connection->close ();
559 _current_buffer_size = 0;
560 _current_sample_rate = 0;
562 _raw_buffer_sizes.clear();
568 JACKAudioBackend::freewheel (bool onoff)
570 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
572 if (onoff == _freewheeling) {
573 /* already doing what has been asked for */
578 if (jack_set_freewheel (_priv_jack, onoff) == 0) {
579 _freewheeling = onoff;
586 /* --- TRANSPORT STATE MANAGEMENT --- */
589 JACKAudioBackend::transport_stop ()
591 GET_PRIVATE_JACK_POINTER (_priv_jack);
592 jack_transport_stop (_priv_jack);
596 JACKAudioBackend::transport_start ()
598 GET_PRIVATE_JACK_POINTER (_priv_jack);
599 jack_transport_start (_priv_jack);
603 JACKAudioBackend::transport_locate (framepos_t where)
605 GET_PRIVATE_JACK_POINTER (_priv_jack);
606 jack_transport_locate (_priv_jack, where);
610 JACKAudioBackend::transport_frame () const
612 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
613 return jack_get_current_transport_frame (_priv_jack);
617 JACKAudioBackend::transport_state () const
619 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, ((TransportState) JackTransportStopped));
621 return (TransportState) jack_transport_query (_priv_jack, &pos);
625 JACKAudioBackend::set_time_master (bool yn)
627 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
629 return jack_set_timebase_callback (_priv_jack, 0, _jack_timebase_callback, this);
631 return jack_release_timebase (_priv_jack);
638 JACKAudioBackend::get_sync_offset (pframes_t& offset) const
641 #ifdef HAVE_JACK_VIDEO_SUPPORT
643 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, false);
648 (void) jack_transport_query (_priv_jack, &pos);
650 if (pos.valid & JackVideoFrameOffset) {
651 offset = pos.video_offset;
664 JACKAudioBackend::sample_time ()
666 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
667 return jack_frame_time (_priv_jack);
671 JACKAudioBackend::sample_time_at_cycle_start ()
673 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
674 return jack_last_frame_time (_priv_jack);
678 JACKAudioBackend::samples_since_cycle_start ()
680 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
681 return jack_frames_since_cycle_start (_priv_jack);
687 ardour_jack_error (const char* msg)
689 error << "JACK: " << msg << endmsg;
693 JACKAudioBackend::set_jack_callbacks ()
695 GET_PRIVATE_JACK_POINTER (_priv_jack);
697 jack_set_thread_init_callback (_priv_jack, AudioEngine::thread_init_callback, 0);
699 jack_set_process_thread (_priv_jack, _process_thread, this);
700 jack_set_sample_rate_callback (_priv_jack, _sample_rate_callback, this);
701 jack_set_buffer_size_callback (_priv_jack, _bufsize_callback, this);
702 jack_set_xrun_callback (_priv_jack, _xrun_callback, this);
703 jack_set_sync_callback (_priv_jack, _jack_sync_callback, this);
704 jack_set_freewheel_callback (_priv_jack, _freewheel_callback, this);
706 #ifdef HAVE_JACK_SESSION
707 if( jack_set_session_callback)
708 jack_set_session_callback (_priv_jack, _session_callback, this);
711 if (jack_set_latency_callback) {
712 jack_set_latency_callback (_priv_jack, _latency_callback, this);
715 jack_set_error_function (ardour_jack_error);
719 JACKAudioBackend::_jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
720 jack_position_t* pos, int new_position, void *arg)
722 static_cast<JACKAudioBackend*> (arg)->jack_timebase_callback (state, nframes, pos, new_position);
726 JACKAudioBackend::jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
727 jack_position_t* pos, int new_position)
729 ARDOUR::Session* session = engine.session();
732 JACKSession jsession (session);
733 jsession.timebase_callback (state, nframes, pos, new_position);
738 JACKAudioBackend::_jack_sync_callback (jack_transport_state_t state, jack_position_t* pos, void* arg)
740 return static_cast<JACKAudioBackend*> (arg)->jack_sync_callback (state, pos);
744 JACKAudioBackend::jack_sync_callback (jack_transport_state_t state, jack_position_t* pos)
746 TransportState tstate;
747 bool tstate_valid = true;
750 case JackTransportRolling:
751 tstate = TransportRolling;
753 case JackTransportLooping:
754 tstate = TransportLooping;
756 case JackTransportStarting:
757 tstate = TransportStarting;
759 case JackTransportStopped:
760 tstate = TransportStopped;
763 // ignore "unofficial" states like JackTransportNetStarting (jackd2)
764 tstate_valid = false;
769 return engine.sync_callback (tstate, pos->frame);
776 JACKAudioBackend::_xrun_callback (void *arg)
778 JACKAudioBackend* jab = static_cast<JACKAudioBackend*> (arg);
779 if (jab->available()) {
780 jab->engine.Xrun (); /* EMIT SIGNAL */
786 JACKAudioBackend::_session_callback (jack_session_event_t *event, void *arg)
788 JACKAudioBackend* jab = static_cast<JACKAudioBackend*> (arg);
789 ARDOUR::Session* session = jab->engine.session();
792 JACKSession jsession (session);
793 jsession.session_event (event);
798 JACKAudioBackend::_freewheel_callback (int onoff, void *arg)
800 static_cast<JACKAudioBackend*>(arg)->freewheel_callback (onoff);
804 JACKAudioBackend::freewheel_callback (int onoff)
806 _freewheeling = onoff;
807 engine.freewheel_callback (onoff);
811 JACKAudioBackend::_latency_callback (jack_latency_callback_mode_t mode, void* arg)
813 return static_cast<JACKAudioBackend*> (arg)->jack_latency_callback (mode);
817 JACKAudioBackend::create_process_thread (boost::function<void()> f)
819 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
821 jack_native_thread_t thread_id;
822 ThreadData* td = new ThreadData (this, f, thread_stack_size());
824 if (jack_client_create_thread (_priv_jack, &thread_id, jack_client_real_time_priority (_priv_jack),
825 jack_is_realtime (_priv_jack), _start_process_thread, td)) {
829 _jack_threads.push_back(thread_id);
834 JACKAudioBackend::join_process_threads ()
838 for (std::vector<jack_native_thread_t>::const_iterator i = _jack_threads.begin ();
839 i != _jack_threads.end(); i++) {
841 #if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined __jack_systemdeps_h__
842 // jack_client is not used by JACK2's implementation
843 // also jack_client_close() leaves threads active
844 if (jack_client_stop_thread (NULL, *i) != 0)
847 if (pthread_join (*i, &status) != 0)
850 error << "AudioEngine: cannot stop process thread" << endmsg;
855 _jack_threads.clear();
861 JACKAudioBackend::in_process_thread ()
863 #if defined COMPILER_MINGW && (!defined PTW32_VERSION || defined __jack_systemdeps_h__)
864 if (_main_thread == GetCurrentThread()) {
868 if (pthread_equal (_main_thread, pthread_self()) != 0) {
873 for (std::vector<jack_native_thread_t>::const_iterator i = _jack_threads.begin ();
874 i != _jack_threads.end(); i++) {
876 #if defined COMPILER_MINGW && (!defined PTW32_VERSION || defined __jack_systemdeps_h__)
877 if (*i == GetCurrentThread()) {
881 if (pthread_equal (*i, pthread_self()) != 0) {
891 JACKAudioBackend::process_thread_count ()
893 return _jack_threads.size();
897 JACKAudioBackend::_start_process_thread (void* arg)
899 ThreadData* td = reinterpret_cast<ThreadData*> (arg);
900 boost::function<void()> f = td->f;
909 JACKAudioBackend::_process_thread (void *arg)
911 return static_cast<JACKAudioBackend*> (arg)->process_thread ();
915 JACKAudioBackend::process_thread ()
917 /* JACK doesn't do this for us when we use the wait API
920 #if defined COMPILER_MINGW && (!defined PTW32_VERSION || defined __jack_systemdeps_h__)
921 _main_thread = GetCurrentThread();
923 _main_thread = pthread_self ();
927 AudioEngine::thread_init_callback (this);
930 GET_PRIVATE_JACK_POINTER_RET(_priv_jack,0);
932 pframes_t nframes = jack_cycle_wait (_priv_jack);
934 if (engine.process_callback (nframes)) {
938 jack_cycle_signal (_priv_jack, 0);
945 JACKAudioBackend::_sample_rate_callback (pframes_t nframes, void *arg)
947 return static_cast<JACKAudioBackend*> (arg)->jack_sample_rate_callback (nframes);
951 JACKAudioBackend::jack_sample_rate_callback (pframes_t nframes)
953 _current_sample_rate = nframes;
954 return engine.sample_rate_change (nframes);
958 JACKAudioBackend::jack_latency_callback (jack_latency_callback_mode_t mode)
960 engine.latency_callback (mode == JackPlaybackLatency);
964 JACKAudioBackend::_bufsize_callback (pframes_t nframes, void *arg)
966 return static_cast<JACKAudioBackend*> (arg)->jack_bufsize_callback (nframes);
970 JACKAudioBackend::jack_bufsize_callback (pframes_t nframes)
972 /* if the size has not changed, this should be a no-op */
974 if (nframes == _current_buffer_size) {
978 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 1);
980 _current_buffer_size = nframes;
982 if (jack_port_type_get_buffer_size) {
983 _raw_buffer_sizes[DataType::AUDIO] = jack_port_type_get_buffer_size (_priv_jack, JACK_DEFAULT_AUDIO_TYPE);
984 _raw_buffer_sizes[DataType::MIDI] = jack_port_type_get_buffer_size (_priv_jack, JACK_DEFAULT_MIDI_TYPE);
987 /* Old version of JACK.
989 These crude guesses, see below where we try to get the right answers.
991 Note that our guess for MIDI deliberatey tries to overestimate
992 by a little. It would be nicer if we could get the actual
993 size from a port, but we have to use this estimate in the
994 event that there are no MIDI ports currently. If there are
995 the value will be adjusted below.
998 _raw_buffer_sizes[DataType::AUDIO] = nframes * sizeof (Sample);
999 _raw_buffer_sizes[DataType::MIDI] = nframes * 4 - (nframes/2);
1002 engine.buffer_size_change (nframes);
1008 JACKAudioBackend::disconnected (const char* why)
1010 bool was_running = _running;
1013 _current_buffer_size = 0;
1014 _current_sample_rate = 0;
1017 engine.halted_callback (why); /* EMIT SIGNAL */
1022 JACKAudioBackend::dsp_load() const
1024 GET_PRIVATE_JACK_POINTER_RET(_priv_jack,0);
1025 return jack_cpu_load (_priv_jack);
1029 JACKAudioBackend::update_latencies ()
1031 GET_PRIVATE_JACK_POINTER (_priv_jack);
1032 jack_recompute_total_latencies (_priv_jack);
1036 JACKAudioBackend::n_physical (unsigned long flags) const
1040 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, c);
1042 const char ** ports = jack_get_ports (_priv_jack, NULL, NULL, JackPortIsPhysical | flags);
1045 for (uint32_t i = 0; ports[i]; ++i) {
1046 if (!strstr (ports[i], "Midi-Through")) {
1047 DataType t = port_data_type (jack_port_by_name (_priv_jack, ports[i]));
1048 if (t != DataType::NIL) {
1049 c.set (t, c.get (t) + 1);
1061 JACKAudioBackend::can_change_sample_rate_when_running () const
1067 JACKAudioBackend::can_change_buffer_size_when_running () const
1073 JACKAudioBackend::control_app_name () const
1075 /* Since JACK/ALSA really don't provide particularly integrated support
1076 for the idea of a control app to be used to control a device,
1077 allow the user to take some control themselves if necessary.
1080 const char* env_value = g_getenv ("ARDOUR_DEVICE_CONTROL_APP");
1084 if (_target_driver.empty() || _target_device.empty()) {
1088 if (_target_driver == "ALSA") {
1090 if (_target_device == "Hammerfall DSP") {
1091 appname = "hdspconf";
1092 } else if (_target_device == "M Audio Delta 1010") {
1093 appname = "mudita24";
1094 } else if (_target_device == "M2496") {
1095 appname = "mudita24";
1099 appname = env_value;
1106 JACKAudioBackend::launch_control_app ()
1108 string appname = control_app_name();
1110 if (appname.empty()) {
1111 error << string_compose (_("There is no control application for the device \"%1\""), _target_device) << endmsg;
1115 std::list<string> args;
1116 args.push_back (appname);
1117 Glib::spawn_async ("", args, Glib::SPAWN_SEARCH_PATH);
1121 JACKAudioBackend::enumerate_midi_options () const
1123 return ARDOUR::enumerate_midi_options ();
1127 JACKAudioBackend::set_midi_option (const string& opt)
1129 _target_midi_option = opt;
1134 JACKAudioBackend::speed_and_position (double& speed, framepos_t& position)
1136 jack_position_t pos;
1137 jack_transport_state_t state;
1140 /* this won't be called if the port engine in use is not JACK, so we do
1141 not have to worry about the type of PortEngine::private_handle()
1147 GET_PRIVATE_JACK_POINTER_RET (_priv_jack, true);
1149 state = jack_transport_query (_priv_jack, &pos);
1152 case JackTransportStopped:
1156 case JackTransportRolling:
1160 case JackTransportLooping:
1164 case JackTransportStarting:
1166 // don't adjust speed here, just leave it as it was
1169 starting = true; // jack2: JackTransportNetStarting
1170 std::cerr << "WARNING: Unknown JACK transport state: " << state << std::endl;
1173 position = pos.frame;
1178 JACKAudioBackend::reset_device ()
1180 /* XXX need to figure out what this means for JACK