Merge lp:~artfwo/ubuntu/precise/jackd2/jackd2-fix-911342 into lp:ubuntu/precise/jackd2

Proposed by Artem Popov
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~artfwo/ubuntu/precise/jackd2/jackd2-fix-911342
Merge into: lp:ubuntu/precise/jackd2
Diff against target: 100804 lines (+47801/-31230)
551 files modified
.pc/applied-patches (+0/-4)
.pc/hppa-parallel.patch/.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Runner.py (+0/-145)
.pc/hurd.patch/dbus/sigsegv.c (+0/-202)
.pc/no-selfconnect.patch/common/JackConstants.h (+0/-82)
.pc/no-selfconnect.patch/common/JackControlAPI.cpp (+0/-1249)
.pc/no-selfconnect.patch/common/JackEngine.cpp (+0/-1084)
.pc/no-selfconnect.patch/common/JackEngine.h (+0/-161)
.pc/no-selfconnect.patch/common/JackLockedEngine.h (+0/-368)
.pc/no-selfconnect.patch/common/JackServer.cpp (+0/-408)
.pc/no-selfconnect.patch/common/JackServer.h (+0/-106)
.pc/no-selfconnect.patch/common/JackServerGlobals.cpp (+0/-416)
.pc/no-selfconnect.patch/common/JackServerGlobals.h (+0/-72)
.pc/no-selfconnect.patch/common/JackTypes.h (+0/-58)
.pc/no-selfconnect.patch/common/Jackdmp.cpp (+0/-534)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Build.py (+0/-525)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Configure.py (+0/-179)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Constants.py (+0/-41)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Environment.py (+0/-128)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Logs.py (+0/-80)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Node.py (+0/-338)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Options.py (+0/-126)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Runner.py (+0/-242)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Scripting.py (+0/-294)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Task.py (+0/-539)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/TaskGen.py (+0/-288)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/UnitTest.py (+0/-116)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/__init__.py (+0/-4)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/ar.py (+0/-53)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/bison.py (+0/-18)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/cc.py (+0/-71)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/ccroot.py (+0/-300)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/compiler_cc.py (+0/-33)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/compiler_cxx.py (+0/-33)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/compiler_d.py (+0/-23)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/config_c.py (+0/-421)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/cs.py (+0/-45)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/cxx.py (+0/-72)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/d.py (+0/-346)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/dbus.py (+0/-28)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/dmd.py (+0/-49)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/flex.py (+0/-14)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/g++.py (+0/-118)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/gas.py (+0/-35)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/gcc.py (+0/-116)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/gdc.py (+0/-49)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/glib2.py (+0/-81)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/gnome.py (+0/-200)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/gnu_dirs.py (+0/-70)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/gob2.py (+0/-11)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/icc.py (+0/-70)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/intltool.py (+0/-79)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/java.py (+0/-107)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/kde4.py (+0/-62)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/libtool.py (+0/-244)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/lua.py (+0/-14)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/misc.py (+0/-301)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/msvc.py (+0/-311)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/nasm.py (+0/-31)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/ocaml.py (+0/-240)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/osx.py (+0/-105)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/perl.py (+0/-78)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/preproc.py (+0/-500)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/python.py (+0/-260)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/qt4.py (+0/-377)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/sunc++.py (+0/-66)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/suncc.py (+0/-71)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/tex.py (+0/-184)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/vala.py (+0/-174)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Tools/winres.py (+0/-40)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Utils.py (+0/-278)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/__init__.py (+0/-4)
.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/pproc.py (+0/-496)
ChangeLog (+269/-54)
README (+3/-2)
README_NETJACK2 (+21/-21)
common/JackAPI.cpp (+317/-276)
common/JackActivationCount.cpp (+2/-2)
common/JackActivationCount.h (+1/-0)
common/JackAtomicArrayState.h (+2/-1)
common/JackAtomicState.h (+2/-0)
common/JackAudioAdapter.cpp (+179/-149)
common/JackAudioAdapter.h (+9/-5)
common/JackAudioAdapterFactory.cpp (+13/-13)
common/JackAudioAdapterInterface.cpp (+100/-81)
common/JackAudioAdapterInterface.h (+61/-38)
common/JackAudioDriver.cpp (+150/-124)
common/JackAudioDriver.h (+11/-22)
common/JackChannel.h (+3/-2)
common/JackClient.cpp (+19/-13)
common/JackClient.h (+2/-3)
common/JackClientControl.h (+2/-1)
common/JackConnectionManager.h (+6/-0)
common/JackConstants.h (+5/-4)
common/JackControlAPI.cpp (+317/-302)
common/JackControlAPI.h (+67/-54)
common/JackDebugClient.cpp (+2/-2)
common/JackDebugClient.h (+1/-1)
common/JackDriver.cpp (+163/-32)
common/JackDriver.h (+78/-23)
common/JackDriverLoader.cpp (+235/-100)
common/JackDriverLoader.h (+19/-10)
common/JackDummyDriver.cpp (+34/-124)
common/JackDummyDriver.h (+13/-26)
common/JackEngine.cpp (+53/-124)
common/JackEngine.h (+5/-8)
common/JackEngineControl.cpp (+22/-8)
common/JackEngineControl.h (+13/-12)
common/JackEngineProfiling.cpp (+61/-61)
common/JackEngineProfiling.h (+4/-0)
common/JackError.cpp (+14/-14)
common/JackError.h (+13/-13)
common/JackException.h (+16/-9)
common/JackExternalClient.cpp (+5/-4)
common/JackExternalClient.h (+2/-2)
common/JackFilters.h (+66/-53)
common/JackFrameTimer.cpp (+1/-1)
common/JackFrameTimer.h (+2/-0)
common/JackFreewheelDriver.cpp (+64/-17)
common/JackFreewheelDriver.h (+10/-0)
common/JackGlobals.cpp (+6/-6)
common/JackGlobals.h (+8/-7)
common/JackGraphManager.cpp (+8/-9)
common/JackGraphManager.h (+1/-0)
common/JackInternalClient.cpp (+7/-6)
common/JackInternalClientChannel.h (+37/-2)
common/JackLibAPI.cpp (+24/-21)
common/JackLibClient.cpp (+5/-8)
common/JackLibClient.h (+1/-1)
common/JackLibGlobals.h (+9/-1)
common/JackLibSampleRateResampler.cpp (+4/-3)
common/JackLibSampleRateResampler.h (+0/-2)
common/JackLockedEngine.h (+21/-11)
common/JackLoopbackDriver.cpp (+54/-30)
common/JackLoopbackDriver.h (+9/-3)
common/JackMessageBuffer.cpp (+43/-27)
common/JackMessageBuffer.h (+13/-13)
common/JackMidiAPI.cpp (+57/-38)
common/JackMidiAsyncQueue.cpp (+96/-0)
common/JackMidiAsyncQueue.h (+98/-0)
common/JackMidiAsyncWaitQueue.cpp (+85/-0)
common/JackMidiAsyncWaitQueue.h (+99/-0)
common/JackMidiBufferReadQueue.cpp (+67/-0)
common/JackMidiBufferReadQueue.h (+60/-0)
common/JackMidiBufferWriteQueue.cpp (+65/-0)
common/JackMidiBufferWriteQueue.h (+62/-0)
common/JackMidiDriver.cpp (+105/-70)
common/JackMidiDriver.h (+12/-16)
common/JackMidiPort.cpp (+6/-3)
common/JackMidiRawInputWriteQueue.cpp (+299/-0)
common/JackMidiRawInputWriteQueue.h (+177/-0)
common/JackMidiRawOutputWriteQueue.cpp (+158/-0)
common/JackMidiRawOutputWriteQueue.h (+139/-0)
common/JackMidiReadQueue.cpp (+27/-0)
common/JackMidiReadQueue.h (+55/-0)
common/JackMidiReceiveQueue.cpp (+27/-0)
common/JackMidiReceiveQueue.h (+42/-0)
common/JackMidiSendQueue.cpp (+34/-0)
common/JackMidiSendQueue.h (+52/-0)
common/JackMidiUtil.cpp (+121/-0)
common/JackMidiUtil.h (+102/-0)
common/JackMidiWriteQueue.cpp (+27/-0)
common/JackMidiWriteQueue.h (+82/-0)
common/JackMutex.h (+6/-6)
common/JackNetAPI.cpp (+1043/-0)
common/JackNetAdapter.cpp (+229/-270)
common/JackNetAdapter.h (+42/-38)
common/JackNetDriver.cpp (+382/-398)
common/JackNetDriver.h (+21/-22)
common/JackNetInterface.cpp (+674/-654)
common/JackNetInterface.h (+117/-92)
common/JackNetManager.cpp (+426/-350)
common/JackNetManager.h (+21/-15)
common/JackNetOneDriver.cpp (+793/-970)
common/JackNetOneDriver.h (+65/-69)
common/JackNetSocket.h (+1/-2)
common/JackNetTool.cpp (+846/-220)
common/JackNetTool.h (+227/-73)
common/JackPhysicalMidiInput.cpp (+0/-287)
common/JackPhysicalMidiInput.h (+0/-146)
common/JackPhysicalMidiOutput.cpp (+0/-320)
common/JackPhysicalMidiOutput.h (+0/-118)
common/JackPort.cpp (+9/-5)
common/JackPort.h (+5/-4)
common/JackProfiler.cpp (+10/-31)
common/JackRequest.h (+88/-31)
common/JackResampler.cpp (+32/-2)
common/JackResampler.h (+3/-0)
common/JackRestartThreadedDriver.cpp (+1/-1)
common/JackServer.cpp (+5/-6)
common/JackServer.h (+1/-1)
common/JackServerAPI.cpp (+12/-12)
common/JackServerGlobals.cpp (+4/-5)
common/JackServerGlobals.h (+1/-2)
common/JackSession.h (+69/-0)
common/JackShmMem.cpp (+13/-13)
common/JackShmMem.h (+35/-32)
common/JackThreadedDriver.cpp (+75/-32)
common/JackThreadedDriver.h (+25/-11)
common/JackTimedDriver.cpp (+89/-0)
common/JackTimedDriver.h (+80/-0)
common/JackTools.cpp (+2/-2)
common/JackTools.h (+16/-5)
common/JackTransportEngine.cpp (+8/-8)
common/JackTransportEngine.h (+28/-27)
common/JackTypes.h (+0/-10)
common/JackWaitThreadedDriver.cpp (+19/-17)
common/JackWaitThreadedDriver.h (+28/-24)
common/JackWeakAPI.c (+307/-0)
common/JackWeakAPI.cpp (+0/-308)
common/Jackdmp.cpp (+52/-43)
common/driver_interface.h (+104/-72)
common/jack/control.h (+20/-1)
common/jack/jack.h (+3/-3)
common/jack/midiport.h (+4/-4)
common/jack/net.h (+316/-0)
common/jack/session.h (+16/-8)
common/jack/systemdeps.h (+27/-15)
common/jack/thread.h (+1/-1)
common/jack/transport.h (+9/-9)
common/jack/weakjack.h (+30/-12)
common/jack/weakmacros.h (+29/-12)
common/netjack.c (+279/-303)
common/netjack.h (+100/-104)
common/netjack_packet.c (+196/-290)
common/netjack_packet.h (+101/-113)
common/ringbuffer.c (+36/-35)
common/shm.c (+86/-8)
common/shm.h (+9/-1)
common/wscript (+54/-9)
dbus/controller.c (+381/-116)
dbus/controller.h (+4/-0)
dbus/controller_iface_configure.c (+369/-1569)
dbus/controller_iface_control.c (+60/-26)
dbus/controller_iface_session_manager.c (+572/-0)
dbus/controller_internal.h (+47/-66)
dbus/jackdbus.c (+10/-1)
dbus/jackdbus.h (+1/-0)
dbus/params.c (+726/-0)
dbus/params.h (+111/-0)
dbus/reserve.c (+2/-3)
dbus/sigsegv.c (+0/-2)
dbus/wscript (+3/-1)
dbus/xml.c (+106/-348)
dbus/xml_expat.c (+96/-138)
dbus/xml_libxml.c (+0/-797)
dbus/xml_write_raw.c (+96/-140)
debian/changelog (+45/-0)
debian/control (+3/-4)
debian/control.in (+1/-2)
debian/libjack-jackd2-0.install (+1/-0)
debian/libjack-jackd2-0.lintian-overrides (+4/-0)
debian/patches/alsa-portnames.patch (+297/-0)
debian/patches/hppa-parallel.patch (+2/-2)
debian/patches/netjack-kfreebsd.patch (+43/-0)
debian/patches/no-selfconnect.patch (+69/-90)
debian/patches/series (+1/-1)
debian/po/cs.po (+10/-20)
debian/po/da.po (+49/-0)
debian/po/de.po (+12/-11)
debian/po/es.po (+26/-10)
debian/po/fi.po (+9/-9)
debian/po/fr.po (+10/-9)
debian/po/gl.po (+10/-13)
debian/po/it.po (+6/-5)
debian/po/ja.po (+13/-13)
debian/po/ko.po (+52/-0)
debian/po/nl.po (+51/-0)
debian/po/pt.po (+7/-9)
debian/po/pt_BR.po (+5/-5)
debian/po/ru.po (+13/-23)
debian/po/sv.po (+13/-12)
debian/po/templates.pot (+6/-5)
debian/po/vi.po (+17/-7)
debian/rules (+4/-6)
doxyfile (+8/-1)
example-clients/alias.c (+2/-2)
example-clients/bufsize.c (+3/-3)
example-clients/capture_client.c (+11/-12)
example-clients/connect.c (+1/-1)
example-clients/cpu_load.c (+30/-34)
example-clients/freewheel.c (+2/-2)
example-clients/impulse_grabber.c (+8/-7)
example-clients/ipunload.c (+3/-3)
example-clients/jack_control (+22/-0)
example-clients/latent_client.c (+10/-8)
example-clients/lsp.c (+2/-1)
example-clients/metro.c (+24/-12)
example-clients/midi_dump.c (+15/-8)
example-clients/midi_latency_test.c (+969/-0)
example-clients/midiseq.c (+4/-4)
example-clients/midisine.c (+7/-6)
example-clients/monitor_client.c (+1/-1)
example-clients/netmaster.c (+181/-0)
example-clients/netslave.c (+168/-0)
example-clients/netsource.c (+180/-215)
example-clients/samplerate.c (+1/-1)
example-clients/server_control.cpp (+2/-0)
example-clients/session_notify.c (+7/-7)
example-clients/showtime.c (+4/-3)
example-clients/thru_client.c (+1/-1)
example-clients/tw.c (+24/-23)
example-clients/wait.c (+32/-32)
example-clients/wscript (+27/-17)
example-clients/zombie.c (+10/-10)
linux/JackLinuxTime.c (+1/-1)
linux/alsa/JackAlsaAdapter.cpp (+34/-102)
linux/alsa/JackAlsaAdapter.h (+1/-1)
linux/alsa/JackAlsaDriver.cpp (+131/-208)
linux/alsa/JackAlsaDriver.h (+2/-0)
linux/alsa/alsa_driver.c (+143/-16)
linux/alsa/alsa_rawmidi.c (+2/-2)
linux/alsa/alsa_seqmidi.c (+2/-2)
linux/alsarawmidi/JackALSARawMidiDriver.cpp (+653/-0)
linux/alsarawmidi/JackALSARawMidiDriver.h (+100/-0)
linux/alsarawmidi/JackALSARawMidiInputPort.cpp (+122/-0)
linux/alsarawmidi/JackALSARawMidiInputPort.h (+60/-0)
linux/alsarawmidi/JackALSARawMidiOutputPort.cpp (+146/-0)
linux/alsarawmidi/JackALSARawMidiOutputPort.h (+61/-0)
linux/alsarawmidi/JackALSARawMidiPort.cpp (+256/-0)
linux/alsarawmidi/JackALSARawMidiPort.h (+85/-0)
linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp (+54/-0)
linux/alsarawmidi/JackALSARawMidiReceiveQueue.h (+51/-0)
linux/alsarawmidi/JackALSARawMidiSendQueue.cpp (+73/-0)
linux/alsarawmidi/JackALSARawMidiSendQueue.h (+57/-0)
linux/alsarawmidi/JackALSARawMidiUtil.cpp (+43/-0)
linux/alsarawmidi/JackALSARawMidiUtil.h (+36/-0)
linux/firewire/JackFFADODriver.cpp (+79/-162)
linux/firewire/JackFFADOMidiInput.cpp (+0/-59)
linux/firewire/JackFFADOMidiInput.h (+0/-54)
linux/firewire/JackFFADOMidiInputPort.cpp (+94/-0)
linux/firewire/JackFFADOMidiInputPort.h (+51/-0)
linux/firewire/JackFFADOMidiOutput.cpp (+0/-60)
linux/firewire/JackFFADOMidiOutput.h (+0/-57)
linux/firewire/JackFFADOMidiOutputPort.cpp (+98/-0)
linux/firewire/JackFFADOMidiOutputPort.h (+53/-0)
linux/firewire/JackFFADOMidiReceiveQueue.cpp (+55/-0)
linux/firewire/JackFFADOMidiReceiveQueue.h (+52/-0)
linux/firewire/JackFFADOMidiSendQueue.cpp (+64/-0)
linux/firewire/JackFFADOMidiSendQueue.h (+54/-0)
linux/freebob/JackFreebobDriver.cpp (+46/-114)
linux/wscript (+20/-7)
macosx/Jack-Info.plist (+2/-2)
macosx/JackCompilerDeps_os.h (+6/-4)
macosx/JackMachSemaphore.cpp (+16/-24)
macosx/JackMachSemaphore.h (+4/-4)
macosx/JackMachThread.cpp (+21/-3)
macosx/JackMachThread.h (+13/-1)
macosx/JackPlatformPlug_os.h (+22/-6)
macosx/Jackdmp.xcodeproj/project.pbxproj (+1198/-399)
macosx/coreaudio/JackCoreAudioAdapter.cpp (+347/-227)
macosx/coreaudio/JackCoreAudioAdapter.h (+21/-8)
macosx/coreaudio/JackCoreAudioDriver.cpp (+709/-323)
macosx/coreaudio/JackCoreAudioDriver.h (+32/-21)
macosx/coreaudio/TiPhoneCoreAudioRenderer.cpp (+409/-0)
macosx/coreaudio/TiPhoneCoreAudioRenderer.h (+116/-0)
macosx/coremidi/JackCoreMidiDriver.cpp (+779/-359)
macosx/coremidi/JackCoreMidiDriver.h (+80/-49)
macosx/coremidi/JackCoreMidiInputPort.cpp (+183/-0)
macosx/coremidi/JackCoreMidiInputPort.h (+73/-0)
macosx/coremidi/JackCoreMidiOutputPort.cpp (+249/-0)
macosx/coremidi/JackCoreMidiOutputPort.h (+90/-0)
macosx/coremidi/JackCoreMidiPhysicalInputPort.cpp (+53/-0)
macosx/coremidi/JackCoreMidiPhysicalInputPort.h (+45/-0)
macosx/coremidi/JackCoreMidiPhysicalOutputPort.cpp (+78/-0)
macosx/coremidi/JackCoreMidiPhysicalOutputPort.h (+55/-0)
macosx/coremidi/JackCoreMidiPort.cpp (+93/-0)
macosx/coremidi/JackCoreMidiPort.h (+67/-0)
macosx/coremidi/JackCoreMidiUtil.cpp (+43/-0)
macosx/coremidi/JackCoreMidiUtil.h (+39/-0)
macosx/coremidi/JackCoreMidiVirtualInputPort.cpp (+75/-0)
macosx/coremidi/JackCoreMidiVirtualInputPort.h (+50/-0)
macosx/coremidi/JackCoreMidiVirtualOutputPort.cpp (+72/-0)
macosx/coremidi/JackCoreMidiVirtualOutputPort.h (+49/-0)
macosx/install_jackdmp (+6/-1)
macosx/iphone/Info.plist (+30/-0)
macosx/iphone/MainWindow.xib (+440/-0)
macosx/iphone/audio_thru.mm (+35/-0)
macosx/iphone/freeverb.mm (+754/-0)
macosx/iphone/iPhoneNet.xcodeproj/project.pbxproj (+1298/-0)
macosx/iphone/iPhoneNetAppDelegate.h (+23/-0)
macosx/iphone/iPhoneNetAppDelegate.m (+32/-0)
macosx/iphone/iPhoneNet_Prefix.pch (+10/-0)
macosx/iphone/iphone-faust.mm (+3129/-0)
macosx/iphone/main_master.mm (+155/-0)
macosx/iphone/main_slave.mm (+114/-0)
macosx/remove_jackdmp (+1/-0)
macosx/wscript (+12/-1)
man/jack_connect.0 (+1/-1)
man/jack_iodelay.0 (+24/-17)
man/jackd.0 (+30/-9)
posix/JackCompilerDeps_os.h (+6/-4)
posix/JackNetUnixSocket.cpp (+156/-134)
posix/JackNetUnixSocket.h (+25/-20)
posix/JackPosixMutex.h (+58/-21)
posix/JackPosixSemaphore.cpp (+12/-12)
posix/JackPosixSemaphore.h (+2/-2)
posix/JackPosixServerLaunch.cpp (+4/-1)
posix/JackPosixThread.cpp (+2/-0)
posix/JackPosixThread.h (+3/-1)
posix/JackProcessSync.cpp (+26/-9)
posix/JackProcessSync.h (+8/-6)
posix/JackSocket.cpp (+2/-0)
posix/JackSocketClientChannel.cpp (+8/-25)
posix/JackSocketClientChannel.h (+1/-1)
posix/JackSocketServerChannel.cpp (+14/-8)
posix/JackSocketServerChannel.h (+1/-0)
solaris/oss/JackBoomerDriver.cpp (+168/-243)
solaris/oss/JackBoomerDriver.h (+0/-1)
solaris/oss/JackOSSAdapter.cpp (+125/-198)
solaris/oss/JackOSSAdapter.h (+17/-18)
solaris/oss/JackOSSDriver.cpp (+121/-196)
solaris/oss/JackOSSDriver.h (+8/-9)
svnversion.h (+1/-1)
tests/cpu.c (+28/-28)
tests/iodelay.cpp (+41/-37)
tests/test.cpp (+7/-5)
tests/wscript (+2/-2)
waf (+0/-131)
waf-light (+128/-0)
wafadmin/Build.py (+525/-0)
wafadmin/Configure.py (+179/-0)
wafadmin/Constants.py (+41/-0)
wafadmin/Environment.py (+128/-0)
wafadmin/Logs.py (+80/-0)
wafadmin/Node.py (+338/-0)
wafadmin/Options.py (+126/-0)
wafadmin/Runner.py (+145/-0)
wafadmin/Scripting.py (+294/-0)
wafadmin/Task.py (+539/-0)
wafadmin/TaskGen.py (+288/-0)
wafadmin/Tools/UnitTest.py (+116/-0)
wafadmin/Tools/__init__.py (+4/-0)
wafadmin/Tools/ar.py (+53/-0)
wafadmin/Tools/bison.py (+18/-0)
wafadmin/Tools/cc.py (+71/-0)
wafadmin/Tools/ccroot.py (+300/-0)
wafadmin/Tools/compiler_cc.py (+33/-0)
wafadmin/Tools/compiler_cxx.py (+33/-0)
wafadmin/Tools/compiler_d.py (+23/-0)
wafadmin/Tools/config_c.py (+421/-0)
wafadmin/Tools/cs.py (+45/-0)
wafadmin/Tools/cxx.py (+72/-0)
wafadmin/Tools/d.py (+346/-0)
wafadmin/Tools/dbus.py (+28/-0)
wafadmin/Tools/dmd.py (+49/-0)
wafadmin/Tools/flex.py (+14/-0)
wafadmin/Tools/g++.py (+118/-0)
wafadmin/Tools/gas.py (+35/-0)
wafadmin/Tools/gcc.py (+116/-0)
wafadmin/Tools/gdc.py (+49/-0)
wafadmin/Tools/glib2.py (+81/-0)
wafadmin/Tools/gnome.py (+200/-0)
wafadmin/Tools/gnu_dirs.py (+70/-0)
wafadmin/Tools/gob2.py (+11/-0)
wafadmin/Tools/icc.py (+70/-0)
wafadmin/Tools/intltool.py (+79/-0)
wafadmin/Tools/java.py (+107/-0)
wafadmin/Tools/kde4.py (+62/-0)
wafadmin/Tools/libtool.py (+244/-0)
wafadmin/Tools/lua.py (+14/-0)
wafadmin/Tools/misc.py (+301/-0)
wafadmin/Tools/msvc.py (+311/-0)
wafadmin/Tools/nasm.py (+31/-0)
wafadmin/Tools/ocaml.py (+240/-0)
wafadmin/Tools/osx.py (+105/-0)
wafadmin/Tools/perl.py (+78/-0)
wafadmin/Tools/preproc.py (+500/-0)
wafadmin/Tools/python.py (+260/-0)
wafadmin/Tools/qt4.py (+377/-0)
wafadmin/Tools/sunc++.py (+66/-0)
wafadmin/Tools/suncc.py (+71/-0)
wafadmin/Tools/tex.py (+184/-0)
wafadmin/Tools/vala.py (+174/-0)
wafadmin/Tools/winres.py (+40/-0)
wafadmin/Utils.py (+278/-0)
wafadmin/__init__.py (+4/-0)
wafadmin/pproc.py (+496/-0)
windows/JackCompilerDeps_os.h (+33/-7)
windows/JackMMCSS.cpp (+87/-0)
windows/JackMMCSS.h (+72/-0)
windows/JackNetWinSocket.cpp (+174/-154)
windows/JackNetWinSocket.h (+29/-25)
windows/JackPlatformPlug_os.h (+11/-6)
windows/JackRouter/JackRouter.cpp (+35/-29)
windows/JackRouter/JackRouter.h (+20/-20)
windows/JackRouter/JackRouter.vcxproj (+280/-0)
windows/JackRouter/JackRouter.vcxproj.filters (+69/-0)
windows/JackRouter/JackRouter.vcxproj.user (+6/-0)
windows/JackRouter/README (+5/-1)
windows/JackShmMem_os.h (+30/-7)
windows/JackSystemDeps_os.h (+19/-4)
windows/JackWinEvent.cpp (+8/-8)
windows/JackWinEvent.h (+5/-5)
windows/JackWinMutex.h (+83/-5)
windows/JackWinNamedPipe.cpp (+131/-125)
windows/JackWinNamedPipe.h (+20/-7)
windows/JackWinNamedPipeClientChannel.cpp (+14/-27)
windows/JackWinNamedPipeClientChannel.h (+1/-1)
windows/JackWinNamedPipeServerChannel.cpp (+20/-14)
windows/JackWinNamedPipeServerChannel.h (+3/-1)
windows/JackWinSemaphore.cpp (+13/-12)
windows/JackWinSemaphore.h (+5/-5)
windows/JackWinServerLaunch.cpp (+292/-1)
windows/JackWinThread.cpp (+16/-7)
windows/JackWinThread.h (+2/-3)
windows/Setup/README (+8/-1)
windows/Setup/jack.ci (+14/-12)
windows/Setup/jack64.ci (+158/-0)
windows/Setup/src/32bits/JackRouter.ini (+7/-0)
windows/Setup/src/64bits/JackRouter.ini (+7/-0)
windows/jack_audioadapter.cbp (+209/-112)
windows/jack_connect.cbp (+71/-8)
windows/jack_disconnect.cbp (+71/-8)
windows/jack_dummy.cbp (+179/-98)
windows/jack_latent_client.cbp (+69/-8)
windows/jack_load.cbp (+70/-8)
windows/jack_loopback.cbp (+89/-8)
windows/jack_lsp.cbp (+69/-8)
windows/jack_metro.cbp (+71/-8)
windows/jack_midi_dump.cbp (+152/-0)
windows/jack_midi_latency_test.cbp (+152/-0)
windows/jack_netadapter.cbp (+95/-10)
windows/jack_netdriver.cbp (+89/-8)
windows/jack_netmanager.cbp (+87/-9)
windows/jack_netonedriver.cbp (+89/-8)
windows/jack_netsource.cbp (+177/-110)
windows/jack_portaudio.cbp (+120/-10)
windows/jack_test.cbp (+71/-8)
windows/jack_unload.cbp (+68/-8)
windows/jack_winmme.cbp (+117/-9)
windows/jackd.cbp (+101/-10)
windows/jackd.workspace (+21/-53)
windows/libjack.cbp (+163/-8)
windows/libjacknet.cbp (+264/-0)
windows/libjackserver.cbp (+140/-10)
windows/multiple_metro.cbp (+70/-8)
windows/portaudio/JackPortAudioAdapter.cpp (+88/-151)
windows/portaudio/JackPortAudioAdapter.h (+1/-1)
windows/portaudio/JackPortAudioDevices.cpp (+114/-116)
windows/portaudio/JackPortAudioDevices.h (+7/-3)
windows/portaudio/JackPortAudioDriver.cpp (+297/-344)
windows/portaudio/JackPortAudioDriver.h (+6/-2)
windows/winmme/JackWinMMEDriver.cpp (+346/-403)
windows/winmme/JackWinMMEDriver.h (+42/-56)
windows/winmme/JackWinMMEInputPort.cpp (+312/-0)
windows/winmme/JackWinMMEInputPort.h (+82/-0)
windows/winmme/JackWinMMEOutputPort.cpp (+400/-0)
windows/winmme/JackWinMMEOutputPort.h (+90/-0)
windows/winmme/JackWinMMEPort.cpp (+69/-0)
windows/winmme/JackWinMMEPort.h (+59/-0)
wscript (+7/-1)
To merge this branch: bzr merge lp:~artfwo/ubuntu/precise/jackd2/jackd2-fix-911342
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Ubuntu branches Pending
Review via email: mp+87388@code.launchpad.net

Description of the change

* Merge from debian unstable (LP: #911342), remaining changes:
  - Drop libcelt build dependency
  - debian/gbp.conf: Set debian-branch to ubuntu
  - Drop dh-buildinfo build-dependency; this creates conflicting
    per-architecture buildinfo.gz files that prevent multiarch
    co-installability, and all this information is already available in the
    build logs.
  - Build for multiarch. LP: #861025.
  - Build using dh_python2

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your work, it's a bit weird that the diff lists no change in debian directory, it should at least have a new changelog revision? I will look at the debdiff on the bug

Revision history for this message
Sebastien Bacher (seb128) wrote :

Hum, Debian got a new version in testing since, do you think you could rebase your work on this one?

Revision history for this message
Sebastien Bacher (seb128) wrote :

(settings to "Work in progress" please set it back to "Needs review" when you update so it's showing up in the queue again)

Revision history for this message
Artem Popov (artfwo) wrote :

Pulled in latest Debian changes. Updated the debdiff on the bug page as well. Setting to 'Needs review' again.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your work, for some reason I've issues with the vcs but the debdiff looks fine so I'm sponsoring that

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file '.pc/applied-patches'
2--- .pc/applied-patches 2011-08-08 14:38:08 +0000
3+++ .pc/applied-patches 1970-01-01 00:00:00 +0000
4@@ -1,4 +0,0 @@
5-hppa-parallel.patch
6-hurd.patch
7-no-selfconnect.patch
8-sh4.patch
9
10=== removed directory '.pc/hppa-parallel.patch'
11=== removed directory '.pc/hppa-parallel.patch/.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6'
12=== removed directory '.pc/hppa-parallel.patch/.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin'
13=== removed file '.pc/hppa-parallel.patch/.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Runner.py'
14--- .pc/hppa-parallel.patch/.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Runner.py 2010-06-19 18:54:29 +0000
15+++ .pc/hppa-parallel.patch/.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Runner.py 1970-01-01 00:00:00 +0000
16@@ -1,145 +0,0 @@
17-#! /usr/bin/env python
18-# encoding: utf-8
19-import sys
20-if sys.hexversion < 0x020400f0: from sets import Set as set
21-import sys,random,time,threading,Queue,traceback
22-import Build,Utils,Logs,Options
23-import pproc
24-from Logs import debug,error
25-from Constants import*
26-GAP=15
27-run_old=threading.Thread.run
28-def run(*args,**kwargs):
29- try:
30- run_old(*args,**kwargs)
31- except(KeyboardInterrupt,SystemExit):
32- raise
33- except:
34- sys.excepthook(*sys.exc_info())
35-threading.Thread.run=run
36-class TaskConsumer(threading.Thread):
37- def __init__(self,m):
38- threading.Thread.__init__(self)
39- self.setDaemon(1)
40- self.master=m
41- self.start()
42- def run(self):
43- try:
44- self.loop()
45- except:
46- pass
47- def loop(self):
48- m=self.master
49- while 1:
50- tsk=m.ready.get()
51- if m.stop:
52- m.out.put(tsk)
53- continue
54- try:
55- tsk.generator.bld.printout(tsk.display())
56- if tsk.__class__.stat:ret=tsk.__class__.stat(tsk)
57- else:ret=tsk.call_run()
58- except Exception,e:
59- tsk.err_msg=Utils.ex_stack()
60- tsk.hasrun=EXCEPTION
61- m.error_handler(tsk)
62- m.out.put(tsk)
63- continue
64- if ret:
65- tsk.err_code=ret
66- tsk.hasrun=CRASHED
67- else:
68- try:
69- tsk.post_run()
70- except OSError:
71- tsk.hasrun=MISSING
72- else:
73- tsk.hasrun=SUCCESS
74- if tsk.hasrun!=SUCCESS:
75- m.error_handler(tsk)
76- m.out.put(tsk)
77-class Parallel(object):
78- def __init__(self,bld,j=2):
79- self.numjobs=j
80- self.manager=bld.task_manager
81- self.total=self.manager.total()
82- self.outstanding=[]
83- self.maxjobs=sys.maxint
84- self.frozen=[]
85- self.ready=Queue.Queue(0)
86- self.out=Queue.Queue(0)
87- self.count=0
88- self.stuck=0
89- self.processed=1
90- self.consumers=None
91- self.stop=False
92- self.error=False
93- def get_next(self):
94- if not self.outstanding:
95- return None
96- return self.outstanding.pop(0)
97- def postpone(self,tsk):
98- if random.randint(0,1):
99- self.frozen.insert(0,tsk)
100- else:
101- self.frozen.append(tsk)
102- def refill_task_list(self):
103- while self.count>self.numjobs+GAP or self.count>self.maxjobs:
104- self.get_out()
105- while not self.outstanding:
106- if self.count:
107- self.get_out()
108- if self.frozen:
109- self.outstanding+=self.frozen
110- self.frozen=[]
111- elif not self.count:
112- (self.maxjobs,tmp)=self.manager.get_next_set()
113- if tmp:self.outstanding+=tmp
114- break
115- def get_out(self):
116- ret=self.out.get()
117- self.manager.add_finished(ret)
118- if not self.stop and getattr(ret,'more_tasks',None):
119- self.outstanding+=ret.more_tasks
120- self.total+=len(ret.more_tasks)
121- self.count-=1
122- def error_handler(self,tsk):
123- if not Options.options.keep:
124- self.stop=True
125- self.error=True
126- def start(self):
127- while not self.stop:
128- self.refill_task_list()
129- tsk=self.get_next()
130- if not tsk:
131- if self.count:
132- continue
133- else:
134- break
135- if tsk.hasrun:
136- self.processed+=1
137- self.manager.add_finished(tsk)
138- try:
139- st=tsk.runnable_status()
140- except Exception,e:
141- tsk.err_msg=Utils.ex_stack()
142- tsk.hasrun=EXCEPTION
143- self.processed+=1
144- self.error_handler(tsk)
145- self.manager.add_finished(tsk)
146- continue
147- if st==ASK_LATER:
148- self.postpone(tsk)
149- elif st==SKIP_ME:
150- self.processed+=1
151- tsk.hasrun=SKIPPED
152- self.manager.add_finished(tsk)
153- else:
154- tsk.position=(self.processed,self.total)
155- self.count+=1
156- self.ready.put(tsk)
157- self.processed+=1
158- if not self.consumers:
159- self.consumers=[TaskConsumer(self)for i in xrange(self.numjobs)]
160- assert(self.count==0 or self.stop)
161-
162
163=== removed directory '.pc/hurd.patch'
164=== removed directory '.pc/hurd.patch/dbus'
165=== removed file '.pc/hurd.patch/dbus/sigsegv.c'
166--- .pc/hurd.patch/dbus/sigsegv.c 2010-08-01 19:54:32 +0000
167+++ .pc/hurd.patch/dbus/sigsegv.c 1970-01-01 00:00:00 +0000
168@@ -1,202 +0,0 @@
169-/**
170- * This source file is used to print out a stack-trace when your program
171- * segfaults. It is relatively reliable and spot-on accurate.
172- *
173- * This code is in the public domain. Use it as you see fit, some credit
174- * would be appreciated, but is not a prerequisite for usage. Feedback
175- * on it's use would encourage further development and maintenance.
176- *
177- * Author: Jaco Kroon <jaco@kroon.co.za>
178- *
179- * Copyright (C) 2005 - 2008 Jaco Kroon
180- */
181-
182-#if defined(HAVE_CONFIG_H)
183-#include "config.h"
184-#endif
185-
186-//#define NO_CPP_DEMANGLE
187-#define SIGSEGV_NO_AUTO_INIT
188-
189-#ifndef _GNU_SOURCE
190-# define _GNU_SOURCE
191-#endif
192-
193-#include <memory.h>
194-#include <stdlib.h>
195-#include <stdio.h>
196-#include <signal.h>
197-#include <dlfcn.h>
198-#include <execinfo.h>
199-#include <errno.h>
200-#ifndef NO_CPP_DEMANGLE
201-char * __cxa_demangle(const char * __mangled_name, char * __output_buffer, size_t * __length, int * __status);
202-#endif
203-
204-#include "JackError.h"
205-
206-#if defined(REG_RIP)
207-# define SIGSEGV_STACK_IA64
208-# define REGFORMAT "%016lx"
209-#elif defined(REG_EIP)
210-# define SIGSEGV_STACK_X86
211-# define REGFORMAT "%08x"
212-#else
213-# define SIGSEGV_STACK_GENERIC
214-# define REGFORMAT "%x"
215-#endif
216-
217-#ifdef __APPLE__
218-
219-// TODO : does not compile yet on OSX
220-static void signal_segv(int signum, siginfo_t* info, void*ptr)
221-{}
222-
223-#else
224-
225-#include <ucontext.h>
226-
227-static void signal_segv(int signum, siginfo_t* info, void*ptr) {
228- static const char *si_codes[3] = {"", "SEGV_MAPERR", "SEGV_ACCERR"};
229-
230- size_t i;
231- ucontext_t *ucontext = (ucontext_t*)ptr;
232-
233-#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
234- int f = 0;
235- Dl_info dlinfo;
236- void **bp = 0;
237- void *ip = 0;
238-#else
239- void *bt[20];
240- char **strings;
241- size_t sz;
242-#endif
243-
244- if (signum == SIGSEGV)
245- {
246- jack_error("Segmentation Fault!");
247- }
248- else if (signum == SIGABRT)
249- {
250- jack_error("Abort!");
251- }
252- else if (signum == SIGILL)
253- {
254- jack_error("Illegal instruction!");
255- }
256- else if (signum == SIGFPE)
257- {
258- jack_error("Floating point exception!");
259- }
260- else
261- {
262- jack_error("Unknown bad signal catched!");
263- }
264-
265- jack_error("info.si_signo = %d", signum);
266- jack_error("info.si_errno = %d", info->si_errno);
267- jack_error("info.si_code = %d (%s)", info->si_code, si_codes[info->si_code]);
268- jack_error("info.si_addr = %p", info->si_addr);
269-#if !defined(__alpha__) && !defined(__ia64__) && !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && !defined(__sh__)
270- for(i = 0; i < NGREG; i++)
271- jack_error("reg[%02d] = 0x" REGFORMAT, i,
272-#if defined(__powerpc__)
273- ucontext->uc_mcontext.uc_regs[i]
274-#elif defined(__sparc__) && defined(__arch64__)
275- ucontext->uc_mcontext.mc_gregs[i]
276-#else
277- ucontext->uc_mcontext.gregs[i]
278-#endif
279- );
280-#endif /* alpha, ia64, kFreeBSD, arm, hppa */
281-
282-#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
283-# if defined(SIGSEGV_STACK_IA64)
284- ip = (void*)ucontext->uc_mcontext.gregs[REG_RIP];
285- bp = (void**)ucontext->uc_mcontext.gregs[REG_RBP];
286-# elif defined(SIGSEGV_STACK_X86)
287- ip = (void*)ucontext->uc_mcontext.gregs[REG_EIP];
288- bp = (void**)ucontext->uc_mcontext.gregs[REG_EBP];
289-# endif
290-
291- jack_error("Stack trace:");
292- while(bp && ip) {
293- if(!dladdr(ip, &dlinfo))
294- break;
295-
296- const char *symname = dlinfo.dli_sname;
297-#ifndef NO_CPP_DEMANGLE
298- int status;
299- char *tmp = __cxa_demangle(symname, NULL, 0, &status);
300-
301- if(status == 0 && tmp)
302- symname = tmp;
303-#endif
304-
305- jack_error("% 2d: %p <%s+%u> (%s)",
306- ++f,
307- ip,
308- symname,
309- (unsigned)(ip - dlinfo.dli_saddr),
310- dlinfo.dli_fname);
311-
312-#ifndef NO_CPP_DEMANGLE
313- if(tmp)
314- free(tmp);
315-#endif
316-
317- if(dlinfo.dli_sname && !strcmp(dlinfo.dli_sname, "main"))
318- break;
319-
320- ip = bp[1];
321- bp = (void**)bp[0];
322- }
323-#else
324- jack_error("Stack trace (non-dedicated):");
325- sz = backtrace(bt, 20);
326- strings = backtrace_symbols(bt, sz);
327-
328- for(i = 0; i < sz; ++i)
329- jack_error("%s", strings[i]);
330-#endif
331- jack_error("End of stack trace");
332- exit (-1);
333-}
334-
335-#endif
336-
337-int setup_sigsegv() {
338- struct sigaction action;
339-
340- memset(&action, 0, sizeof(action));
341- action.sa_sigaction = signal_segv;
342- action.sa_flags = SA_SIGINFO;
343- if(sigaction(SIGSEGV, &action, NULL) < 0) {
344- jack_error("sigaction failed. errno is %d (%s)", errno, strerror(errno));
345- return 0;
346- }
347-
348- if(sigaction(SIGILL, &action, NULL) < 0) {
349- jack_error("sigaction failed. errno is %d (%s)", errno, strerror(errno));
350- return 0;
351- }
352-
353- if(sigaction(SIGABRT, &action, NULL) < 0) {
354- jack_error("sigaction failed. errno is %d (%s)", errno, strerror(errno));
355- return 0;
356- }
357-
358- if(sigaction(SIGFPE, &action, NULL) < 0) {
359- jack_error("sigaction failed. errno is %d (%s)", errno, strerror(errno));
360- return 0;
361- }
362-
363- return 1;
364-}
365-
366-#ifndef SIGSEGV_NO_AUTO_INIT
367-static void __attribute((constructor)) init(void) {
368- setup_sigsegv();
369-}
370-#endif
371
372=== removed directory '.pc/no-selfconnect.patch'
373=== removed directory '.pc/no-selfconnect.patch/common'
374=== removed file '.pc/no-selfconnect.patch/common/JackConstants.h'
375--- .pc/no-selfconnect.patch/common/JackConstants.h 2011-01-29 19:00:05 +0000
376+++ .pc/no-selfconnect.patch/common/JackConstants.h 1970-01-01 00:00:00 +0000
377@@ -1,82 +0,0 @@
378-/*
379- Copyright (C) 2004-2008 Grame
380-
381- This program is free software; you can redistribute it and/or modify
382- it under the terms of the GNU General Public License as published by
383- the Free Software Foundation; either version 2 of the License, or
384- (at your option) any later version.
385-
386- This program is distributed in the hope that it will be useful,
387- but WITHOUT ANY WARRANTY; without even the implied warranty of
388- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
389- GNU General Public License for more details.
390-
391- You should have received a copy of the GNU General Public License
392- along with this program; if not, write to the Free Software
393- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
394-
395-*/
396-
397-#ifndef __JackConstants__
398-#define __JackConstants__
399-
400-#ifdef HAVE_CONFIG_H
401-#include "config.h"
402-#endif
403-
404-#define VERSION "1.9.7"
405-
406-#define BUFFER_SIZE_MAX 8192
407-
408-#define JACK_PORT_NAME_SIZE 256
409-#define JACK_PORT_TYPE_SIZE 32
410-
411-#define JACK_CLIENT_NAME_SIZE 64
412-#define JACK_MESSAGE_SIZE 256
413-#define JACK_UUID_SIZE 32
414-#define JACK_SESSION_COMMAND_SIZE 256
415-
416-#ifndef PORT_NUM
417-#define PORT_NUM 2048
418-#endif
419-
420-#define PORT_NUM_MAX 4096 // The "max" value for ports used in connection manager, although port number in graph manager is dynamic
421-
422-#define DRIVER_PORT_NUM 256
423-
424-#ifndef PORT_NUM_FOR_CLIENT
425-#define PORT_NUM_FOR_CLIENT 768
426-#endif
427-
428-#define FIRST_AVAILABLE_PORT 1
429-
430-#define CONNECTION_NUM_FOR_PORT PORT_NUM_FOR_CLIENT
431-
432-#ifndef CLIENT_NUM
433-#define CLIENT_NUM 64
434-#endif
435-
436-#define AUDIO_DRIVER_REFNUM 0 // Audio driver is initialized first, it will get the refnum 0
437-#define FREEWHEEL_DRIVER_REFNUM 1 // Freewheel driver is initialized second, it will get the refnum 1
438-
439-#define JACK_DEFAULT_SERVER_NAME "default"
440-
441-#define jack_server_entry "jackdmp_entry"
442-#define jack_client_entry "jack_client"
443-
444-#define ALL_CLIENTS -1 // for notification
445-
446-#define JACK_PROTOCOL_VERSION 8
447-
448-#define SOCKET_TIME_OUT 5 // in sec
449-#define DRIVER_OPEN_TIMEOUT 5 // in sec
450-#define FREEWHEEL_DRIVER_TIMEOUT 10 // in sec
451-#define DRIVER_TIMEOUT_FACTOR 10
452-
453-
454-#define NO_PORT 0xFFFE
455-
456-#define EMPTY 0xFFFD
457-#define FREE 0xFFFC
458-
459-#endif
460
461=== removed file '.pc/no-selfconnect.patch/common/JackControlAPI.cpp'
462--- .pc/no-selfconnect.patch/common/JackControlAPI.cpp 2011-03-31 13:54:50 +0000
463+++ .pc/no-selfconnect.patch/common/JackControlAPI.cpp 1970-01-01 00:00:00 +0000
464@@ -1,1249 +0,0 @@
465-// u/* -*- Mode: C++ ; c-basic-offset: 4 -*- */
466-/*
467- JACK control API implementation
468-
469- Copyright (C) 2008 Nedko Arnaudov
470- Copyright (C) 2008 Grame
471-
472- This program is free software; you can redistribute it and/or modify
473- it under the terms of the GNU General Public License as published by
474- the Free Software Foundation; version 2 of the License.
475-
476- This program is distributed in the hope that it will be useful,
477- but WITHOUT ANY WARRANTY; without even the implied warranty of
478- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
479- GNU General Public License for more details.
480-
481- You should have received a copy of the GNU General Public License
482- along with this program; if not, write to the Free Software
483- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
484-
485-*/
486-
487-#ifndef WIN32
488-#include <stdint.h>
489-#include <dirent.h>
490-#include <pthread.h>
491-#endif
492-
493-#include "types.h"
494-#include <string.h>
495-#include <errno.h>
496-#include <stdio.h>
497-#include <assert.h>
498-#include <signal.h>
499-
500-#include "jslist.h"
501-#include "driver_interface.h"
502-#include "JackError.h"
503-#include "JackServer.h"
504-#include "shm.h"
505-#include "JackTools.h"
506-#include "JackControlAPI.h"
507-#include "JackLockedEngine.h"
508-#include "JackConstants.h"
509-#include "JackDriverLoader.h"
510-#include "JackServerGlobals.h"
511-
512-using namespace Jack;
513-
514-struct jackctl_server
515-{
516- JSList * drivers;
517- JSList * internals;
518- JSList * parameters;
519-
520- class JackServer * engine;
521-
522- /* string, server name */
523- union jackctl_parameter_value name;
524- union jackctl_parameter_value default_name;
525-
526- /* bool, whether to be "realtime" */
527- union jackctl_parameter_value realtime;
528- union jackctl_parameter_value default_realtime;
529-
530- /* int32_t */
531- union jackctl_parameter_value realtime_priority;
532- union jackctl_parameter_value default_realtime_priority;
533-
534- /* bool, whether to exit once all clients have closed their connections */
535- union jackctl_parameter_value temporary;
536- union jackctl_parameter_value default_temporary;
537-
538- /* bool, whether to be verbose */
539- union jackctl_parameter_value verbose;
540- union jackctl_parameter_value default_verbose;
541-
542- /* int32_t, msecs; if zero, use period size. */
543- union jackctl_parameter_value client_timeout;
544- union jackctl_parameter_value default_client_timeout;
545-
546- /* uint32_t, clock source type */
547- union jackctl_parameter_value clock_source;
548- union jackctl_parameter_value default_clock_source;
549-
550- /* uint32_t, max port number */
551- union jackctl_parameter_value port_max;
552- union jackctl_parameter_value default_port_max;
553-
554- /* bool */
555- union jackctl_parameter_value replace_registry;
556- union jackctl_parameter_value default_replace_registry;
557-
558- /* bool, synchronous or asynchronous engine mode */
559- union jackctl_parameter_value sync;
560- union jackctl_parameter_value default_sync;
561-};
562-
563-struct jackctl_driver
564-{
565- jack_driver_desc_t * desc_ptr;
566- JSList * parameters;
567- JSList * set_parameters;
568- JackDriverInfo* info;
569-};
570-
571-struct jackctl_internal
572-{
573- jack_driver_desc_t * desc_ptr;
574- JSList * parameters;
575- JSList * set_parameters;
576- int refnum;
577-};
578-
579-struct jackctl_parameter
580-{
581- const char * name;
582- const char * short_description;
583- const char * long_description;
584- jackctl_param_type_t type;
585- bool is_set;
586- union jackctl_parameter_value * value_ptr;
587- union jackctl_parameter_value * default_value_ptr;
588-
589- union jackctl_parameter_value value;
590- union jackctl_parameter_value default_value;
591- struct jackctl_driver * driver_ptr;
592- char id;
593- jack_driver_param_t * driver_parameter_ptr;
594- jack_driver_param_constraint_desc_t * constraint_ptr;
595-};
596-
597-static
598-struct jackctl_parameter *
599-jackctl_add_parameter(
600- JSList ** parameters_list_ptr_ptr,
601- const char * name,
602- const char * short_description,
603- const char * long_description,
604- jackctl_param_type_t type,
605- union jackctl_parameter_value * value_ptr,
606- union jackctl_parameter_value * default_value_ptr,
607- union jackctl_parameter_value value,
608- jack_driver_param_constraint_desc_t * constraint_ptr = NULL)
609-{
610- struct jackctl_parameter * parameter_ptr;
611-
612- parameter_ptr = (struct jackctl_parameter *)malloc(sizeof(struct jackctl_parameter));
613- if (parameter_ptr == NULL)
614- {
615- jack_error("Cannot allocate memory for jackctl_parameter structure.");
616- goto fail;
617- }
618-
619- parameter_ptr->name = name;
620- parameter_ptr->short_description = short_description;
621- parameter_ptr->long_description = long_description;
622- parameter_ptr->type = type;
623- parameter_ptr->is_set = false;
624-
625- if (value_ptr == NULL)
626- {
627- value_ptr = &parameter_ptr->value;
628- }
629-
630- if (default_value_ptr == NULL)
631- {
632- default_value_ptr = &parameter_ptr->default_value;
633- }
634-
635- parameter_ptr->value_ptr = value_ptr;
636- parameter_ptr->default_value_ptr = default_value_ptr;
637-
638- *value_ptr = *default_value_ptr = value;
639-
640- parameter_ptr->driver_ptr = NULL;
641- parameter_ptr->driver_parameter_ptr = NULL;
642- parameter_ptr->id = 0;
643- parameter_ptr->constraint_ptr = constraint_ptr;
644-
645- *parameters_list_ptr_ptr = jack_slist_append(*parameters_list_ptr_ptr, parameter_ptr);
646-
647- return parameter_ptr;
648-
649-fail:
650- return NULL;
651-}
652-
653-static
654-void
655-jackctl_free_driver_parameters(
656- struct jackctl_driver * driver_ptr)
657-{
658- JSList * next_node_ptr;
659-
660- while (driver_ptr->parameters)
661- {
662- next_node_ptr = driver_ptr->parameters->next;
663- free(driver_ptr->parameters->data);
664- free(driver_ptr->parameters);
665- driver_ptr->parameters = next_node_ptr;
666- }
667-
668- while (driver_ptr->set_parameters)
669- {
670- next_node_ptr = driver_ptr->set_parameters->next;
671- free(driver_ptr->set_parameters->data);
672- free(driver_ptr->set_parameters);
673- driver_ptr->set_parameters = next_node_ptr;
674- }
675-}
676-
677-static
678-bool
679-jackctl_add_driver_parameters(
680- struct jackctl_driver * driver_ptr)
681-{
682- uint32_t i;
683- union jackctl_parameter_value jackctl_value;
684- jackctl_param_type_t jackctl_type;
685- struct jackctl_parameter * parameter_ptr;
686- jack_driver_param_desc_t * descriptor_ptr;
687-
688- for (i = 0 ; i < driver_ptr->desc_ptr->nparams ; i++)
689- {
690- descriptor_ptr = driver_ptr->desc_ptr->params + i;
691-
692- switch (descriptor_ptr->type)
693- {
694- case JackDriverParamInt:
695- jackctl_type = JackParamInt;
696- jackctl_value.i = descriptor_ptr->value.i;
697- break;
698- case JackDriverParamUInt:
699- jackctl_type = JackParamUInt;
700- jackctl_value.ui = descriptor_ptr->value.ui;
701- break;
702- case JackDriverParamChar:
703- jackctl_type = JackParamChar;
704- jackctl_value.c = descriptor_ptr->value.c;
705- break;
706- case JackDriverParamString:
707- jackctl_type = JackParamString;
708- strcpy(jackctl_value.str, descriptor_ptr->value.str);
709- break;
710- case JackDriverParamBool:
711- jackctl_type = JackParamBool;
712- jackctl_value.b = descriptor_ptr->value.i;
713- break;
714- default:
715- jack_error("unknown driver parameter type %i", (int)descriptor_ptr->type);
716- assert(0);
717- goto fail;
718- }
719-
720- parameter_ptr = jackctl_add_parameter(
721- &driver_ptr->parameters,
722- descriptor_ptr->name,
723- descriptor_ptr->short_desc,
724- descriptor_ptr->long_desc,
725- jackctl_type,
726- NULL,
727- NULL,
728- jackctl_value,
729- descriptor_ptr->constraint);
730-
731- if (parameter_ptr == NULL)
732- {
733- goto fail;
734- }
735-
736- parameter_ptr->driver_ptr = driver_ptr;
737- parameter_ptr->id = descriptor_ptr->character;
738- }
739-
740- return true;
741-
742-fail:
743- jackctl_free_driver_parameters(driver_ptr);
744-
745- return false;
746-}
747-
748-static int
749-jackctl_drivers_load(
750- struct jackctl_server * server_ptr)
751-{
752- struct jackctl_driver * driver_ptr;
753- JSList *node_ptr;
754- JSList *descriptor_node_ptr;
755-
756- descriptor_node_ptr = jack_drivers_load(NULL);
757- if (descriptor_node_ptr == NULL)
758- {
759- jack_error("could not find any drivers in driver directory!");
760- return false;
761- }
762-
763- while (descriptor_node_ptr != NULL)
764- {
765- driver_ptr = (struct jackctl_driver *)malloc(sizeof(struct jackctl_driver));
766- if (driver_ptr == NULL)
767- {
768- jack_error("memory allocation of jackctl_driver structure failed.");
769- goto next;
770- }
771-
772- driver_ptr->desc_ptr = (jack_driver_desc_t *)descriptor_node_ptr->data;
773- driver_ptr->parameters = NULL;
774- driver_ptr->set_parameters = NULL;
775-
776- if (!jackctl_add_driver_parameters(driver_ptr))
777- {
778- assert(driver_ptr->parameters == NULL);
779- free(driver_ptr);
780- goto next;
781- }
782-
783- server_ptr->drivers = jack_slist_append(server_ptr->drivers, driver_ptr);
784-
785- next:
786- node_ptr = descriptor_node_ptr;
787- descriptor_node_ptr = descriptor_node_ptr->next;
788- free(node_ptr);
789- }
790-
791- return true;
792-}
793-
794-static
795-void
796-jackctl_server_free_drivers(
797- struct jackctl_server * server_ptr)
798-{
799- JSList * next_node_ptr;
800- struct jackctl_driver * driver_ptr;
801-
802- while (server_ptr->drivers)
803- {
804- next_node_ptr = server_ptr->drivers->next;
805- driver_ptr = (struct jackctl_driver *)server_ptr->drivers->data;
806-
807- jackctl_free_driver_parameters(driver_ptr);
808- free(driver_ptr->desc_ptr->params);
809- free(driver_ptr->desc_ptr);
810- free(driver_ptr);
811-
812- free(server_ptr->drivers);
813- server_ptr->drivers = next_node_ptr;
814- }
815-}
816-
817-static int
818-jackctl_internals_load(
819- struct jackctl_server * server_ptr)
820-{
821- struct jackctl_internal * internal_ptr;
822- JSList *node_ptr;
823- JSList *descriptor_node_ptr;
824-
825- descriptor_node_ptr = jack_internals_load(NULL);
826- if (descriptor_node_ptr == NULL)
827- {
828- jack_error("could not find any internals in driver directory!");
829- return false;
830- }
831-
832- while (descriptor_node_ptr != NULL)
833- {
834- internal_ptr = (struct jackctl_internal *)malloc(sizeof(struct jackctl_internal));
835- if (internal_ptr == NULL)
836- {
837- jack_error("memory allocation of jackctl_driver structure failed.");
838- goto next;
839- }
840-
841- internal_ptr->desc_ptr = (jack_driver_desc_t *)descriptor_node_ptr->data;
842- internal_ptr->parameters = NULL;
843- internal_ptr->set_parameters = NULL;
844-
845- if (!jackctl_add_driver_parameters((struct jackctl_driver *)internal_ptr))
846- {
847- assert(internal_ptr->parameters == NULL);
848- free(internal_ptr);
849- goto next;
850- }
851-
852- server_ptr->internals = jack_slist_append(server_ptr->internals, internal_ptr);
853-
854- next:
855- node_ptr = descriptor_node_ptr;
856- descriptor_node_ptr = descriptor_node_ptr->next;
857- free(node_ptr);
858- }
859-
860- return true;
861-}
862-
863-static
864-void
865-jackctl_server_free_internals(
866- struct jackctl_server * server_ptr)
867-{
868- JSList * next_node_ptr;
869- struct jackctl_internal * internal_ptr;
870-
871- while (server_ptr->internals)
872- {
873- next_node_ptr = server_ptr->internals->next;
874- internal_ptr = (struct jackctl_internal *)server_ptr->internals->data;
875-
876- jackctl_free_driver_parameters((struct jackctl_driver *)internal_ptr);
877- free(internal_ptr->desc_ptr->params);
878- free(internal_ptr->desc_ptr);
879- free(internal_ptr);
880-
881- free(server_ptr->internals);
882- server_ptr->internals = next_node_ptr;
883- }
884-}
885-
886-static
887-void
888-jackctl_server_free_parameters(
889- struct jackctl_server * server_ptr)
890-{
891- JSList * next_node_ptr;
892-
893- while (server_ptr->parameters)
894- {
895- next_node_ptr = server_ptr->parameters->next;
896- free(server_ptr->parameters->data);
897- free(server_ptr->parameters);
898- server_ptr->parameters = next_node_ptr;
899- }
900-}
901-
902-#ifdef WIN32
903-
904-static HANDLE waitEvent;
905-
906-static void do_nothing_handler(int signum)
907-{
908- printf("jack main caught signal %d\n", signum);
909- (void) signal(SIGINT, SIG_DFL);
910- SetEvent(waitEvent);
911-}
912-
913-sigset_t
914-jackctl_setup_signals(
915- unsigned int flags)
916-{
917- if ((waitEvent = CreateEvent(NULL, FALSE, FALSE, NULL)) == NULL) {
918- jack_error("CreateEvent fails err = %ld", GetLastError());
919- return 0;
920- }
921-
922- (void) signal(SIGINT, do_nothing_handler);
923- (void) signal(SIGABRT, do_nothing_handler);
924- (void) signal(SIGTERM, do_nothing_handler);
925-
926- return (sigset_t)waitEvent;
927-}
928-
929-void jackctl_wait_signals(sigset_t signals)
930-{
931- if (WaitForSingleObject(waitEvent, INFINITE) != WAIT_OBJECT_0) {
932- jack_error("WaitForSingleObject fails err = %ld", GetLastError());
933- }
934-}
935-
936-#else
937-
938-static
939-void
940-do_nothing_handler(int sig)
941-{
942- /* this is used by the child (active) process, but it never
943- gets called unless we are already shutting down after
944- another signal.
945- */
946- char buf[64];
947- snprintf (buf, sizeof(buf), "received signal %d during shutdown (ignored)\n", sig);
948-}
949-
950-EXPORT sigset_t
951-jackctl_setup_signals(
952- unsigned int flags)
953-{
954- sigset_t signals;
955- sigset_t allsignals;
956- struct sigaction action;
957- int i;
958-
959- /* ensure that we are in our own process group so that
960- kill (SIG, -pgrp) does the right thing.
961- */
962-
963- setsid();
964-
965- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
966-
967- /* what's this for?
968-
969- POSIX says that signals are delivered like this:
970-
971- * if a thread has blocked that signal, it is not
972- a candidate to receive the signal.
973- * of all threads not blocking the signal, pick
974- one at random, and deliver the signal.
975-
976- this means that a simple-minded multi-threaded program can
977- expect to get POSIX signals delivered randomly to any one
978- of its threads,
979-
980- here, we block all signals that we think we might receive
981- and want to catch. all "child" threads will inherit this
982- setting. if we create a thread that calls sigwait() on the
983- same set of signals, implicitly unblocking all those
984- signals. any of those signals that are delivered to the
985- process will be delivered to that thread, and that thread
986- alone. this makes cleanup for a signal-driven exit much
987- easier, since we know which thread is doing it and more
988- importantly, we are free to call async-unsafe functions,
989- because the code is executing in normal thread context
990- after a return from sigwait().
991- */
992-
993- sigemptyset(&signals);
994- sigaddset(&signals, SIGHUP);
995- sigaddset(&signals, SIGINT);
996- sigaddset(&signals, SIGQUIT);
997- sigaddset(&signals, SIGPIPE);
998- sigaddset(&signals, SIGTERM);
999- sigaddset(&signals, SIGUSR1);
1000- sigaddset(&signals, SIGUSR2);
1001-
1002- /* all child threads will inherit this mask unless they
1003- * explicitly reset it
1004- */
1005-
1006- pthread_sigmask(SIG_BLOCK, &signals, 0);
1007-
1008- /* install a do-nothing handler because otherwise pthreads
1009- behaviour is undefined when we enter sigwait.
1010- */
1011-
1012- sigfillset(&allsignals);
1013- action.sa_handler = do_nothing_handler;
1014- action.sa_mask = allsignals;
1015- action.sa_flags = SA_RESTART|SA_RESETHAND;
1016-
1017- for (i = 1; i < NSIG; i++)
1018- {
1019- if (sigismember (&signals, i))
1020- {
1021- sigaction(i, &action, 0);
1022- }
1023- }
1024-
1025- return signals;
1026-}
1027-
1028-EXPORT void
1029-jackctl_wait_signals(sigset_t signals)
1030-{
1031- int sig;
1032- bool waiting = true;
1033-
1034- while (waiting) {
1035- #if defined(sun) && !defined(__sun__) // SUN compiler only, to check
1036- sigwait(&signals);
1037- #else
1038- sigwait(&signals, &sig);
1039- #endif
1040- fprintf(stderr, "jack main caught signal %d\n", sig);
1041-
1042- switch (sig) {
1043- case SIGUSR1:
1044- //jack_dump_configuration(engine, 1);
1045- break;
1046- case SIGUSR2:
1047- // driver exit
1048- waiting = false;
1049- break;
1050- case SIGTTOU:
1051- break;
1052- default:
1053- waiting = false;
1054- break;
1055- }
1056- }
1057-
1058- if (sig != SIGSEGV) {
1059- // unblock signals so we can see them during shutdown.
1060- // this will help prod developers not to lose sight of
1061- // bugs that cause segfaults etc. during shutdown.
1062- sigprocmask(SIG_UNBLOCK, &signals, 0);
1063- }
1064-}
1065-#endif
1066-
1067-static
1068-jack_driver_param_constraint_desc_t *
1069-get_realtime_priority_constraint()
1070-{
1071- jack_driver_param_constraint_desc_t * constraint_ptr;
1072- int min, max;
1073-
1074- if (!jack_get_thread_realtime_priority_range(&min, &max))
1075- {
1076- return NULL;
1077- }
1078-
1079- //jack_info("realtime priority range is (%d,%d)", min, max);
1080-
1081- constraint_ptr = (jack_driver_param_constraint_desc_t *)calloc(1, sizeof(jack_driver_param_value_enum_t));
1082- if (constraint_ptr == NULL)
1083- {
1084- jack_error("Cannot allocate memory for jack_driver_param_constraint_desc_t structure.");
1085- return NULL;
1086- }
1087- constraint_ptr->flags = JACK_CONSTRAINT_FLAG_RANGE;
1088-
1089- constraint_ptr->constraint.range.min.i = min;
1090- constraint_ptr->constraint.range.max.i = max;
1091-
1092- return constraint_ptr;
1093-}
1094-
1095-EXPORT jackctl_server_t * jackctl_server_create(
1096- bool (* on_device_acquire)(const char * device_name),
1097- void (* on_device_release)(const char * device_name))
1098-{
1099- struct jackctl_server * server_ptr;
1100- union jackctl_parameter_value value;
1101-
1102- server_ptr = (struct jackctl_server *)malloc(sizeof(struct jackctl_server));
1103- if (server_ptr == NULL)
1104- {
1105- jack_error("Cannot allocate memory for jackctl_server structure.");
1106- goto fail;
1107- }
1108-
1109- server_ptr->drivers = NULL;
1110- server_ptr->internals = NULL;
1111- server_ptr->parameters = NULL;
1112- server_ptr->engine = NULL;
1113-
1114- strcpy(value.str, JACK_DEFAULT_SERVER_NAME);
1115- if (jackctl_add_parameter(
1116- &server_ptr->parameters,
1117- "name",
1118- "Server name to use.",
1119- "",
1120- JackParamString,
1121- &server_ptr->name,
1122- &server_ptr->default_name,
1123- value) == NULL)
1124- {
1125- goto fail_free_parameters;
1126- }
1127-
1128- value.b = false;
1129- if (jackctl_add_parameter(
1130- &server_ptr->parameters,
1131- "realtime",
1132- "Whether to use realtime mode.",
1133- "Use realtime scheduling. This is needed for reliable low-latency performance. On most systems, it requires JACK to run with special scheduler and memory allocation privileges, which may be obtained in several ways. On Linux you should use PAM.",
1134- JackParamBool,
1135- &server_ptr->realtime,
1136- &server_ptr->default_realtime,
1137- value) == NULL)
1138- {
1139- goto fail_free_parameters;
1140- }
1141-
1142- value.i = 10;
1143- if (jackctl_add_parameter(
1144- &server_ptr->parameters,
1145- "realtime-priority",
1146- "Scheduler priority when running in realtime mode.",
1147- "",
1148- JackParamInt,
1149- &server_ptr->realtime_priority,
1150- &server_ptr->default_realtime_priority,
1151- value,
1152- get_realtime_priority_constraint()) == NULL)
1153- {
1154- goto fail_free_parameters;
1155- }
1156-
1157- value.b = false;
1158- if (jackctl_add_parameter(
1159- &server_ptr->parameters,
1160- "temporary",
1161- "Exit once all clients have closed their connections.",
1162- "",
1163- JackParamBool,
1164- &server_ptr->temporary,
1165- &server_ptr->default_temporary,
1166- value) == NULL)
1167- {
1168- goto fail_free_parameters;
1169- }
1170-
1171- value.b = false;
1172- if (jackctl_add_parameter(
1173- &server_ptr->parameters,
1174- "verbose",
1175- "Verbose mode.",
1176- "",
1177- JackParamBool,
1178- &server_ptr->verbose,
1179- &server_ptr->default_verbose,
1180- value) == NULL)
1181- {
1182- goto fail_free_parameters;
1183- }
1184-
1185- value.i = 0;
1186- if (jackctl_add_parameter(
1187- &server_ptr->parameters,
1188- "client-timeout",
1189- "Client timeout limit in milliseconds.",
1190- "",
1191- JackParamInt,
1192- &server_ptr->client_timeout,
1193- &server_ptr->default_client_timeout,
1194- value) == NULL)
1195- {
1196- goto fail_free_parameters;
1197- }
1198-
1199- value.ui = 0;
1200- if (jackctl_add_parameter(
1201- &server_ptr->parameters,
1202- "clock-source",
1203- "Clocksource type : c(ycle) | h(pet) | s(ystem).",
1204- "",
1205- JackParamUInt,
1206- &server_ptr->clock_source,
1207- &server_ptr->default_clock_source,
1208- value) == NULL)
1209- {
1210- goto fail_free_parameters;
1211- }
1212-
1213- value.ui = PORT_NUM;
1214- if (jackctl_add_parameter(
1215- &server_ptr->parameters,
1216- "port-max",
1217- "Maximum number of ports.",
1218- "",
1219- JackParamUInt,
1220- &server_ptr->port_max,
1221- &server_ptr->default_port_max,
1222- value) == NULL)
1223- {
1224- goto fail_free_parameters;
1225- }
1226-
1227- value.b = false;
1228- if (jackctl_add_parameter(
1229- &server_ptr->parameters,
1230- "replace-registry",
1231- "Replace shared memory registry.",
1232- "",
1233- JackParamBool,
1234- &server_ptr->replace_registry,
1235- &server_ptr->default_replace_registry,
1236- value) == NULL)
1237- {
1238- goto fail_free_parameters;
1239- }
1240-
1241- value.b = false;
1242- if (jackctl_add_parameter(
1243- &server_ptr->parameters,
1244- "sync",
1245- "Use server synchronous mode.",
1246- "",
1247- JackParamBool,
1248- &server_ptr->sync,
1249- &server_ptr->default_sync,
1250- value) == NULL)
1251- {
1252- goto fail_free_parameters;
1253- }
1254-
1255- JackServerGlobals::on_device_acquire = on_device_acquire;
1256- JackServerGlobals::on_device_release = on_device_release;
1257-
1258- if (!jackctl_drivers_load(server_ptr))
1259- {
1260- goto fail_free_parameters;
1261- }
1262-
1263- /* Allowed to fail */
1264- jackctl_internals_load(server_ptr);
1265-
1266- return server_ptr;
1267-
1268-fail_free_parameters:
1269- jackctl_server_free_parameters(server_ptr);
1270-
1271- free(server_ptr);
1272-
1273-fail:
1274- return NULL;
1275-}
1276-
1277-EXPORT void jackctl_server_destroy(jackctl_server *server_ptr)
1278-{
1279- jackctl_server_free_drivers(server_ptr);
1280- jackctl_server_free_internals(server_ptr);
1281- jackctl_server_free_parameters(server_ptr);
1282- free(server_ptr);
1283-}
1284-
1285-EXPORT const JSList * jackctl_server_get_drivers_list(jackctl_server *server_ptr)
1286-{
1287- return server_ptr->drivers;
1288-}
1289-
1290-EXPORT bool jackctl_server_stop(jackctl_server *server_ptr)
1291-{
1292- server_ptr->engine->Stop();
1293- return true;
1294-}
1295-
1296-EXPORT bool jackctl_server_close(jackctl_server *server_ptr)
1297-{
1298- server_ptr->engine->Close();
1299- delete server_ptr->engine;
1300-
1301- /* clean up shared memory and files from this server instance */
1302- jack_log("cleaning up shared memory");
1303-
1304- jack_cleanup_shm();
1305-
1306- jack_log("cleaning up files");
1307-
1308- JackTools::CleanupFiles(server_ptr->name.str);
1309-
1310- jack_log("unregistering server `%s'", server_ptr->name.str);
1311-
1312- jack_unregister_server(server_ptr->name.str);
1313-
1314- server_ptr->engine = NULL;
1315-
1316- return true;
1317-}
1318-
1319-EXPORT const JSList * jackctl_server_get_parameters(jackctl_server *server_ptr)
1320-{
1321- return server_ptr->parameters;
1322-}
1323-
1324-EXPORT bool
1325-jackctl_server_open(
1326- jackctl_server *server_ptr,
1327- jackctl_driver *driver_ptr)
1328-{
1329- int rc;
1330-
1331- rc = jack_register_server(server_ptr->name.str, server_ptr->replace_registry.b);
1332- switch (rc)
1333- {
1334- case EEXIST:
1335- jack_error("`%s' server already active", server_ptr->name.str);
1336- goto fail;
1337- case ENOSPC:
1338- jack_error("too many servers already active");
1339- goto fail;
1340- case ENOMEM:
1341- jack_error("no access to shm registry");
1342- goto fail;
1343- }
1344-
1345- jack_log("server `%s' registered", server_ptr->name.str);
1346-
1347- /* clean up shared memory and files from any previous
1348- * instance of this server name */
1349- jack_cleanup_shm();
1350- JackTools::CleanupFiles(server_ptr->name.str);
1351-
1352- if (!server_ptr->realtime.b && server_ptr->client_timeout.i == 0)
1353- server_ptr->client_timeout.i = 500; /* 0.5 sec; usable when non realtime. */
1354-
1355- /* check port max value before allocating server */
1356- if (server_ptr->port_max.ui > PORT_NUM_MAX) {
1357- jack_error("JACK server started with too much ports %d (when port max can be %d)", server_ptr->port_max.ui, PORT_NUM_MAX);
1358- goto fail;
1359- }
1360-
1361- /* get the engine/driver started */
1362- server_ptr->engine = new JackServer(
1363- server_ptr->sync.b,
1364- server_ptr->temporary.b,
1365- server_ptr->client_timeout.i,
1366- server_ptr->realtime.b,
1367- server_ptr->realtime_priority.i,
1368- server_ptr->port_max.ui,
1369- server_ptr->verbose.b,
1370- (jack_timer_type_t)server_ptr->clock_source.ui,
1371- server_ptr->name.str);
1372- if (server_ptr->engine == NULL)
1373- {
1374- jack_error("Failed to create new JackServer object");
1375- goto fail_unregister;
1376- }
1377-
1378- rc = server_ptr->engine->Open(driver_ptr->desc_ptr, driver_ptr->set_parameters);
1379- if (rc < 0)
1380- {
1381- jack_error("JackServer::Open() failed with %d", rc);
1382- goto fail_delete;
1383- }
1384-
1385- return true;
1386-
1387-fail_delete:
1388- delete server_ptr->engine;
1389- server_ptr->engine = NULL;
1390-
1391-fail_unregister:
1392- jack_log("cleaning up shared memory");
1393-
1394- jack_cleanup_shm();
1395-
1396- jack_log("cleaning up files");
1397-
1398- JackTools::CleanupFiles(server_ptr->name.str);
1399-
1400- jack_log("unregistering server `%s'", server_ptr->name.str);
1401-
1402- jack_unregister_server(server_ptr->name.str);
1403-
1404-fail:
1405- return false;
1406-}
1407-
1408-EXPORT bool
1409-jackctl_server_start(
1410- jackctl_server *server_ptr)
1411-{
1412- int rc = server_ptr->engine->Start();
1413- bool result = rc >= 0;
1414- if (! result)
1415- {
1416- jack_error("JackServer::Start() failed with %d", rc);
1417- }
1418- return result;
1419-}
1420-
1421-EXPORT const char * jackctl_driver_get_name(jackctl_driver *driver_ptr)
1422-{
1423- return driver_ptr->desc_ptr->name;
1424-}
1425-
1426-EXPORT const JSList * jackctl_driver_get_parameters(jackctl_driver *driver_ptr)
1427-{
1428- return driver_ptr->parameters;
1429-}
1430-
1431-EXPORT jack_driver_desc_t * jackctl_driver_get_desc(jackctl_driver *driver_ptr)
1432-{
1433- return driver_ptr->desc_ptr;
1434-}
1435-
1436-EXPORT const char * jackctl_parameter_get_name(jackctl_parameter *parameter_ptr)
1437-{
1438- return parameter_ptr->name;
1439-}
1440-
1441-EXPORT const char * jackctl_parameter_get_short_description(jackctl_parameter *parameter_ptr)
1442-{
1443- return parameter_ptr->short_description;
1444-}
1445-
1446-EXPORT const char * jackctl_parameter_get_long_description(jackctl_parameter *parameter_ptr)
1447-{
1448- return parameter_ptr->long_description;
1449-}
1450-
1451-EXPORT bool jackctl_parameter_has_range_constraint(jackctl_parameter *parameter_ptr)
1452-{
1453- return parameter_ptr->constraint_ptr != NULL && (parameter_ptr->constraint_ptr->flags & JACK_CONSTRAINT_FLAG_RANGE) != 0;
1454-}
1455-
1456-EXPORT bool jackctl_parameter_has_enum_constraint(jackctl_parameter *parameter_ptr)
1457-{
1458- return parameter_ptr->constraint_ptr != NULL && (parameter_ptr->constraint_ptr->flags & JACK_CONSTRAINT_FLAG_RANGE) == 0;
1459-}
1460-
1461-EXPORT uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter *parameter_ptr)
1462-{
1463- if (!jackctl_parameter_has_enum_constraint(parameter_ptr))
1464- {
1465- return 0;
1466- }
1467-
1468- return parameter_ptr->constraint_ptr->constraint.enumeration.count;
1469-}
1470-
1471-EXPORT union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter *parameter_ptr, uint32_t index)
1472-{
1473- jack_driver_param_value_t * value_ptr;
1474- union jackctl_parameter_value jackctl_value;
1475-
1476- value_ptr = &parameter_ptr->constraint_ptr->constraint.enumeration.possible_values_array[index].value;
1477-
1478- switch (parameter_ptr->type)
1479- {
1480- case JackParamInt:
1481- jackctl_value.i = value_ptr->i;
1482- break;
1483- case JackParamUInt:
1484- jackctl_value.ui = value_ptr->ui;
1485- break;
1486- case JackParamChar:
1487- jackctl_value.c = value_ptr->c;
1488- break;
1489- case JackParamString:
1490- strcpy(jackctl_value.str, value_ptr->str);
1491- break;
1492- default:
1493- jack_error("bad driver parameter type %i (enum constraint)", (int)parameter_ptr->type);
1494- assert(0);
1495- }
1496-
1497- return jackctl_value;
1498-}
1499-
1500-EXPORT const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter *parameter_ptr, uint32_t index)
1501-{
1502- return parameter_ptr->constraint_ptr->constraint.enumeration.possible_values_array[index].short_desc;
1503-}
1504-
1505-EXPORT void jackctl_parameter_get_range_constraint(jackctl_parameter *parameter_ptr, union jackctl_parameter_value * min_ptr, union jackctl_parameter_value * max_ptr)
1506-{
1507- switch (parameter_ptr->type)
1508- {
1509- case JackParamInt:
1510- min_ptr->i = parameter_ptr->constraint_ptr->constraint.range.min.i;
1511- max_ptr->i = parameter_ptr->constraint_ptr->constraint.range.max.i;
1512- return;
1513- case JackParamUInt:
1514- min_ptr->ui = parameter_ptr->constraint_ptr->constraint.range.min.ui;
1515- max_ptr->ui = parameter_ptr->constraint_ptr->constraint.range.max.ui;
1516- return;
1517- default:
1518- jack_error("bad driver parameter type %i (range constraint)", (int)parameter_ptr->type);
1519- assert(0);
1520- }
1521-}
1522-
1523-EXPORT bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t * parameter_ptr)
1524-{
1525- return parameter_ptr->constraint_ptr != NULL && (parameter_ptr->constraint_ptr->flags & JACK_CONSTRAINT_FLAG_STRICT) != 0;
1526-}
1527-
1528-EXPORT bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t * parameter_ptr)
1529-{
1530- return parameter_ptr->constraint_ptr != NULL && (parameter_ptr->constraint_ptr->flags & JACK_CONSTRAINT_FLAG_FAKE_VALUE) != 0;
1531-}
1532-
1533-EXPORT jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter *parameter_ptr)
1534-{
1535- return parameter_ptr->type;
1536-}
1537-
1538-EXPORT char jackctl_parameter_get_id(jackctl_parameter_t * parameter_ptr)
1539-{
1540- return parameter_ptr->id;
1541-}
1542-
1543-EXPORT bool jackctl_parameter_is_set(jackctl_parameter *parameter_ptr)
1544-{
1545- return parameter_ptr->is_set;
1546-}
1547-
1548-EXPORT union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter *parameter_ptr)
1549-{
1550- return *parameter_ptr->value_ptr;
1551-}
1552-
1553-EXPORT bool jackctl_parameter_reset(jackctl_parameter *parameter_ptr)
1554-{
1555- if (!parameter_ptr->is_set)
1556- {
1557- return true;
1558- }
1559-
1560- parameter_ptr->is_set = false;
1561-
1562- *parameter_ptr->value_ptr = *parameter_ptr->default_value_ptr;
1563-
1564- return true;
1565-}
1566-
1567-EXPORT bool jackctl_parameter_set_value(jackctl_parameter *parameter_ptr, const union jackctl_parameter_value * value_ptr)
1568-{
1569- bool new_driver_parameter;
1570-
1571- /* for driver parameters, set the parameter by adding jack_driver_param_t in the set_parameters list */
1572- if (parameter_ptr->driver_ptr != NULL)
1573- {
1574-/* jack_info("setting driver parameter %p ...", parameter_ptr); */
1575- new_driver_parameter = parameter_ptr->driver_parameter_ptr == NULL;
1576- if (new_driver_parameter)
1577- {
1578-/* jack_info("new driver parameter..."); */
1579- parameter_ptr->driver_parameter_ptr = (jack_driver_param_t *)malloc(sizeof(jack_driver_param_t));
1580- if (parameter_ptr->driver_parameter_ptr == NULL)
1581- {
1582- jack_error ("Allocation of jack_driver_param_t structure failed");
1583- return false;
1584- }
1585-
1586- parameter_ptr->driver_parameter_ptr->character = parameter_ptr->id;
1587- parameter_ptr->driver_ptr->set_parameters = jack_slist_append(parameter_ptr->driver_ptr->set_parameters, parameter_ptr->driver_parameter_ptr);
1588- }
1589-
1590- switch (parameter_ptr->type)
1591- {
1592- case JackParamInt:
1593- parameter_ptr->driver_parameter_ptr->value.i = value_ptr->i;
1594- break;
1595- case JackParamUInt:
1596- parameter_ptr->driver_parameter_ptr->value.ui = value_ptr->ui;
1597- break;
1598- case JackParamChar:
1599- parameter_ptr->driver_parameter_ptr->value.c = value_ptr->c;
1600- break;
1601- case JackParamString:
1602- strcpy(parameter_ptr->driver_parameter_ptr->value.str, value_ptr->str);
1603- break;
1604- case JackParamBool:
1605- parameter_ptr->driver_parameter_ptr->value.i = value_ptr->b;
1606- break;
1607- default:
1608- jack_error("unknown parameter type %i", (int)parameter_ptr->type);
1609- assert(0);
1610-
1611- if (new_driver_parameter)
1612- {
1613- parameter_ptr->driver_ptr->set_parameters = jack_slist_remove(parameter_ptr->driver_ptr->set_parameters, parameter_ptr->driver_parameter_ptr);
1614- }
1615-
1616- return false;
1617- }
1618- }
1619-
1620- parameter_ptr->is_set = true;
1621- *parameter_ptr->value_ptr = *value_ptr;
1622-
1623- return true;
1624-}
1625-
1626-EXPORT union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter *parameter_ptr)
1627-{
1628- return *parameter_ptr->default_value_ptr;
1629-}
1630-
1631-// Internals clients
1632-
1633-EXPORT const JSList * jackctl_server_get_internals_list(jackctl_server *server_ptr)
1634-{
1635- return server_ptr->internals;
1636-}
1637-
1638-EXPORT const char * jackctl_internal_get_name(jackctl_internal *internal_ptr)
1639-{
1640- return internal_ptr->desc_ptr->name;
1641-}
1642-
1643-EXPORT const JSList * jackctl_internal_get_parameters(jackctl_internal *internal_ptr)
1644-{
1645- return internal_ptr->parameters;
1646-}
1647-
1648-EXPORT bool jackctl_server_load_internal(
1649- jackctl_server * server_ptr,
1650- jackctl_internal * internal)
1651-{
1652- int status;
1653- if (server_ptr->engine != NULL) {
1654- server_ptr->engine->InternalClientLoad2(internal->desc_ptr->name, internal->desc_ptr->name, internal->set_parameters, JackNullOption, &internal->refnum, -1, &status);
1655- return (internal->refnum > 0);
1656- } else {
1657- return false;
1658- }
1659-}
1660-
1661-EXPORT bool jackctl_server_unload_internal(
1662- jackctl_server * server_ptr,
1663- jackctl_internal * internal)
1664-{
1665- int status;
1666- if (server_ptr->engine != NULL && internal->refnum > 0) {
1667- // Client object is internally kept in JackEngine, and will be desallocated in InternalClientUnload
1668- return ((server_ptr->engine->GetEngine()->InternalClientUnload(internal->refnum, &status)) == 0);
1669- } else {
1670- return false;
1671- }
1672-}
1673-
1674-EXPORT bool jackctl_server_add_slave(jackctl_server * server_ptr, jackctl_driver * driver_ptr)
1675-{
1676- if (server_ptr->engine != NULL) {
1677- if (server_ptr->engine->IsRunning()) {
1678- jack_error("cannot add a slave in a running server");
1679- return false;
1680- } else {
1681- driver_ptr->info = server_ptr->engine->AddSlave(driver_ptr->desc_ptr, driver_ptr->set_parameters);
1682- return (driver_ptr->info != 0);
1683- }
1684- } else {
1685- return false;
1686- }
1687-}
1688-
1689-EXPORT bool jackctl_server_remove_slave(jackctl_server * server_ptr, jackctl_driver * driver_ptr)
1690-{
1691- if (server_ptr->engine != NULL) {
1692- if (server_ptr->engine->IsRunning()) {
1693- jack_error("cannot remove a slave from a running server");
1694- return false;
1695- } else {
1696- server_ptr->engine->RemoveSlave(driver_ptr->info);
1697- delete driver_ptr->info;
1698- return true;
1699- }
1700- } else {
1701- return false;
1702- }
1703-}
1704-
1705-EXPORT bool jackctl_server_switch_master(jackctl_server * server_ptr, jackctl_driver * driver_ptr)
1706-{
1707- if (server_ptr->engine != NULL) {
1708- return (server_ptr->engine->SwitchMaster(driver_ptr->desc_ptr, driver_ptr->set_parameters) == 0);
1709- } else {
1710- return false;
1711- }
1712-}
1713-
1714
1715=== removed file '.pc/no-selfconnect.patch/common/JackEngine.cpp'
1716--- .pc/no-selfconnect.patch/common/JackEngine.cpp 2011-03-31 13:54:50 +0000
1717+++ .pc/no-selfconnect.patch/common/JackEngine.cpp 1970-01-01 00:00:00 +0000
1718@@ -1,1084 +0,0 @@
1719-/*
1720-Copyright (C) 2004-2008 Grame
1721-
1722-This program is free software; you can redistribute it and/or modify
1723-it under the terms of the GNU General Public License as published by
1724-the Free Software Foundation; either version 2 of the License, or
1725-(at your option) any later version.
1726-
1727-This program is distributed in the hope that it will be useful,
1728-but WITHOUT ANY WARRANTY; without even the implied warranty of
1729-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1730-GNU General Public License for more details.
1731-
1732-You should have received a copy of the GNU General Public License
1733-along with this program; if not, write to the Free Software
1734-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1735-
1736-*/
1737-
1738-#include <iostream>
1739-#include <fstream>
1740-#include <set>
1741-#include <assert.h>
1742-
1743-#include "JackSystemDeps.h"
1744-#include "JackLockedEngine.h"
1745-#include "JackExternalClient.h"
1746-#include "JackInternalClient.h"
1747-#include "JackEngineControl.h"
1748-#include "JackClientControl.h"
1749-#include "JackServerGlobals.h"
1750-#include "JackGlobals.h"
1751-#include "JackChannel.h"
1752-#include "JackError.h"
1753-
1754-namespace Jack
1755-{
1756-
1757-JackEngine::JackEngine(JackGraphManager* manager,
1758- JackSynchro* table,
1759- JackEngineControl* control)
1760-{
1761- fGraphManager = manager;
1762- fSynchroTable = table;
1763- fEngineControl = control;
1764- for (int i = 0; i < CLIENT_NUM; i++)
1765- fClientTable[i] = NULL;
1766- fLastSwitchUsecs = 0;
1767- fMaxUUID = 0;
1768- fSessionPendingReplies = 0;
1769- fSessionTransaction = NULL;
1770- fSessionResult = NULL;
1771-}
1772-
1773-JackEngine::~JackEngine()
1774-{}
1775-
1776-int JackEngine::Open()
1777-{
1778- jack_log("JackEngine::Open");
1779-
1780- // Open audio thread => request thread communication channel
1781- if (fChannel.Open(fEngineControl->fServerName) < 0) {
1782- jack_error("Cannot connect to server");
1783- return -1;
1784- } else {
1785- return 0;
1786- }
1787-}
1788-
1789-int JackEngine::Close()
1790-{
1791- jack_log("JackEngine::Close");
1792- fChannel.Close();
1793-
1794- // Close remaining clients (RT is stopped)
1795- for (int i = fEngineControl->fDriverNum; i < CLIENT_NUM; i++) {
1796- if (JackLoadableInternalClient* loadable_client = dynamic_cast<JackLoadableInternalClient*>(fClientTable[i])) {
1797- jack_log("JackEngine::Close loadable client = %s", loadable_client->GetClientControl()->fName);
1798- loadable_client->Close();
1799- // Close does not delete the pointer for internal clients
1800- fClientTable[i] = NULL;
1801- delete loadable_client;
1802- } else if (JackExternalClient* external_client = dynamic_cast<JackExternalClient*>(fClientTable[i])) {
1803- jack_log("JackEngine::Close external client = %s", external_client->GetClientControl()->fName);
1804- external_client->Close();
1805- // Close deletes the pointer for external clients
1806- fClientTable[i] = NULL;
1807- }
1808- }
1809-
1810- return 0;
1811-}
1812-
1813-void JackEngine::NotifyQuit()
1814-{
1815- fChannel.NotifyQuit();
1816-}
1817-
1818-//-----------------------------
1819-// Client ressource management
1820-//-----------------------------
1821-
1822-int JackEngine::AllocateRefnum()
1823-{
1824- for (int i = 0; i < CLIENT_NUM; i++) {
1825- if (!fClientTable[i]) {
1826- jack_log("JackEngine::AllocateRefNum ref = %ld", i);
1827- return i;
1828- }
1829- }
1830- return -1;
1831-}
1832-
1833-void JackEngine::ReleaseRefnum(int ref)
1834-{
1835- fClientTable[ref] = NULL;
1836-
1837- if (fEngineControl->fTemporary) {
1838- int i;
1839- for (i = fEngineControl->fDriverNum; i < CLIENT_NUM; i++) {
1840- if (fClientTable[i])
1841- break;
1842- }
1843- if (i == CLIENT_NUM) {
1844- // last client and temporay case: quit the server
1845- jack_log("JackEngine::ReleaseRefnum server quit");
1846- fEngineControl->fTemporary = false;
1847- throw JackTemporaryException();
1848- }
1849- }
1850-}
1851-
1852-//------------------
1853-// Graph management
1854-//------------------
1855-
1856-void JackEngine::ProcessNext(jack_time_t cur_cycle_begin)
1857-{
1858- fLastSwitchUsecs = cur_cycle_begin;
1859- if (fGraphManager->RunNextGraph()) { // True if the graph actually switched to a new state
1860- fChannel.Notify(ALL_CLIENTS, kGraphOrderCallback, 0);
1861- //NotifyGraphReorder();
1862- }
1863- fSignal.Signal(); // Signal for threads waiting for next cycle
1864-}
1865-
1866-void JackEngine::ProcessCurrent(jack_time_t cur_cycle_begin)
1867-{
1868- if (cur_cycle_begin < fLastSwitchUsecs + 2 * fEngineControl->fPeriodUsecs) // Signal XRun only for the first failing cycle
1869- CheckXRun(cur_cycle_begin);
1870- fGraphManager->RunCurrentGraph();
1871-}
1872-
1873-bool JackEngine::Process(jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end)
1874-{
1875- bool res = true;
1876-
1877- // Cycle begin
1878- fEngineControl->CycleBegin(fClientTable, fGraphManager, cur_cycle_begin, prev_cycle_end);
1879-
1880- // Graph
1881- if (fGraphManager->IsFinishedGraph()) {
1882- ProcessNext(cur_cycle_begin);
1883- res = true;
1884- } else {
1885- jack_log("Process: graph not finished!");
1886- if (cur_cycle_begin > fLastSwitchUsecs + fEngineControl->fTimeOutUsecs) {
1887- jack_log("Process: switch to next state delta = %ld", long(cur_cycle_begin - fLastSwitchUsecs));
1888- ProcessNext(cur_cycle_begin);
1889- res = true;
1890- } else {
1891- jack_log("Process: waiting to switch delta = %ld", long(cur_cycle_begin - fLastSwitchUsecs));
1892- ProcessCurrent(cur_cycle_begin);
1893- res = false;
1894- }
1895- }
1896-
1897- // Cycle end
1898- fEngineControl->CycleEnd(fClientTable);
1899- return res;
1900-}
1901-
1902-/*
1903-Client that finish *after* the callback date are considered late even if their output buffers may have been
1904-correctly mixed in the time window: callbackUsecs <==> Read <==> Write.
1905-*/
1906-
1907-void JackEngine::CheckXRun(jack_time_t callback_usecs) // REVOIR les conditions de fin
1908-{
1909- for (int i = fEngineControl->fDriverNum; i < CLIENT_NUM; i++) {
1910- JackClientInterface* client = fClientTable[i];
1911- if (client && client->GetClientControl()->fActive) {
1912- JackClientTiming* timing = fGraphManager->GetClientTiming(i);
1913- jack_client_state_t status = timing->fStatus;
1914- jack_time_t finished_date = timing->fFinishedAt;
1915-
1916- if (status != NotTriggered && status != Finished) {
1917- jack_error("JackEngine::XRun: client = %s was not run: state = %ld", client->GetClientControl()->fName, status);
1918- fChannel.Notify(ALL_CLIENTS, kXRunCallback, 0); // Notify all clients
1919- //NotifyXRun(ALL_CLIENTS);
1920- }
1921-
1922- if (status == Finished && (long)(finished_date - callback_usecs) > 0) {
1923- jack_error("JackEngine::XRun: client %s finished after current callback", client->GetClientControl()->fName);
1924- fChannel.Notify(ALL_CLIENTS, kXRunCallback, 0); // Notify all clients
1925- //NotifyXRun(ALL_CLIENTS);
1926- }
1927- }
1928- }
1929-}
1930-
1931-int JackEngine::ComputeTotalLatencies()
1932-{
1933- std::vector<jack_int_t> sorted;
1934- std::vector<jack_int_t>::iterator it;
1935- std::vector<jack_int_t>::reverse_iterator rit;
1936-
1937- fGraphManager->TopologicalSort(sorted);
1938-
1939- /* iterate over all clients in graph order, and emit
1940- * capture latency callback.
1941- */
1942-
1943- for (it = sorted.begin(); it != sorted.end(); it++) {
1944- NotifyClient(*it, kLatencyCallback, true, "", 0, 0);
1945- }
1946-
1947- /* now issue playback latency callbacks in reverse graph order.
1948- */
1949- for (rit = sorted.rbegin(); rit != sorted.rend(); rit++) {
1950- NotifyClient(*rit, kLatencyCallback, true, "", 1, 0);
1951- }
1952-
1953- return 0;
1954-}
1955-
1956-//---------------
1957-// Notifications
1958-//---------------
1959-
1960-void JackEngine::NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2)
1961-{
1962- JackClientInterface* client = fClientTable[refnum];
1963-
1964- // The client may be notified by the RT thread while closing
1965- if (client) {
1966-
1967- if (client->GetClientControl()->fCallback[event]) {
1968- /*
1969- Important for internal clients : unlock before calling the notification callbacks.
1970- */
1971- bool res = fMutex.Unlock();
1972- if (client->ClientNotify(refnum, client->GetClientControl()->fName, event, sync, message, value1, value2) < 0)
1973- jack_error("NotifyClient fails name = %s event = %ld val1 = %ld val2 = %ld", client->GetClientControl()->fName, event, value1, value2);
1974- if (res)
1975- fMutex.Lock();
1976-
1977- } else {
1978- jack_log("JackEngine::NotifyClient: no callback for event = %ld", event);
1979- }
1980- }
1981-}
1982-
1983-void JackEngine::NotifyClients(int event, int sync, const char* message, int value1, int value2)
1984-{
1985- for (int i = 0; i < CLIENT_NUM; i++) {
1986- NotifyClient(i, event, sync, message, value1, value2);
1987- }
1988-}
1989-
1990-int JackEngine::NotifyAddClient(JackClientInterface* new_client, const char* name, int refnum)
1991-{
1992- jack_log("JackEngine::NotifyAddClient: name = %s", name);
1993- // Notify existing clients of the new client and new client of existing clients.
1994- for (int i = 0; i < CLIENT_NUM; i++) {
1995- JackClientInterface* old_client = fClientTable[i];
1996- if (old_client) {
1997- if (old_client->ClientNotify(refnum, name, kAddClient, true, "", 0, 0) < 0) {
1998- jack_error("NotifyAddClient old_client fails name = %s", old_client->GetClientControl()->fName);
1999- return -1;
2000- }
2001- if (new_client->ClientNotify(i, old_client->GetClientControl()->fName, kAddClient, true, "", 0, 0) < 0) {
2002- jack_error("NotifyAddClient new_client fails name = %s", name);
2003- return -1;
2004- }
2005- }
2006- }
2007-
2008- return 0;
2009-}
2010-
2011-void JackEngine::NotifyRemoveClient(const char* name, int refnum)
2012-{
2013- // Notify existing clients (including the one beeing suppressed) of the removed client
2014- for (int i = 0; i < CLIENT_NUM; i++) {
2015- JackClientInterface* client = fClientTable[i];
2016- if (client) {
2017- client->ClientNotify(refnum, name, kRemoveClient, true, "",0, 0);
2018- }
2019- }
2020-}
2021-
2022-// Coming from the driver
2023-void JackEngine::NotifyXRun(jack_time_t callback_usecs, float delayed_usecs)
2024-{
2025- // Use the audio thread => request thread communication channel
2026- fEngineControl->NotifyXRun(callback_usecs, delayed_usecs);
2027- fChannel.Notify(ALL_CLIENTS, kXRunCallback, 0);
2028- //NotifyXRun(ALL_CLIENTS);
2029-}
2030-
2031-void JackEngine::NotifyXRun(int refnum)
2032-{
2033- if (refnum == ALL_CLIENTS) {
2034- NotifyClients(kXRunCallback, false, "", 0, 0);
2035- } else {
2036- NotifyClient(refnum, kXRunCallback, false, "", 0, 0);
2037- }
2038-}
2039-
2040-void JackEngine::NotifyGraphReorder()
2041-{
2042- NotifyClients(kGraphOrderCallback, false, "", 0, 0);
2043- ComputeTotalLatencies();
2044-}
2045-
2046-void JackEngine::NotifyBufferSize(jack_nframes_t buffer_size)
2047-{
2048- NotifyClients(kBufferSizeCallback, true, "", buffer_size, 0);
2049-}
2050-
2051-void JackEngine::NotifySampleRate(jack_nframes_t sample_rate)
2052-{
2053- NotifyClients(kSampleRateCallback, true, "", sample_rate, 0);
2054-}
2055-
2056-void JackEngine::NotifyFailure(int code, const char* reason)
2057-{
2058- NotifyClients(kShutDownCallback, false, reason, code, 0);
2059-}
2060-
2061-void JackEngine::NotifyFreewheel(bool onoff)
2062-{
2063- if (onoff) {
2064- // Save RT state
2065- fEngineControl->fSavedRealTime = fEngineControl->fRealTime;
2066- fEngineControl->fRealTime = false;
2067- } else {
2068- // Restore RT state
2069- fEngineControl->fRealTime = fEngineControl->fSavedRealTime;
2070- fEngineControl->fSavedRealTime = false;
2071- }
2072- NotifyClients((onoff ? kStartFreewheelCallback : kStopFreewheelCallback), true, "", 0, 0);
2073-}
2074-
2075-void JackEngine::NotifyPortRegistation(jack_port_id_t port_index, bool onoff)
2076-{
2077- NotifyClients((onoff ? kPortRegistrationOnCallback : kPortRegistrationOffCallback), false, "", port_index, 0);
2078-}
2079-
2080-void JackEngine::NotifyPortRename(jack_port_id_t port, const char* old_name)
2081-{
2082- NotifyClients(kPortRenameCallback, false, old_name, port, 0);
2083-}
2084-
2085-void JackEngine::NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff)
2086-{
2087- NotifyClients((onoff ? kPortConnectCallback : kPortDisconnectCallback), false, "", src, dst);
2088-}
2089-
2090-void JackEngine::NotifyActivate(int refnum)
2091-{
2092- NotifyClient(refnum, kActivateClient, true, "", 0, 0);
2093-}
2094-
2095-//----------------------------
2096-// Loadable client management
2097-//----------------------------
2098-
2099-int JackEngine::GetInternalClientName(int refnum, char* name_res)
2100-{
2101- JackClientInterface* client = fClientTable[refnum];
2102- strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE);
2103- return 0;
2104-}
2105-
2106-int JackEngine::InternalClientHandle(const char* client_name, int* status, int* int_ref)
2107-{
2108- // Clear status
2109- *status = 0;
2110-
2111- for (int i = 0; i < CLIENT_NUM; i++) {
2112- JackClientInterface* client = fClientTable[i];
2113- if (client && dynamic_cast<JackLoadableInternalClient*>(client) && (strcmp(client->GetClientControl()->fName, client_name) == 0)) {
2114- jack_log("InternalClientHandle found client name = %s ref = %ld", client_name, i);
2115- *int_ref = i;
2116- return 0;
2117- }
2118- }
2119-
2120- *status |= (JackNoSuchClient | JackFailure);
2121- return -1;
2122-}
2123-
2124-int JackEngine::InternalClientUnload(int refnum, int* status)
2125-{
2126- JackClientInterface* client = fClientTable[refnum];
2127- if (client) {
2128- int res = client->Close();
2129- delete client;
2130- *status = 0;
2131- return res;
2132- } else {
2133- *status = (JackNoSuchClient | JackFailure);
2134- return -1;
2135- }
2136-}
2137-
2138-//-------------------
2139-// Client management
2140-//-------------------
2141-
2142-int JackEngine::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status)
2143-{
2144- // Clear status
2145- *status = 0;
2146- strcpy(name_res, name);
2147-
2148- jack_log("Check protocol client %ld server = %ld", protocol, JACK_PROTOCOL_VERSION);
2149-
2150- if (protocol != JACK_PROTOCOL_VERSION) {
2151- *status |= (JackFailure | JackVersionError);
2152- jack_error("JACK protocol mismatch (%d vs %d)", protocol, JACK_PROTOCOL_VERSION);
2153- return -1;
2154- }
2155-
2156- std::map<int,std::string>::iterator res = fReservationMap.find(uuid);
2157-
2158- if (res != fReservationMap.end()) {
2159- strncpy(name_res, res->second.c_str(), JACK_CLIENT_NAME_SIZE);
2160- } else if (ClientCheckName(name)) {
2161-
2162- *status |= JackNameNotUnique;
2163-
2164- if (options & JackUseExactName) {
2165- jack_error("cannot create new client; %s already exists", name);
2166- *status |= JackFailure;
2167- return -1;
2168- }
2169-
2170- if (GenerateUniqueName(name_res)) {
2171- *status |= JackFailure;
2172- return -1;
2173- }
2174- }
2175-
2176- return 0;
2177-}
2178-
2179-bool JackEngine::GenerateUniqueName(char* name)
2180-{
2181- int tens, ones;
2182- int length = strlen(name);
2183-
2184- if (length > JACK_CLIENT_NAME_SIZE - 4) {
2185- jack_error("%s exists and is too long to make unique", name);
2186- return true; /* failure */
2187- }
2188-
2189- /* generate a unique name by appending "-01".."-99" */
2190- name[length++] = '-';
2191- tens = length++;
2192- ones = length++;
2193- name[tens] = '0';
2194- name[ones] = '1';
2195- name[length] = '\0';
2196-
2197- while (ClientCheckName(name)) {
2198- if (name[ones] == '9') {
2199- if (name[tens] == '9') {
2200- jack_error("client %s has 99 extra instances already", name);
2201- return true; /* give up */
2202- }
2203- name[tens]++;
2204- name[ones] = '0';
2205- } else {
2206- name[ones]++;
2207- }
2208- }
2209- return false;
2210-}
2211-
2212-bool JackEngine::ClientCheckName(const char* name)
2213-{
2214- for (int i = 0; i < CLIENT_NUM; i++) {
2215- JackClientInterface* client = fClientTable[i];
2216- if (client && (strcmp(client->GetClientControl()->fName, name) == 0))
2217- return true;
2218- }
2219-
2220- for (std::map<int,std::string>::iterator i = fReservationMap.begin(); i != fReservationMap.end(); i++) {
2221- if (i->second == name)
2222- return true;
2223- }
2224-
2225- return false;
2226-}
2227-
2228-int JackEngine::GetNewUUID()
2229-{
2230- return fMaxUUID++;
2231-}
2232-
2233-void JackEngine::EnsureUUID(int uuid)
2234-{
2235- if (uuid > fMaxUUID)
2236- fMaxUUID = uuid+1;
2237-
2238- for (int i = 0; i < CLIENT_NUM; i++) {
2239- JackClientInterface* client = fClientTable[i];
2240- if (client && (client->GetClientControl()->fSessionID == uuid)) {
2241- client->GetClientControl()->fSessionID = GetNewUUID();
2242- }
2243- }
2244-}
2245-
2246-int JackEngine::GetClientPID(const char* name)
2247-{
2248- for (int i = 0; i < CLIENT_NUM; i++) {
2249- JackClientInterface* client = fClientTable[i];
2250- if (client && (strcmp(client->GetClientControl()->fName, name) == 0))
2251- return client->GetClientControl()->fPID;
2252- }
2253-
2254- return 0;
2255-}
2256-
2257-int JackEngine::GetClientRefNum(const char* name)
2258-{
2259- for (int i = 0; i < CLIENT_NUM; i++) {
2260- JackClientInterface* client = fClientTable[i];
2261- if (client && (strcmp(client->GetClientControl()->fName, name) == 0))
2262- return client->GetClientControl()->fRefNum;
2263- }
2264-
2265- return -1;
2266-}
2267-
2268-// Used for external clients
2269-int JackEngine::ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
2270-{
2271- char real_name[JACK_CLIENT_NAME_SIZE + 1];
2272-
2273- if (uuid < 0) {
2274- uuid = GetNewUUID();
2275- strncpy(real_name, name, JACK_CLIENT_NAME_SIZE);
2276- } else {
2277- std::map<int, std::string>::iterator res = fReservationMap.find(uuid);
2278- if (res != fReservationMap.end()) {
2279- strncpy(real_name, res->second.c_str(), JACK_CLIENT_NAME_SIZE);
2280- fReservationMap.erase(uuid);
2281- } else {
2282- strncpy(real_name, name, JACK_CLIENT_NAME_SIZE);
2283- }
2284-
2285- EnsureUUID(uuid);
2286- }
2287-
2288- jack_log("JackEngine::ClientExternalOpen: uuid = %d, name = %s ", uuid, real_name);
2289-
2290- int refnum = AllocateRefnum();
2291- if (refnum < 0) {
2292- jack_error("No more refnum available");
2293- return -1;
2294- }
2295-
2296- JackExternalClient* client = new JackExternalClient();
2297-
2298- if (!fSynchroTable[refnum].Allocate(real_name, fEngineControl->fServerName, 0)) {
2299- jack_error("Cannot allocate synchro");
2300- goto error;
2301- }
2302-
2303- if (client->Open(real_name, pid, refnum, uuid, shared_client) < 0) {
2304- jack_error("Cannot open client");
2305- goto error;
2306- }
2307-
2308- if (!fSignal.LockedTimedWait(DRIVER_OPEN_TIMEOUT * 1000000)) {
2309- // Failure if RT thread is not running (problem with the driver...)
2310- jack_error("Driver is not running");
2311- goto error;
2312- }
2313-
2314- fClientTable[refnum] = client;
2315-
2316- if (NotifyAddClient(client, real_name, refnum) < 0) {
2317- jack_error("Cannot notify add client");
2318- goto error;
2319- }
2320-
2321- fGraphManager->InitRefNum(refnum);
2322- fEngineControl->ResetRollingUsecs();
2323- *shared_engine = fEngineControl->GetShmIndex();
2324- *shared_graph_manager = fGraphManager->GetShmIndex();
2325- *ref = refnum;
2326- return 0;
2327-
2328-error:
2329- // Cleanup...
2330- fSynchroTable[refnum].Destroy();
2331- fClientTable[refnum] = 0;
2332- client->Close();
2333- delete client;
2334- return -1;
2335-}
2336-
2337-// Used for server driver clients
2338-int JackEngine::ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait)
2339-{
2340- jack_log("JackEngine::ClientInternalOpen: name = %s", name);
2341-
2342- int refnum = AllocateRefnum();
2343- if (refnum < 0) {
2344- jack_error("No more refnum available");
2345- goto error;
2346- }
2347-
2348- if (!fSynchroTable[refnum].Allocate(name, fEngineControl->fServerName, 0)) {
2349- jack_error("Cannot allocate synchro");
2350- goto error;
2351- }
2352-
2353- if (wait && !fSignal.LockedTimedWait(DRIVER_OPEN_TIMEOUT * 1000000)) {
2354- // Failure if RT thread is not running (problem with the driver...)
2355- jack_error("Driver is not running");
2356- goto error;
2357- }
2358-
2359- fClientTable[refnum] = client;
2360-
2361- if (NotifyAddClient(client, name, refnum) < 0) {
2362- jack_error("Cannot notify add client");
2363- goto error;
2364- }
2365-
2366- fGraphManager->InitRefNum(refnum);
2367- fEngineControl->ResetRollingUsecs();
2368- *shared_engine = fEngineControl;
2369- *shared_manager = fGraphManager;
2370- *ref = refnum;
2371- return 0;
2372-
2373-error:
2374- // Cleanup...
2375- fSynchroTable[refnum].Destroy();
2376- fClientTable[refnum] = 0;
2377- return -1;
2378-}
2379-
2380-// Used for external clients
2381-int JackEngine::ClientExternalClose(int refnum)
2382-{
2383- JackClientInterface* client = fClientTable[refnum];
2384- fEngineControl->fTransport.ResetTimebase(refnum);
2385- int res = ClientCloseAux(refnum, client, true);
2386- client->Close();
2387- delete client;
2388- return res;
2389-}
2390-
2391-// Used for server internal clients or drivers when the RT thread is stopped
2392-int JackEngine::ClientInternalClose(int refnum, bool wait)
2393-{
2394- JackClientInterface* client = fClientTable[refnum];
2395- return ClientCloseAux(refnum, client, wait);
2396-}
2397-
2398-int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wait)
2399-{
2400- jack_log("JackEngine::ClientCloseAux ref = %ld", refnum);
2401-
2402- // Unregister all ports ==> notifications are sent
2403- jack_int_t ports[PORT_NUM_FOR_CLIENT];
2404- int i;
2405-
2406- fGraphManager->GetInputPorts(refnum, ports);
2407- for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) {
2408- PortUnRegister(refnum, ports[i]);
2409- }
2410-
2411- fGraphManager->GetOutputPorts(refnum, ports);
2412- for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) {
2413- PortUnRegister(refnum, ports[i]);
2414- }
2415-
2416- // Remove the client from the table
2417- ReleaseRefnum(refnum);
2418-
2419- // Remove all ports
2420- fGraphManager->RemoveAllPorts(refnum);
2421-
2422- // Wait until next cycle to be sure client is not used anymore
2423- if (wait) {
2424- if (!fSignal.LockedTimedWait(fEngineControl->fTimeOutUsecs * 2)) { // Must wait at least until a switch occurs in Process, even in case of graph end failure
2425- jack_error("JackEngine::ClientCloseAux wait error ref = %ld", refnum);
2426- }
2427- }
2428-
2429- // Notify running clients
2430- NotifyRemoveClient(client->GetClientControl()->fName, client->GetClientControl()->fRefNum);
2431-
2432- // Cleanup...
2433- fSynchroTable[refnum].Destroy();
2434- fEngineControl->ResetRollingUsecs();
2435- return 0;
2436-}
2437-
2438-int JackEngine::ClientActivate(int refnum, bool is_real_time)
2439-{
2440- JackClientInterface* client = fClientTable[refnum];
2441- jack_log("JackEngine::ClientActivate ref = %ld name = %s", refnum, client->GetClientControl()->fName);
2442-
2443- if (is_real_time)
2444- fGraphManager->Activate(refnum);
2445-
2446- // Wait for graph state change to be effective
2447- if (!fSignal.LockedTimedWait(fEngineControl->fTimeOutUsecs * 10)) {
2448- jack_error("JackEngine::ClientActivate wait error ref = %ld name = %s", refnum, client->GetClientControl()->fName);
2449- return -1;
2450- } else {
2451- jack_int_t input_ports[PORT_NUM_FOR_CLIENT];
2452- jack_int_t output_ports[PORT_NUM_FOR_CLIENT];
2453- fGraphManager->GetInputPorts(refnum, input_ports);
2454- fGraphManager->GetOutputPorts(refnum, output_ports);
2455-
2456- // Notify client
2457- NotifyActivate(refnum);
2458-
2459- // Then issue port registration notification
2460- for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (input_ports[i] != EMPTY); i++) {
2461- NotifyPortRegistation(input_ports[i], true);
2462- }
2463- for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (output_ports[i] != EMPTY); i++) {
2464- NotifyPortRegistation(output_ports[i], true);
2465- }
2466-
2467- return 0;
2468- }
2469-}
2470-
2471-// May be called without client
2472-int JackEngine::ClientDeactivate(int refnum)
2473-{
2474- JackClientInterface* client = fClientTable[refnum];
2475- jack_log("JackEngine::ClientDeactivate ref = %ld name = %s", refnum, client->GetClientControl()->fName);
2476-
2477- jack_int_t input_ports[PORT_NUM_FOR_CLIENT];
2478- jack_int_t output_ports[PORT_NUM_FOR_CLIENT];
2479- fGraphManager->GetInputPorts(refnum, input_ports);
2480- fGraphManager->GetOutputPorts(refnum, output_ports);
2481-
2482- // First disconnect all ports
2483- for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (input_ports[i] != EMPTY); i++) {
2484- PortDisconnect(refnum, input_ports[i], ALL_PORTS);
2485- }
2486- for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (output_ports[i] != EMPTY); i++) {
2487- PortDisconnect(refnum, output_ports[i], ALL_PORTS);
2488- }
2489-
2490- // Then issue port registration notification
2491- for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (input_ports[i] != EMPTY); i++) {
2492- NotifyPortRegistation(input_ports[i], false);
2493- }
2494- for (int i = 0; (i < PORT_NUM_FOR_CLIENT) && (output_ports[i] != EMPTY); i++) {
2495- NotifyPortRegistation(output_ports[i], false);
2496- }
2497-
2498- fGraphManager->Deactivate(refnum);
2499- fLastSwitchUsecs = 0; // Force switch to occur next cycle, even when called with "dead" clients
2500-
2501- // Wait for graph state change to be effective
2502- if (!fSignal.LockedTimedWait(fEngineControl->fTimeOutUsecs * 10)) {
2503- jack_error("JackEngine::ClientDeactivate wait error ref = %ld name = %s", refnum, client->GetClientControl()->fName);
2504- return -1;
2505- } else {
2506- return 0;
2507- }
2508-}
2509-
2510-//-----------------
2511-// Port management
2512-//-----------------
2513-
2514-int JackEngine::PortRegister(int refnum, const char* name, const char *type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port_index)
2515-{
2516- jack_log("JackEngine::PortRegister ref = %ld name = %s type = %s flags = %d buffer_size = %d", refnum, name, type, flags, buffer_size);
2517- JackClientInterface* client = fClientTable[refnum];
2518-
2519- // Check if port name already exists
2520- if (fGraphManager->GetPort(name) != NO_PORT) {
2521- jack_error("port_name \"%s\" already exists", name);
2522- return -1;
2523- }
2524-
2525- *port_index = fGraphManager->AllocatePort(refnum, name, type, (JackPortFlags)flags, fEngineControl->fBufferSize);
2526- if (*port_index != NO_PORT) {
2527- if (client->GetClientControl()->fActive)
2528- NotifyPortRegistation(*port_index, true);
2529- return 0;
2530- } else {
2531- return -1;
2532- }
2533-}
2534-
2535-int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index)
2536-{
2537- jack_log("JackEngine::PortUnRegister ref = %ld port_index = %ld", refnum, port_index);
2538- JackClientInterface* client = fClientTable[refnum];
2539-
2540- // Disconnect port ==> notification is sent
2541- PortDisconnect(refnum, port_index, ALL_PORTS);
2542-
2543- if (fGraphManager->ReleasePort(refnum, port_index) == 0) {
2544- if (client->GetClientControl()->fActive)
2545- NotifyPortRegistation(port_index, false);
2546- return 0;
2547- } else {
2548- return -1;
2549- }
2550-}
2551-
2552-int JackEngine::PortConnect(int refnum, const char* src, const char* dst)
2553-{
2554- jack_log("JackEngine::PortConnect src = %s dst = %s", src, dst);
2555- jack_port_id_t port_src, port_dst;
2556-
2557- return (fGraphManager->GetTwoPorts(src, dst, &port_src, &port_dst) < 0)
2558- ? -1
2559- : PortConnect(refnum, port_src, port_dst);
2560-}
2561-
2562-int JackEngine::PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
2563-{
2564- jack_log("JackEngine::PortConnect src = %d dst = %d", src, dst);
2565- JackClientInterface* client;
2566- int ref;
2567-
2568- if (fGraphManager->CheckPorts(src, dst) < 0)
2569- return -1;
2570-
2571- ref = fGraphManager->GetOutputRefNum(src);
2572- assert(ref >= 0);
2573- client = fClientTable[ref];
2574- assert(client);
2575- if (!client->GetClientControl()->fActive) {
2576- jack_error("Cannot connect ports owned by inactive clients:"
2577- " \"%s\" is not active", client->GetClientControl()->fName);
2578- return -1;
2579- }
2580-
2581- ref = fGraphManager->GetInputRefNum(dst);
2582- assert(ref >= 0);
2583- client = fClientTable[ref];
2584- assert(client);
2585- if (!client->GetClientControl()->fActive) {
2586- jack_error("Cannot connect ports owned by inactive clients:"
2587- " \"%s\" is not active", client->GetClientControl()->fName);
2588- return -1;
2589- }
2590-
2591- int res = fGraphManager->Connect(src, dst);
2592- if (res == 0)
2593- NotifyPortConnect(src, dst, true);
2594- return res;
2595-}
2596-
2597-int JackEngine::PortDisconnect(int refnum, const char* src, const char* dst)
2598-{
2599- jack_log("JackEngine::PortDisconnect src = %s dst = %s", src, dst);
2600- jack_port_id_t port_src, port_dst;
2601-
2602- return (fGraphManager->GetTwoPorts(src, dst, &port_src, &port_dst) < 0)
2603- ? -1
2604- : PortDisconnect(refnum, port_src, port_dst);
2605-}
2606-
2607-int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
2608-{
2609- jack_log("JackEngine::PortDisconnect src = %d dst = %d", src, dst);
2610-
2611- if (dst == ALL_PORTS) {
2612-
2613- jack_int_t connections[CONNECTION_NUM_FOR_PORT];
2614- fGraphManager->GetConnections(src, connections);
2615-
2616- JackPort* port = fGraphManager->GetPort(src);
2617- int ret = 0;
2618- if (port->GetFlags() & JackPortIsOutput) {
2619- for (int i = 0; (i < CONNECTION_NUM_FOR_PORT) && (connections[i] != EMPTY); i++) {
2620- if (PortDisconnect(refnum, src, connections[i]) != 0) {
2621- ret = -1;
2622- }
2623- }
2624- } else {
2625- for (int i = 0; (i < CONNECTION_NUM_FOR_PORT) && (connections[i] != EMPTY); i++) {
2626- if (PortDisconnect(refnum, connections[i], src) != 0) {
2627- ret = -1;
2628- }
2629- }
2630- }
2631-
2632- return ret;
2633- } else if (fGraphManager->CheckPorts(src, dst) < 0) {
2634- return -1;
2635- } else if (fGraphManager->Disconnect(src, dst) == 0) {
2636- // Notifications
2637- NotifyPortConnect(src, dst, false);
2638- return 0;
2639- } else {
2640- return -1;
2641- }
2642-}
2643-
2644-int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name)
2645-{
2646- char old_name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
2647- strcpy(old_name, fGraphManager->GetPort(port)->GetName());
2648- fGraphManager->GetPort(port)->SetName(name);
2649- NotifyPortRename(port, old_name);
2650- return 0;
2651-}
2652-
2653-//--------------------
2654-// Session management
2655-//--------------------
2656-
2657-void JackEngine::SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket)
2658-{
2659- if (fSessionPendingReplies != 0) {
2660- JackSessionNotifyResult res(-1);
2661- res.Write(socket);
2662- jack_log("JackEngine::SessionNotify ... busy");
2663- return;
2664- }
2665-
2666- for (int i = 0; i < CLIENT_NUM; i++) {
2667- JackClientInterface* client = fClientTable[i];
2668- if (client && (client->GetClientControl()->fSessionID < 0)) {
2669- client->GetClientControl()->fSessionID = GetNewUUID();
2670- }
2671- }
2672- fSessionResult = new JackSessionNotifyResult();
2673-
2674- for (int i = 0; i < CLIENT_NUM; i++) {
2675- JackClientInterface* client = fClientTable[i];
2676- if (client && client->GetClientControl()->fCallback[kSessionCallback]) {
2677-
2678- // check if this is a notification to a specific client.
2679- if (target != NULL && strlen(target) != 0) {
2680- if (strcmp(target, client->GetClientControl()->fName)) {
2681- continue;
2682- }
2683- }
2684-
2685- char path_buf[JACK_PORT_NAME_SIZE];
2686- snprintf( path_buf, sizeof(path_buf), "%s%s%c", path, client->GetClientControl()->fName, DIR_SEPARATOR );
2687-
2688- int res = JackTools::MkDir(path_buf);
2689- if (res)
2690- jack_error( "JackEngine::SessionNotify: can not create session directory '%s'", path_buf );
2691-
2692- int result = client->ClientNotify(i, client->GetClientControl()->fName, kSessionCallback, true, path_buf, (int) type, 0);
2693-
2694- if (result == 2) {
2695- fSessionPendingReplies += 1;
2696- } else if (result == 1) {
2697- char uuid_buf[JACK_UUID_SIZE];
2698- snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID );
2699- fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf,
2700- client->GetClientControl()->fName,
2701- client->GetClientControl()->fSessionCommand,
2702- client->GetClientControl()->fSessionFlags ));
2703- }
2704- }
2705- }
2706-
2707- if (fSessionPendingReplies == 0) {
2708- fSessionResult->Write(socket);
2709- delete fSessionResult;
2710- fSessionResult = NULL;
2711- } else {
2712- fSessionTransaction = socket;
2713- }
2714-}
2715-
2716-void JackEngine::SessionReply(int refnum)
2717-{
2718- JackClientInterface* client = fClientTable[refnum];
2719- char uuid_buf[JACK_UUID_SIZE];
2720- snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID);
2721- fSessionResult->fCommandList.push_back(JackSessionCommand(uuid_buf,
2722- client->GetClientControl()->fName,
2723- client->GetClientControl()->fSessionCommand,
2724- client->GetClientControl()->fSessionFlags));
2725- fSessionPendingReplies -= 1;
2726-
2727- if (fSessionPendingReplies == 0) {
2728- fSessionResult->Write(fSessionTransaction);
2729- delete fSessionResult;
2730- fSessionResult = NULL;
2731- }
2732-}
2733-
2734-void JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res, int *result)
2735-{
2736- for (int i = 0; i < CLIENT_NUM; i++) {
2737- JackClientInterface* client = fClientTable[i];
2738-
2739- if (client && (strcmp(client_name, client->GetClientControl()->fName) == 0)) {
2740- snprintf(uuid_res, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
2741- *result = 0;
2742- return;
2743- }
2744- }
2745- // Did not find name.
2746- *result = -1;
2747-}
2748-
2749-void JackEngine::GetClientNameForUUID(const char *uuid, char *name_res, int *result)
2750-{
2751- for (int i = 0; i < CLIENT_NUM; i++) {
2752- JackClientInterface* client = fClientTable[i];
2753-
2754- if (!client)
2755- continue;
2756-
2757- char uuid_buf[JACK_UUID_SIZE];
2758- snprintf(uuid_buf, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
2759-
2760- if (strcmp(uuid,uuid_buf) == 0) {
2761- strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE);
2762- *result = 0;
2763- return;
2764- }
2765- }
2766- // Did not find uuid.
2767- *result = -1;
2768-}
2769-
2770-void JackEngine::ReserveClientName(const char *name, const char *uuid, int *result)
2771-{
2772- jack_log("JackEngine::ReserveClientName ( name = %s, uuid = %s )", name, uuid);
2773-
2774- if (ClientCheckName(name)) {
2775- *result = -1;
2776- jack_log("name already taken");
2777- return;
2778- }
2779-
2780- EnsureUUID(atoi(uuid));
2781- fReservationMap[atoi(uuid)] = name;
2782- *result = 0;
2783-}
2784-
2785-void JackEngine::ClientHasSessionCallbackRequest(const char *name, int *result)
2786-{
2787- JackClientInterface* client = NULL;
2788- for (int i = 0; i < CLIENT_NUM; i++) {
2789- JackClientInterface* client = fClientTable[i];
2790- if (client && (strcmp(client->GetClientControl()->fName, name) == 0))
2791- break;
2792- }
2793-
2794- if (client) {
2795- *result = client->GetClientControl()->fCallback[kSessionCallback];
2796- } else {
2797- *result = -1;
2798- }
2799-}
2800-
2801-} // end of namespace
2802-
2803
2804=== removed file '.pc/no-selfconnect.patch/common/JackEngine.h'
2805--- .pc/no-selfconnect.patch/common/JackEngine.h 2011-03-31 13:54:50 +0000
2806+++ .pc/no-selfconnect.patch/common/JackEngine.h 1970-01-01 00:00:00 +0000
2807@@ -1,161 +0,0 @@
2808-/*
2809-Copyright (C) 2004-2008 Grame
2810-
2811-This program is free software; you can redistribute it and/or modify
2812-it under the terms of the GNU General Public License as published by
2813-the Free Software Foundation; either version 2 of the License, or
2814-(at your option) any later version.
2815-
2816-This program is distributed in the hope that it will be useful,
2817-but WITHOUT ANY WARRANTY; without even the implied warranty of
2818-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2819-GNU General Public License for more details.
2820-
2821-You should have received a copy of the GNU General Public License
2822-along with this program; if not, write to the Free Software
2823-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2824-
2825-*/
2826-
2827-#ifndef __JackEngine__
2828-#define __JackEngine__
2829-
2830-#include "JackConstants.h"
2831-#include "JackGraphManager.h"
2832-#include "JackSynchro.h"
2833-#include "JackMutex.h"
2834-#include "JackTransportEngine.h"
2835-#include "JackPlatformPlug.h"
2836-#include <map>
2837-
2838-namespace Jack
2839-{
2840-
2841-class JackClientInterface;
2842-struct JackEngineControl;
2843-class JackExternalClient;
2844-
2845-/*!
2846-\brief Engine description.
2847-*/
2848-
2849-class SERVER_EXPORT JackEngine : public JackLockAble
2850-{
2851- friend class JackLockedEngine;
2852-
2853- private:
2854-
2855- JackGraphManager* fGraphManager;
2856- JackEngineControl* fEngineControl;
2857- JackClientInterface* fClientTable[CLIENT_NUM];
2858- JackSynchro* fSynchroTable;
2859- JackServerNotifyChannel fChannel; /*! To communicate between the RT thread and server */
2860- JackProcessSync fSignal;
2861- jack_time_t fLastSwitchUsecs;
2862-
2863- int fSessionPendingReplies;
2864- JackChannelTransaction *fSessionTransaction;
2865- JackSessionNotifyResult *fSessionResult;
2866- std::map<int,std::string> fReservationMap;
2867- int fMaxUUID;
2868-
2869- int ClientCloseAux(int refnum, JackClientInterface* client, bool wait);
2870- void CheckXRun(jack_time_t callback_usecs);
2871-
2872- int NotifyAddClient(JackClientInterface* new_client, const char* name, int refnum);
2873- void NotifyRemoveClient(const char* name, int refnum);
2874-
2875- void ProcessNext(jack_time_t callback_usecs);
2876- void ProcessCurrent(jack_time_t callback_usecs);
2877-
2878- bool ClientCheckName(const char* name);
2879- bool GenerateUniqueName(char* name);
2880-
2881- int AllocateRefnum();
2882- void ReleaseRefnum(int ref);
2883-
2884- void NotifyClient(int refnum, int event, int sync, const char* message, int value1, int value2);
2885- void NotifyClients(int event, int sync, const char* message, int value1, int value2);
2886-
2887- void NotifyPortRegistation(jack_port_id_t port_index, bool onoff);
2888- void NotifyPortConnect(jack_port_id_t src, jack_port_id_t dst, bool onoff);
2889- void NotifyPortRename(jack_port_id_t src, const char* old_name);
2890- void NotifyActivate(int refnum);
2891-
2892- int GetNewUUID();
2893- void EnsureUUID(int uuid);
2894-
2895- bool CheckClient(int refnum)
2896- {
2897- return (refnum >= 0 && refnum < CLIENT_NUM && fClientTable[refnum] != NULL);
2898- }
2899-
2900- public:
2901-
2902- JackEngine(JackGraphManager* manager, JackSynchro* table, JackEngineControl* controler);
2903- ~JackEngine();
2904-
2905- int Open();
2906- int Close();
2907-
2908- // Client management
2909- int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status);
2910- int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager);
2911- int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait);
2912-
2913- int ClientExternalClose(int refnum);
2914- int ClientInternalClose(int refnum, bool wait);
2915-
2916- int ClientActivate(int refnum, bool is_real_time);
2917- int ClientDeactivate(int refnum);
2918-
2919- int GetClientPID(const char* name);
2920- int GetClientRefNum(const char* name);
2921-
2922- // Internal client management
2923- int GetInternalClientName(int int_ref, char* name_res);
2924- int InternalClientHandle(const char* client_name, int* status, int* int_ref);
2925- int InternalClientUnload(int refnum, int* status);
2926-
2927- // Port management
2928- int PortRegister(int refnum, const char* name, const char *type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port);
2929- int PortUnRegister(int refnum, jack_port_id_t port);
2930-
2931- int PortConnect(int refnum, const char* src, const char* dst);
2932- int PortDisconnect(int refnum, const char* src, const char* dst);
2933-
2934- int PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst);
2935- int PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst);
2936-
2937- int PortRename(int refnum, jack_port_id_t port, const char* name);
2938-
2939- int ComputeTotalLatencies();
2940-
2941- // Graph
2942- bool Process(jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end);
2943-
2944- // Notifications
2945- void NotifyXRun(jack_time_t callback_usecs, float delayed_usecs);
2946- void NotifyFailure(int code, const char* reason);
2947- void NotifyXRun(int refnum);
2948- void NotifyGraphReorder();
2949- void NotifyBufferSize(jack_nframes_t buffer_size);
2950- void NotifySampleRate(jack_nframes_t sample_rate);
2951- void NotifyFreewheel(bool onoff);
2952- void NotifyQuit();
2953-
2954- // Session management
2955- void SessionNotify(int refnum, const char *target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket);
2956- void SessionReply(int refnum);
2957-
2958- void GetUUIDForClientName(const char *client_name, char *uuid_res, int *result);
2959- void GetClientNameForUUID(const char *uuid, char *name_res, int *result);
2960- void ReserveClientName(const char *name, const char *uuid, int *result);
2961- void ClientHasSessionCallbackRequest(const char *name, int *result);
2962-};
2963-
2964-
2965-} // end of namespace
2966-
2967-#endif
2968-
2969
2970=== removed file '.pc/no-selfconnect.patch/common/JackLockedEngine.h'
2971--- .pc/no-selfconnect.patch/common/JackLockedEngine.h 2011-03-31 13:54:50 +0000
2972+++ .pc/no-selfconnect.patch/common/JackLockedEngine.h 1970-01-01 00:00:00 +0000
2973@@ -1,368 +0,0 @@
2974-/*
2975-Copyright (C) 2008 Grame
2976-
2977-This program is free software; you can redistribute it and/or modify
2978-it under the terms of the GNU General Public License as published by
2979-the Free Software Foundation; either version 2 of the License, or
2980-(at your option) any later version.
2981-
2982-This program is distributed in the hope that it will be useful,
2983-but WITHOUT ANY WARRANTY; without even the implied warranty of
2984-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2985-GNU General Public License for more details.
2986-
2987-You should have received a copy of the GNU General Public License
2988-along with this program; if not, write to the Free Software
2989-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2990-
2991-*/
2992-
2993-#ifndef __JackLockedEngine__
2994-#define __JackLockedEngine__
2995-
2996-#include "JackEngine.h"
2997-#include "JackMutex.h"
2998-#include "JackTools.h"
2999-#include "JackException.h"
3000-
3001-namespace Jack
3002-{
3003-
3004-#define TRY_CALL \
3005- try { \
3006-
3007-/*
3008-See : http://groups.google.com/group/comp.programming.threads/browse_thread/thread/652bcf186fbbf697/f63757846514e5e5
3009-
3010-catch (...) {
3011- // Assuming thread cancellation, must rethrow
3012- throw;
3013-}
3014-*/
3015-
3016-#define CATCH_EXCEPTION_RETURN \
3017- } catch(std::bad_alloc& e) { \
3018- jack_error("Memory allocation error..."); \
3019- return -1; \
3020- } catch(JackTemporaryException& e) { \
3021- jack_error("JackTemporaryException : now quits..."); \
3022- JackTools::KillServer(); \
3023- return -1; \
3024- } catch (...) { \
3025- jack_error("Unknown error..."); \
3026- throw; \
3027- } \
3028-
3029-#define CATCH_EXCEPTION \
3030- } catch(std::bad_alloc& e) { \
3031- jack_error("Memory allocation error..."); \
3032- } catch (...) { \
3033- jack_error("Unknown error..."); \
3034- throw; \
3035- } \
3036-
3037-
3038-/*!
3039-\brief Locked Engine, access to methods is serialized using a mutex.
3040-*/
3041-
3042-class SERVER_EXPORT JackLockedEngine
3043-{
3044- private:
3045-
3046- JackEngine fEngine;
3047-
3048- public:
3049-
3050- JackLockedEngine(JackGraphManager* manager, JackSynchro* table, JackEngineControl* controler):
3051- fEngine(manager, table, controler)
3052- {}
3053- ~JackLockedEngine()
3054- {}
3055-
3056- int Open()
3057- {
3058- // No lock needed
3059- TRY_CALL
3060- return fEngine.Open();
3061- CATCH_EXCEPTION_RETURN
3062- }
3063- int Close()
3064- {
3065- // No lock needed
3066- TRY_CALL
3067- return fEngine.Close();
3068- CATCH_EXCEPTION_RETURN
3069- }
3070-
3071- // Client management
3072- int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status)
3073- {
3074- TRY_CALL
3075- JackLock lock(&fEngine);
3076- return fEngine.ClientCheck(name, uuid, name_res, protocol, options, status);
3077- CATCH_EXCEPTION_RETURN
3078- }
3079- int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
3080- {
3081- TRY_CALL
3082- JackLock lock(&fEngine);
3083- return fEngine.ClientExternalOpen(name, pid, uuid, ref, shared_engine, shared_client, shared_graph_manager);
3084- CATCH_EXCEPTION_RETURN
3085- }
3086- int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait)
3087- {
3088- TRY_CALL
3089- JackLock lock(&fEngine);
3090- return fEngine.ClientInternalOpen(name, ref, shared_engine, shared_manager, client, wait);
3091- CATCH_EXCEPTION_RETURN
3092- }
3093-
3094- int ClientExternalClose(int refnum)
3095- {
3096- TRY_CALL
3097- JackLock lock(&fEngine);
3098- return (fEngine.CheckClient(refnum)) ? fEngine.ClientExternalClose(refnum) : - 1;
3099- CATCH_EXCEPTION_RETURN
3100- }
3101- int ClientInternalClose(int refnum, bool wait)
3102- {
3103- TRY_CALL
3104- JackLock lock(&fEngine);
3105- return (fEngine.CheckClient(refnum)) ? fEngine.ClientInternalClose(refnum, wait) : -1;
3106- CATCH_EXCEPTION_RETURN
3107- }
3108-
3109- int ClientActivate(int refnum, bool is_real_time)
3110- {
3111- TRY_CALL
3112- JackLock lock(&fEngine);
3113- return (fEngine.CheckClient(refnum)) ? fEngine.ClientActivate(refnum, is_real_time) : -1;
3114- CATCH_EXCEPTION_RETURN
3115- }
3116- int ClientDeactivate(int refnum)
3117- {
3118- TRY_CALL
3119- JackLock lock(&fEngine);
3120- return (fEngine.CheckClient(refnum)) ? fEngine.ClientDeactivate(refnum) : -1;
3121- CATCH_EXCEPTION_RETURN
3122- }
3123-
3124- // Internal client management
3125- int GetInternalClientName(int int_ref, char* name_res)
3126- {
3127- TRY_CALL
3128- JackLock lock(&fEngine);
3129- return fEngine.GetInternalClientName(int_ref, name_res);
3130- CATCH_EXCEPTION_RETURN
3131- }
3132- int InternalClientHandle(const char* client_name, int* status, int* int_ref)
3133- {
3134- TRY_CALL
3135- JackLock lock(&fEngine);
3136- return fEngine.InternalClientHandle(client_name, status, int_ref);
3137- CATCH_EXCEPTION_RETURN
3138- }
3139- int InternalClientUnload(int refnum, int* status)
3140- {
3141- TRY_CALL
3142- JackLock lock(&fEngine);
3143- // Client is tested in fEngine.InternalClientUnload
3144- return fEngine.InternalClientUnload(refnum, status);
3145- CATCH_EXCEPTION_RETURN
3146- }
3147-
3148- // Port management
3149- int PortRegister(int refnum, const char* name, const char *type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port)
3150- {
3151- TRY_CALL
3152- JackLock lock(&fEngine);
3153- return (fEngine.CheckClient(refnum)) ? fEngine.PortRegister(refnum, name, type, flags, buffer_size, port) : -1;
3154- CATCH_EXCEPTION_RETURN
3155- }
3156- int PortUnRegister(int refnum, jack_port_id_t port)
3157- {
3158- TRY_CALL
3159- JackLock lock(&fEngine);
3160- return (fEngine.CheckClient(refnum)) ? fEngine.PortUnRegister(refnum, port) : -1;
3161- CATCH_EXCEPTION_RETURN
3162- }
3163-
3164- int PortConnect(int refnum, const char* src, const char* dst)
3165- {
3166- TRY_CALL
3167- JackLock lock(&fEngine);
3168- return (fEngine.CheckClient(refnum)) ? fEngine.PortConnect(refnum, src, dst) : -1;
3169- CATCH_EXCEPTION_RETURN
3170- }
3171- int PortDisconnect(int refnum, const char* src, const char* dst)
3172- {
3173- TRY_CALL
3174- JackLock lock(&fEngine);
3175- return (fEngine.CheckClient(refnum)) ? fEngine.PortDisconnect(refnum, src, dst) : -1;
3176- CATCH_EXCEPTION_RETURN
3177- }
3178-
3179- int PortConnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
3180- {
3181- TRY_CALL
3182- JackLock lock(&fEngine);
3183- return (fEngine.CheckClient(refnum)) ? fEngine.PortConnect(refnum, src, dst) : -1;
3184- CATCH_EXCEPTION_RETURN
3185- }
3186- int PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t dst)
3187- {
3188- TRY_CALL
3189- JackLock lock(&fEngine);
3190- return (fEngine.CheckClient(refnum)) ? fEngine.PortDisconnect(refnum, src, dst) : -1;
3191- CATCH_EXCEPTION_RETURN
3192- }
3193-
3194- int PortRename(int refnum, jack_port_id_t port, const char* name)
3195- {
3196- TRY_CALL
3197- JackLock lock(&fEngine);
3198- return (fEngine.CheckClient(refnum)) ? fEngine.PortRename(refnum, port, name) : -1;
3199- CATCH_EXCEPTION_RETURN
3200- }
3201-
3202- int ComputeTotalLatencies()
3203- {
3204- TRY_CALL
3205- JackLock lock(&fEngine);
3206- return fEngine.ComputeTotalLatencies();
3207- CATCH_EXCEPTION_RETURN
3208- }
3209-
3210- // Graph
3211- bool Process(jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end)
3212- {
3213- // RT : no lock
3214- return fEngine.Process(cur_cycle_begin, prev_cycle_end);
3215- }
3216-
3217- // Notifications
3218- void NotifyXRun(jack_time_t cur_cycle_begin, float delayed_usecs)
3219- {
3220- // RT : no lock
3221- fEngine.NotifyXRun(cur_cycle_begin, delayed_usecs);
3222- }
3223-
3224- void NotifyXRun(int refnum)
3225- {
3226- // RT : no lock
3227- fEngine.NotifyXRun(refnum);
3228- }
3229-
3230- void NotifyGraphReorder()
3231- {
3232- TRY_CALL
3233- JackLock lock(&fEngine);
3234- fEngine.NotifyGraphReorder();
3235- CATCH_EXCEPTION
3236- }
3237- void NotifyBufferSize(jack_nframes_t buffer_size)
3238- {
3239- TRY_CALL
3240- JackLock lock(&fEngine);
3241- fEngine.NotifyBufferSize(buffer_size);
3242- CATCH_EXCEPTION
3243- }
3244- void NotifySampleRate(jack_nframes_t sample_rate)
3245- {
3246- TRY_CALL
3247- JackLock lock(&fEngine);
3248- fEngine.NotifySampleRate(sample_rate);
3249- CATCH_EXCEPTION
3250- }
3251- void NotifyFreewheel(bool onoff)
3252- {
3253- TRY_CALL
3254- JackLock lock(&fEngine);
3255- fEngine.NotifyFreewheel(onoff);
3256- CATCH_EXCEPTION
3257- }
3258-
3259- void NotifyFailure(int code, const char* reason)
3260- {
3261- TRY_CALL
3262- JackLock lock(&fEngine);
3263- fEngine.NotifyFailure(code, reason);
3264- CATCH_EXCEPTION
3265- }
3266-
3267- int GetClientPID(const char* name)
3268- {
3269- TRY_CALL
3270- JackLock lock(&fEngine);
3271- return fEngine.GetClientPID(name);
3272- CATCH_EXCEPTION_RETURN
3273- }
3274-
3275- int GetClientRefNum(const char* name)
3276- {
3277- TRY_CALL
3278- JackLock lock(&fEngine);
3279- return fEngine.GetClientRefNum(name);
3280- CATCH_EXCEPTION_RETURN
3281- }
3282-
3283- void NotifyQuit()
3284- {
3285- TRY_CALL
3286- JackLock lock(&fEngine);
3287- return fEngine.NotifyQuit();
3288- CATCH_EXCEPTION
3289- }
3290-
3291- void SessionNotify(int refnum, const char* target, jack_session_event_type_t type, const char *path, JackChannelTransaction *socket)
3292- {
3293- TRY_CALL
3294- JackLock lock(&fEngine);
3295- fEngine.SessionNotify(refnum, target, type, path, socket);
3296- CATCH_EXCEPTION
3297- }
3298-
3299- void SessionReply(int refnum)
3300- {
3301- TRY_CALL
3302- JackLock lock(&fEngine);
3303- fEngine.SessionReply(refnum);
3304- CATCH_EXCEPTION
3305- }
3306-
3307- void GetUUIDForClientName(const char *client_name, char *uuid_res, int *result)
3308- {
3309- TRY_CALL
3310- JackLock lock(&fEngine);
3311- fEngine.GetUUIDForClientName(client_name, uuid_res, result);
3312- CATCH_EXCEPTION
3313- }
3314- void GetClientNameForUUID(const char *uuid, char *name_res, int *result)
3315- {
3316- TRY_CALL
3317- JackLock lock(&fEngine);
3318- fEngine.GetClientNameForUUID(uuid, name_res, result);
3319- CATCH_EXCEPTION
3320- }
3321- void ReserveClientName(const char *name, const char *uuid, int *result)
3322- {
3323- TRY_CALL
3324- JackLock lock(&fEngine);
3325- fEngine.ReserveClientName(name, uuid, result);
3326- CATCH_EXCEPTION
3327- }
3328-
3329- void ClientHasSessionCallbackRequest(const char *name, int *result)
3330- {
3331- TRY_CALL
3332- JackLock lock(&fEngine);
3333- fEngine.ClientHasSessionCallbackRequest(name, result);
3334- CATCH_EXCEPTION
3335- }
3336-};
3337-
3338-} // end of namespace
3339-
3340-#endif
3341-
3342
3343=== removed file '.pc/no-selfconnect.patch/common/JackServer.cpp'
3344--- .pc/no-selfconnect.patch/common/JackServer.cpp 2011-03-31 13:54:50 +0000
3345+++ .pc/no-selfconnect.patch/common/JackServer.cpp 1970-01-01 00:00:00 +0000
3346@@ -1,408 +0,0 @@
3347-/*
3348-Copyright (C) 2001 Paul Davis
3349-Copyright (C) 2004-2008 Grame
3350-
3351-This program is free software; you can redistribute it and/or modify
3352-it under the terms of the GNU General Public License as published by
3353-the Free Software Foundation; either version 2 of the License, or
3354-(at your option) any later version.
3355-
3356-This program is distributed in the hope that it will be useful,
3357-but WITHOUT ANY WARRANTY; without even the implied warranty of
3358-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3359-GNU General Public License for more details.
3360-
3361-You should have received a copy of the GNU General Public License
3362-along with this program; if not, write to the Free Software
3363-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3364-
3365-*/
3366-
3367-#include "JackSystemDeps.h"
3368-#include "JackServerGlobals.h"
3369-#include "JackTime.h"
3370-#include "JackFreewheelDriver.h"
3371-#include "JackDummyDriver.h"
3372-#include "JackThreadedDriver.h"
3373-#include "JackGlobals.h"
3374-#include "JackLockedEngine.h"
3375-#include "JackAudioDriver.h"
3376-#include "JackChannel.h"
3377-#include "JackClientControl.h"
3378-#include "JackEngineControl.h"
3379-#include "JackGraphManager.h"
3380-#include "JackInternalClient.h"
3381-#include "JackError.h"
3382-#include "JackMessageBuffer.h"
3383-
3384-namespace Jack
3385-{
3386-
3387-JackServer::JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, const char* server_name)
3388-{
3389- if (rt) {
3390- jack_info("JACK server starting in realtime mode with priority %ld", priority);
3391- } else {
3392- jack_info("JACK server starting in non-realtime mode");
3393- }
3394-
3395- fGraphManager = JackGraphManager::Allocate(port_max);
3396- fEngineControl = new JackEngineControl(sync, temporary, timeout, rt, priority, verbose, clock, server_name);
3397- fEngine = new JackLockedEngine(fGraphManager, GetSynchroTable(), fEngineControl);
3398-
3399- // A distinction is made between the threaded freewheel driver and the
3400- // regular freewheel driver because the freewheel driver needs to run in
3401- // threaded mode when freewheel mode is active and needs to run as a slave
3402- // when freewheel mode isn't active.
3403- JackFreewheelDriver *freewheelDriver =
3404- new JackFreewheelDriver(fEngine, GetSynchroTable());
3405- fThreadedFreewheelDriver = new JackThreadedDriver(freewheelDriver);
3406-
3407- fFreewheelDriver = freewheelDriver;
3408- fDriverInfo = new JackDriverInfo();
3409- fAudioDriver = NULL;
3410- fFreewheel = false;
3411- JackServerGlobals::fInstance = this; // Unique instance
3412- JackServerGlobals::fUserCount = 1; // One user
3413- JackGlobals::fVerbose = verbose;
3414-}
3415-
3416-JackServer::~JackServer()
3417-{
3418- JackGraphManager::Destroy(fGraphManager);
3419- delete fDriverInfo;
3420- delete fThreadedFreewheelDriver;
3421- delete fEngine;
3422- delete fEngineControl;
3423-}
3424-
3425-int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params)
3426-{
3427- // TODO: move that in reworked JackServerGlobals::Init()
3428- JackMessageBuffer::Create();
3429-
3430- if ((fAudioDriver = fDriverInfo->Open(driver_desc, fEngine, GetSynchroTable(), driver_params)) == NULL) {
3431- jack_error("Cannot initialize driver");
3432- goto fail_close1;
3433- }
3434-
3435- if (fChannel.Open(fEngineControl->fServerName, this) < 0) {
3436- jack_error("Server channel open error");
3437- goto fail_close2;
3438- }
3439-
3440- if (fEngine->Open() < 0) {
3441- jack_error("Cannot open engine");
3442- goto fail_close3;
3443- }
3444-
3445- if (fFreewheelDriver->Open() < 0) {
3446- jack_error("Cannot open freewheel driver");
3447- goto fail_close4;
3448- }
3449-
3450- if (fAudioDriver->Attach() < 0) {
3451- jack_error("Cannot attach audio driver");
3452- goto fail_close5;
3453- }
3454-
3455- fFreewheelDriver->SetMaster(false);
3456- fAudioDriver->SetMaster(true);
3457- fAudioDriver->AddSlave(fFreewheelDriver);
3458- InitTime();
3459- SetClockSource(fEngineControl->fClockSource);
3460- return 0;
3461-
3462-fail_close5:
3463- fFreewheelDriver->Close();
3464-
3465-fail_close4:
3466- fEngine->Close();
3467-
3468-fail_close3:
3469- fChannel.Close();
3470-
3471-fail_close2:
3472- fAudioDriver->Close();
3473-
3474-fail_close1:
3475- JackMessageBuffer::Destroy();
3476- return -1;
3477-}
3478-
3479-int JackServer::Close()
3480-{
3481- jack_log("JackServer::Close");
3482- fEngine->NotifyQuit();
3483- fChannel.Close();
3484- fAudioDriver->Detach();
3485- fAudioDriver->Close();
3486- fFreewheelDriver->Close();
3487- fEngine->Close();
3488- // TODO: move that in reworked JackServerGlobals::Destroy()
3489- JackMessageBuffer::Destroy();
3490- return 0;
3491-}
3492-
3493-int JackServer::InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status)
3494-{
3495- JackLoadableInternalClient* client = new JackLoadableInternalClient1(JackServerGlobals::fInstance, GetSynchroTable(), objet_data);
3496- assert(client);
3497- return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status);
3498- }
3499-
3500-int JackServer::InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status)
3501-{
3502- JackLoadableInternalClient* client = new JackLoadableInternalClient2(JackServerGlobals::fInstance, GetSynchroTable(), parameters);
3503- assert(client);
3504- return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status);
3505-}
3506-
3507-int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status)
3508-{
3509- // Clear status
3510- *status = 0;
3511-
3512- // Client object is internally kept in JackEngine
3513- if ((client->Init(so_name) < 0) || (client->Open(JACK_DEFAULT_SERVER_NAME, client_name, uuid, (jack_options_t)options, (jack_status_t*)status) < 0)) {
3514- delete client;
3515- int my_status1 = *status | JackFailure;
3516- *status = (jack_status_t)my_status1;
3517- *int_ref = 0;
3518- return -1;
3519- } else {
3520- *int_ref = client->GetClientControl()->fRefNum;
3521- return 0;
3522- }
3523- }
3524-
3525-int JackServer::Start()
3526-{
3527- jack_log("JackServer::Start");
3528- if (fAudioDriver->Start() < 0) {
3529- return -1;
3530- }
3531- return fChannel.Start();
3532-}
3533-
3534-int JackServer::Stop()
3535-{
3536- jack_log("JackServer::Stop");
3537- if (fFreewheel) {
3538- return fThreadedFreewheelDriver->Stop();
3539- } else {
3540- return fAudioDriver->Stop();
3541- }
3542-}
3543-
3544-bool JackServer::IsRunning()
3545-{
3546- jack_log("JackServer::IsRunning");
3547- assert(fAudioDriver);
3548- return fAudioDriver->IsRunning();
3549-}
3550-
3551-int JackServer::SetBufferSize(jack_nframes_t buffer_size)
3552-{
3553- jack_log("JackServer::SetBufferSize nframes = %ld", buffer_size);
3554- jack_nframes_t current_buffer_size = fEngineControl->fBufferSize;
3555-
3556- if (current_buffer_size == buffer_size) {
3557- jack_log("SetBufferSize: requirement for new buffer size equals current value");
3558- return 0;
3559- }
3560-
3561- if (fAudioDriver->IsFixedBufferSize()) {
3562- jack_log("SetBufferSize: driver only supports a fixed buffer size");
3563- return -1;
3564- }
3565-
3566- if (fAudioDriver->Stop() != 0) {
3567- jack_error("Cannot stop audio driver");
3568- return -1;
3569- }
3570-
3571- if (fAudioDriver->SetBufferSize(buffer_size) == 0) {
3572- fFreewheelDriver->SetBufferSize(buffer_size);
3573- fEngine->NotifyBufferSize(buffer_size);
3574- return fAudioDriver->Start();
3575- } else { // Failure: try to restore current value
3576- jack_error("Cannot SetBufferSize for audio driver, restore current value %ld", current_buffer_size);
3577- fAudioDriver->SetBufferSize(current_buffer_size);
3578- fFreewheelDriver->SetBufferSize(current_buffer_size);
3579- fAudioDriver->Start();
3580- // SetBufferSize actually failed, so return an error...
3581- return -1;
3582- }
3583-}
3584-
3585-/*
3586-Freewheel mode is implemented by switching from the (audio + freewheel) driver to the freewheel driver only:
3587-
3588- - "global" connection state is saved
3589- - all audio driver ports are deconnected, thus there is no more dependancies with the audio driver
3590- - the freewheel driver will be synchronized with the end of graph execution : all clients are connected to the freewheel driver
3591- - the freewheel driver becomes the "master"
3592-
3593-Normal mode is restored with the connections state valid before freewheel mode was done. Thus one consider that
3594-no graph state change can be done during freewheel mode.
3595-*/
3596-
3597-int JackServer::SetFreewheel(bool onoff)
3598-{
3599- jack_log("JackServer::SetFreewheel is = %ld want = %ld", fFreewheel, onoff);
3600-
3601- if (fFreewheel) {
3602- if (onoff) {
3603- return -1;
3604- } else {
3605- fFreewheel = false;
3606- fThreadedFreewheelDriver->Stop();
3607- fGraphManager->Restore(&fConnectionState); // Restore previous connection state
3608- fEngine->NotifyFreewheel(onoff);
3609- fFreewheelDriver->SetMaster(false);
3610- fAudioDriver->SetMaster(true);
3611- return fAudioDriver->Start();
3612- }
3613- } else {
3614- if (onoff) {
3615- fFreewheel = true;
3616- fAudioDriver->Stop();
3617- fGraphManager->Save(&fConnectionState); // Save connection state
3618- fGraphManager->DisconnectAllPorts(fAudioDriver->GetClientControl()->fRefNum);
3619- fEngine->NotifyFreewheel(onoff);
3620- fAudioDriver->SetMaster(false);
3621- fFreewheelDriver->SetMaster(true);
3622- return fThreadedFreewheelDriver->Start();
3623- } else {
3624- return -1;
3625- }
3626- }
3627-}
3628-
3629-// Coming from the RT thread
3630-void JackServer::Notify(int refnum, int notify, int value)
3631-{
3632- switch (notify) {
3633-
3634- case kGraphOrderCallback:
3635- fEngine->NotifyGraphReorder();
3636- break;
3637-
3638- case kXRunCallback:
3639- fEngine->NotifyXRun(refnum);
3640- break;
3641- }
3642-}
3643-
3644-void JackServer::ClientKill(int refnum)
3645-{
3646- jack_log("JackServer::ClientKill ref = %ld", refnum);
3647- if (fEngine->ClientDeactivate(refnum) < 0) {
3648- jack_error("JackServer::ClientKill ref = %ld cannot be removed from the graph !!", refnum);
3649- }
3650- if (fEngine->ClientExternalClose(refnum) < 0) {
3651- jack_error("JackServer::ClientKill ref = %ld cannot be closed", refnum);
3652- }
3653-}
3654-
3655-//----------------------
3656-// Backend management
3657-//----------------------
3658-
3659-JackDriverInfo* JackServer::AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params)
3660-{
3661- JackDriverInfo* info = new JackDriverInfo();
3662- JackDriverClientInterface* slave = info->Open(driver_desc, fEngine, GetSynchroTable(), driver_params);
3663- if (slave == NULL) {
3664- delete info;
3665- return NULL;
3666- }
3667- slave->Attach();
3668- slave->SetMaster(false);
3669- fAudioDriver->AddSlave(slave);
3670- return info;
3671-}
3672-
3673-void JackServer::RemoveSlave(JackDriverInfo* info)
3674-{
3675- JackDriverClientInterface* slave = info->GetBackend();
3676- fAudioDriver->RemoveSlave(slave);
3677- slave->Detach();
3678- slave->Close();
3679-}
3680-
3681-int JackServer::SwitchMaster(jack_driver_desc_t* driver_desc, JSList* driver_params)
3682-{
3683- /// Remove current master
3684- fAudioDriver->Stop();
3685- fAudioDriver->Detach();
3686- fAudioDriver->Close();
3687-
3688- // Open new master
3689- JackDriverInfo* info = new JackDriverInfo();
3690- JackDriverClientInterface* master = info->Open(driver_desc, fEngine, GetSynchroTable(), driver_params);
3691-
3692- if (master == NULL) {
3693- delete info;
3694- return -1;
3695- }
3696-
3697- // Get slaves list
3698- std::list<JackDriverInterface*> slave_list = fAudioDriver->GetSlaves();
3699- std::list<JackDriverInterface*>::const_iterator it;
3700-
3701- // Move slaves in new master
3702- for (it = slave_list.begin(); it != slave_list.end(); it++) {
3703- JackDriverInterface* slave = *it;
3704- master->AddSlave(slave);
3705- }
3706-
3707- // Delete old master
3708- delete fDriverInfo;
3709-
3710- // Activate master
3711- fAudioDriver = master;
3712- fDriverInfo = info;
3713- fAudioDriver->Attach();
3714- fAudioDriver->SetMaster(true);
3715- return fAudioDriver->Start();
3716-}
3717-
3718-//----------------------
3719-// Transport management
3720-//----------------------
3721-
3722-int JackServer::ReleaseTimebase(int refnum)
3723-{
3724- return fEngineControl->fTransport.ResetTimebase(refnum);
3725-}
3726-
3727-int JackServer::SetTimebaseCallback(int refnum, int conditional)
3728-{
3729- return fEngineControl->fTransport.SetTimebaseMaster(refnum, conditional);
3730-}
3731-
3732-JackLockedEngine* JackServer::GetEngine()
3733-{
3734- return fEngine;
3735-}
3736-
3737-JackSynchro* JackServer::GetSynchroTable()
3738-{
3739- return fSynchroTable;
3740-}
3741-
3742-JackEngineControl* JackServer::GetEngineControl()
3743-{
3744- return fEngineControl;
3745-}
3746-
3747-JackGraphManager* JackServer::GetGraphManager()
3748-{
3749- return fGraphManager;
3750-}
3751-
3752-
3753-} // end of namespace
3754-
3755
3756=== removed file '.pc/no-selfconnect.patch/common/JackServer.h'
3757--- .pc/no-selfconnect.patch/common/JackServer.h 2011-03-31 13:54:50 +0000
3758+++ .pc/no-selfconnect.patch/common/JackServer.h 1970-01-01 00:00:00 +0000
3759@@ -1,106 +0,0 @@
3760-/*
3761-Copyright (C) 2001 Paul Davis
3762-Copyright (C) 2004-2008 Grame
3763-
3764-This program is free software; you can redistribute it and/or modify
3765-it under the terms of the GNU General Public License as published by
3766-the Free Software Foundation; either version 2 of the License, or
3767-(at your option) any later version.
3768-
3769-This program is distributed in the hope that it will be useful,
3770-but WITHOUT ANY WARRANTY; without even the implied warranty of
3771-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3772-GNU General Public License for more details.
3773-
3774-You should have received a copy of the GNU General Public License
3775-along with this program; if not, write to the Free Software
3776-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3777-
3778-*/
3779-
3780-#ifndef __JackServer__
3781-#define __JackServer__
3782-
3783-#include "JackCompilerDeps.h"
3784-#include "driver_interface.h"
3785-#include "JackDriverLoader.h"
3786-#include "JackConnectionManager.h"
3787-#include "JackGlobals.h"
3788-#include "JackPlatformPlug.h"
3789-#include "jslist.h"
3790-
3791-namespace Jack
3792-{
3793-
3794-class JackGraphManager;
3795-class JackDriverClientInterface;
3796-struct JackEngineControl;
3797-class JackLockedEngine;
3798-class JackLoadableInternalClient;
3799-
3800-/*!
3801-\brief The Jack server.
3802-*/
3803-
3804-class SERVER_EXPORT JackServer
3805-{
3806-
3807- private:
3808-
3809- JackDriverInfo* fDriverInfo;
3810- JackDriverClientInterface* fAudioDriver;
3811- JackDriverClientInterface* fFreewheelDriver;
3812- JackDriverClientInterface* fThreadedFreewheelDriver;
3813- JackLockedEngine* fEngine;
3814- JackEngineControl* fEngineControl;
3815- JackGraphManager* fGraphManager;
3816- JackServerChannel fChannel;
3817- JackConnectionManager fConnectionState;
3818- JackSynchro fSynchroTable[CLIENT_NUM];
3819- bool fFreewheel;
3820-
3821- int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status);
3822-
3823- public:
3824-
3825- JackServer(bool sync, bool temporary, int timeout, bool rt, int priority, int port_max, bool verbose, jack_timer_type_t clock, const char* server_name);
3826- ~JackServer();
3827-
3828- int Open(jack_driver_desc_t* driver_desc, JSList* driver_params);
3829- int Close();
3830-
3831- int Start();
3832- int Stop();
3833- bool IsRunning();
3834-
3835- // RT thread
3836- void Notify(int refnum, int notify, int value);
3837-
3838- // Command thread : API
3839- int SetBufferSize(jack_nframes_t buffer_size);
3840- int SetFreewheel(bool onoff);
3841- int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status);
3842- int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status);
3843- void ClientKill(int refnum);
3844-
3845- // Transport management
3846- int ReleaseTimebase(int refnum);
3847- int SetTimebaseCallback(int refnum, int conditional);
3848-
3849- // Backend management
3850- JackDriverInfo* AddSlave(jack_driver_desc_t* driver_desc, JSList* driver_params);
3851- void RemoveSlave(JackDriverInfo* info);
3852- int SwitchMaster(jack_driver_desc_t* driver_desc, JSList* driver_params);
3853-
3854- // Object access
3855- JackLockedEngine* GetEngine();
3856- JackEngineControl* GetEngineControl();
3857- JackSynchro* GetSynchroTable();
3858- JackGraphManager* GetGraphManager();
3859-
3860-};
3861-
3862-} // end of namespace
3863-
3864-
3865-#endif
3866
3867=== removed file '.pc/no-selfconnect.patch/common/JackServerGlobals.cpp'
3868--- .pc/no-selfconnect.patch/common/JackServerGlobals.cpp 2011-03-31 13:54:50 +0000
3869+++ .pc/no-selfconnect.patch/common/JackServerGlobals.cpp 1970-01-01 00:00:00 +0000
3870@@ -1,416 +0,0 @@
3871-/*
3872-Copyright (C) 2005 Grame
3873-
3874-This program is free software; you can redistribute it and/or modify
3875-it under the terms of the GNU General Public License as published by
3876-the Free Software Foundation; either version 2 of the License, or
3877-(at your option) any later version.
3878-
3879-This program is distributed in the hope that it will be useful,
3880-but WITHOUT ANY WARRANTY; without even the implied warranty of
3881-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3882-GNU General Public License for more details.
3883-
3884-You should have received a copy of the GNU General Public License
3885-along with this program; if not, write to the Free Software
3886-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3887-
3888-*/
3889-
3890-#include "JackServerGlobals.h"
3891-#include "JackLockedEngine.h"
3892-#include "JackTools.h"
3893-#include "shm.h"
3894-#include <getopt.h>
3895-#include <errno.h>
3896-
3897-static char* server_name = NULL;
3898-
3899-namespace Jack
3900-{
3901-
3902-JackServer* JackServerGlobals::fInstance;
3903-unsigned int JackServerGlobals::fUserCount;
3904-int JackServerGlobals::fRTNotificationSocket;
3905-std::map<std::string, JackDriverInfo*> JackServerGlobals::fSlavesList;
3906-std::map<std::string, int> JackServerGlobals::fInternalsList;
3907-
3908-bool (* JackServerGlobals::on_device_acquire)(const char * device_name) = NULL;
3909-void (* JackServerGlobals::on_device_release)(const char * device_name) = NULL;
3910-
3911-int JackServerGlobals::Start(const char* server_name,
3912- jack_driver_desc_t* driver_desc,
3913- JSList* driver_params,
3914- int sync,
3915- int temporary,
3916- int time_out_ms,
3917- int rt,
3918- int priority,
3919- int port_max,
3920- int verbose,
3921- jack_timer_type_t clock)
3922-{
3923- jack_log("Jackdmp: sync = %ld timeout = %ld rt = %ld priority = %ld verbose = %ld ", sync, time_out_ms, rt, priority, verbose);
3924- new JackServer(sync, temporary, time_out_ms, rt, priority, port_max, verbose, clock, server_name); // Will setup fInstance and fUserCount globals
3925- int res = fInstance->Open(driver_desc, driver_params);
3926- return (res < 0) ? res : fInstance->Start();
3927-}
3928-
3929-void JackServerGlobals::Stop()
3930-{
3931- jack_log("Jackdmp: server close");
3932- fInstance->Stop();
3933- fInstance->Close();
3934-}
3935-
3936-void JackServerGlobals::Delete()
3937-{
3938- jack_log("Jackdmp: delete server");
3939-
3940- // Slave drivers
3941- std::map<std::string, JackDriverInfo*>::iterator it1;
3942- for (it1 = fSlavesList.begin(); it1 != fSlavesList.end(); it1++) {
3943- JackDriverInfo* info = (*it1).second;
3944- if (info) {
3945- fInstance->RemoveSlave((info));
3946- delete (info);
3947- }
3948- }
3949- fSlavesList.clear();
3950-
3951- // Internal clients
3952- std::map<std::string, int> ::iterator it2;
3953- for (it2 = fInternalsList.begin(); it2 != fInternalsList.end(); it2++) {
3954- int status;
3955- int refnum = (*it2).second;
3956- if (refnum > 0) {
3957- // Client object is internally kept in JackEngine, and will be desallocated in InternalClientUnload
3958- fInstance->GetEngine()->InternalClientUnload(refnum, &status);
3959- }
3960- }
3961- fInternalsList.clear();
3962-
3963- delete fInstance;
3964- fInstance = NULL;
3965-}
3966-
3967-bool JackServerGlobals::Init()
3968-{
3969- int realtime = 0;
3970- int client_timeout = 0; /* msecs; if zero, use period size. */
3971- int realtime_priority = 10;
3972- int verbose_aux = 0;
3973- int do_mlock = 1;
3974- unsigned int port_max = 128;
3975- int do_unlock = 0;
3976- int temporary = 0;
3977-
3978- int opt = 0;
3979- int option_index = 0;
3980- char *master_driver_name = NULL;
3981- char **master_driver_args = NULL;
3982- JSList* master_driver_params = NULL;
3983- jack_driver_desc_t* driver_desc;
3984- jack_timer_type_t clock_source = JACK_TIMER_SYSTEM_CLOCK;
3985- int driver_nargs = 1;
3986- JSList* drivers = NULL;
3987- int loopback = 0;
3988- int sync = 0;
3989- int rc, i;
3990- int ret;
3991- int replace_registry = 0;
3992-
3993- FILE* fp = 0;
3994- char filename[255];
3995- char buffer[255];
3996- int argc = 0;
3997- char* argv[32];
3998-
3999- // First user starts the server
4000- if (fUserCount++ == 0) {
4001-
4002- jack_log("JackServerGlobals Init");
4003-
4004- const char *options = "-d:X:I:P:uvshVrRL:STFl:t:mn:p:"
4005- #ifdef __linux__
4006- "c:"
4007- #endif
4008- ;
4009-
4010- struct option long_options[] = {
4011- #ifdef __linux__
4012- { "clock-source", 1, 0, 'c' },
4013- #endif
4014- { "loopback-driver", 1, 0, 'L' },
4015- { "audio-driver", 1, 0, 'd' },
4016- { "midi-driver", 1, 0, 'X' },
4017- { "internal-client", 1, 0, 'I' },
4018- { "verbose", 0, 0, 'v' },
4019- { "help", 0, 0, 'h' },
4020- { "port-max", 1, 0, 'p' },
4021- { "no-mlock", 0, 0, 'm' },
4022- { "name", 1, 0, 'n' },
4023- { "unlock", 0, 0, 'u' },
4024- { "realtime", 0, 0, 'R' },
4025- { "no-realtime", 0, 0, 'r' },
4026- { "replace-registry", 0, &replace_registry, 0 },
4027- { "loopback", 0, 0, 'L' },
4028- { "realtime-priority", 1, 0, 'P' },
4029- { "timeout", 1, 0, 't' },
4030- { "temporary", 0, 0, 'T' },
4031- { "version", 0, 0, 'V' },
4032- { "silent", 0, 0, 's' },
4033- { "sync", 0, 0, 'S' },
4034- { 0, 0, 0, 0 }
4035- };
4036-
4037- snprintf(filename, 255, "%s/.jackdrc", getenv("HOME"));
4038- fp = fopen(filename, "r");
4039-
4040- if (!fp) {
4041- fp = fopen("/etc/jackdrc", "r");
4042- }
4043- // if still not found, check old config name for backwards compatability
4044- if (!fp) {
4045- fp = fopen("/etc/jackd.conf", "r");
4046- }
4047-
4048- argc = 0;
4049- if (fp) {
4050- ret = fscanf(fp, "%s", buffer);
4051- while (ret != 0 && ret != EOF) {
4052- argv[argc] = (char*)malloc(64);
4053- strcpy(argv[argc], buffer);
4054- ret = fscanf(fp, "%s", buffer);
4055- argc++;
4056- }
4057- fclose(fp);
4058- }
4059-
4060- /*
4061- For testing
4062- int argc = 15;
4063- char* argv[] = {"jackdmp", "-R", "-v", "-d", "coreaudio", "-p", "512", "-d", "~:Aggregate:0", "-r", "48000", "-i", "2", "-o", "2" };
4064- */
4065-
4066- opterr = 0;
4067- optind = 1; // Important : to reset argv parsing
4068-
4069- while (!master_driver_name &&
4070- (opt = getopt_long(argc, argv, options, long_options, &option_index)) != EOF) {
4071-
4072- switch (opt) {
4073-
4074- case 'c':
4075- if (tolower (optarg[0]) == 'h') {
4076- clock_source = JACK_TIMER_HPET;
4077- } else if (tolower (optarg[0]) == 'c') {
4078- clock_source = JACK_TIMER_CYCLE_COUNTER;
4079- } else if (tolower (optarg[0]) == 's') {
4080- clock_source = JACK_TIMER_SYSTEM_CLOCK;
4081- } else {
4082- jack_error("unknown option character %c", optopt);
4083- }
4084- break;
4085-
4086- case 'd':
4087- master_driver_name = optarg;
4088- break;
4089-
4090- case 'L':
4091- loopback = atoi(optarg);
4092- break;
4093-
4094- case 'X':
4095- fSlavesList[optarg] = NULL;
4096- break;
4097-
4098- case 'I':
4099- fInternalsList[optarg] = -1;
4100- break;
4101-
4102- case 'p':
4103- port_max = (unsigned int)atol(optarg);
4104- break;
4105-
4106- case 'm':
4107- do_mlock = 0;
4108- break;
4109-
4110- case 'u':
4111- do_unlock = 1;
4112- break;
4113-
4114- case 'v':
4115- verbose_aux = 1;
4116- break;
4117-
4118- case 'S':
4119- sync = 1;
4120- break;
4121-
4122- case 'n':
4123- server_name = optarg;
4124- break;
4125-
4126- case 'P':
4127- realtime_priority = atoi(optarg);
4128- break;
4129-
4130- case 'r':
4131- realtime = 0;
4132- break;
4133-
4134- case 'R':
4135- realtime = 1;
4136- break;
4137-
4138- case 'T':
4139- temporary = 1;
4140- break;
4141-
4142- case 't':
4143- client_timeout = atoi(optarg);
4144- break;
4145-
4146- default:
4147- jack_error("unknown option character %c", optopt);
4148- break;
4149- }
4150- }
4151-
4152- drivers = jack_drivers_load(drivers);
4153- if (!drivers) {
4154- jack_error("jackdmp: no drivers found; exiting");
4155- goto error;
4156- }
4157-
4158- driver_desc = jack_find_driver_descriptor(drivers, master_driver_name);
4159- if (!driver_desc) {
4160- jack_error("jackdmp: unknown master driver '%s'", master_driver_name);
4161- goto error;
4162- }
4163-
4164- if (optind < argc) {
4165- driver_nargs = 1 + argc - optind;
4166- } else {
4167- driver_nargs = 1;
4168- }
4169-
4170- if (driver_nargs == 0) {
4171- jack_error("No driver specified ... hmm. JACK won't do"
4172- " anything when run like this.");
4173- goto error;
4174- }
4175-
4176- master_driver_args = (char**)malloc(sizeof(char*) * driver_nargs);
4177- master_driver_args[0] = master_driver_name;
4178-
4179- for (i = 1; i < driver_nargs; i++) {
4180- master_driver_args[i] = argv[optind++];
4181- }
4182-
4183- if (jack_parse_driver_params(driver_desc, driver_nargs, master_driver_args, &master_driver_params)) {
4184- goto error;
4185- }
4186-
4187-#ifndef WIN32
4188- if (server_name == NULL)
4189- server_name = (char*)JackTools::DefaultServerName();
4190-#endif
4191-
4192- rc = jack_register_server(server_name, false);
4193- switch (rc) {
4194- case EEXIST:
4195- jack_error("`%s' server already active", server_name);
4196- goto error;
4197- case ENOSPC:
4198- jack_error("too many servers already active");
4199- goto error;
4200- case ENOMEM:
4201- jack_error("no access to shm registry");
4202- goto error;
4203- default:
4204- jack_info("server `%s' registered", server_name);
4205- }
4206-
4207- /* clean up shared memory and files from any previous instance of this server name */
4208- jack_cleanup_shm();
4209- JackTools::CleanupFiles(server_name);
4210-
4211- if (!realtime && client_timeout == 0)
4212- client_timeout = 500; /* 0.5 sec; usable when non realtime. */
4213-
4214- for (i = 0; i < argc; i++) {
4215- free(argv[i]);
4216- }
4217-
4218- int res = Start(server_name, driver_desc, master_driver_params, sync, temporary, client_timeout, realtime, realtime_priority, port_max, verbose_aux, clock_source);
4219- if (res < 0) {
4220- jack_error("Cannot start server... exit");
4221- Delete();
4222- jack_cleanup_shm();
4223- JackTools::CleanupFiles(server_name);
4224- jack_unregister_server(server_name);
4225- goto error;
4226- }
4227-
4228- // Slave drivers
4229- std::map<std::string, JackDriverInfo*>::iterator it1;
4230- for (it1 = fSlavesList.begin(); it1 != fSlavesList.end(); it1++) {
4231- const char* name = ((*it1).first).c_str();
4232- driver_desc = jack_find_driver_descriptor(drivers, name);
4233- if (!driver_desc) {
4234- jack_error("jackdmp: unknown slave driver '%s'", name);
4235- } else {
4236- (*it1).second = fInstance->AddSlave(driver_desc, NULL);
4237- }
4238- }
4239-
4240- // Loopback driver
4241- if (loopback > 0) {
4242- driver_desc = jack_find_driver_descriptor(drivers, "loopback");
4243- if (!driver_desc) {
4244- jack_error("jackdmp: unknown driver '%s'", "loopback");
4245- } else {
4246- fSlavesList["loopback"] = fInstance->AddSlave(driver_desc, NULL);
4247- }
4248- }
4249-
4250- // Internal clients
4251- std::map<std::string, int>::iterator it2;
4252- for (it2 = fInternalsList.begin(); it2 != fInternalsList.end(); it2++) {
4253- int status, refnum;
4254- const char* name = ((*it2).first).c_str();
4255- fInstance->InternalClientLoad2(name, name, NULL, JackNullOption, &refnum, -1, &status);
4256- (*it2).second = refnum;
4257- }
4258- }
4259-
4260- if (master_driver_params)
4261- jack_free_driver_params(master_driver_params);
4262- return true;
4263-
4264-error:
4265- jack_log("JackServerGlobals Init error");
4266- if (master_driver_params)
4267- jack_free_driver_params(master_driver_params);
4268- Destroy();
4269- return false;
4270-}
4271-
4272-void JackServerGlobals::Destroy()
4273-{
4274- if (--fUserCount == 0) {
4275- jack_log("JackServerGlobals Destroy");
4276- Stop();
4277- Delete();
4278- jack_cleanup_shm();
4279- JackTools::CleanupFiles(server_name);
4280- jack_unregister_server(server_name);
4281- }
4282-}
4283-
4284-} // end of namespace
4285-
4286-
4287
4288=== removed file '.pc/no-selfconnect.patch/common/JackServerGlobals.h'
4289--- .pc/no-selfconnect.patch/common/JackServerGlobals.h 2011-03-31 13:54:50 +0000
4290+++ .pc/no-selfconnect.patch/common/JackServerGlobals.h 1970-01-01 00:00:00 +0000
4291@@ -1,72 +0,0 @@
4292-/*
4293-Copyright (C) 2005 Grame
4294-
4295-This program is free software; you can redistribute it and/or modify
4296-it under the terms of the GNU General Public License as published by
4297-the Free Software Foundation; either version 2 of the License, or
4298-(at your option) any later version.
4299-
4300-This program is distributed in the hope that it will be useful,
4301-but WITHOUT ANY WARRANTY; without even the implied warranty of
4302-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4303-GNU General Public License for more details.
4304-
4305-You should have received a copy of the GNU General Public License
4306-along with this program; if not, write to the Free Software
4307-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4308-
4309-*/
4310-
4311-#ifndef __JackServerGlobals__
4312-#define __JackServerGlobals__
4313-
4314-#include "driver_interface.h"
4315-#include "JackDriverLoader.h"
4316-#include "JackCompilerDeps.h"
4317-#include "JackServer.h"
4318-#include <map>
4319-
4320-namespace Jack
4321-{
4322-
4323-class JackClient;
4324-
4325-/*!
4326-\brief Global server static structure: singleton kind of pattern.
4327-*/
4328-
4329-struct SERVER_EXPORT JackServerGlobals
4330-{
4331- static JackServer* fInstance;
4332- static unsigned int fUserCount;
4333- static int fRTNotificationSocket; // For debugging purpose
4334- static std::map<std::string, JackDriverInfo*> fSlavesList;
4335- static std::map<std::string, int> fInternalsList;
4336-
4337- static bool (* on_device_acquire)(const char* device_name);
4338- static void (* on_device_release)(const char* device_name);
4339-
4340- JackServerGlobals();
4341- ~JackServerGlobals();
4342-
4343- static bool Init();
4344- static void Destroy();
4345- static int Start(const char* server_name,
4346- jack_driver_desc_t* driver_desc,
4347- JSList* driver_params,
4348- int sync,
4349- int temporary,
4350- int time_out_ms,
4351- int rt,
4352- int priority,
4353- int port_max,
4354- int verbose,
4355- jack_timer_type_t clock);
4356- static void Stop();
4357- static void Delete();
4358-};
4359-
4360-} // end of namespace
4361-
4362-#endif
4363-
4364
4365=== removed file '.pc/no-selfconnect.patch/common/JackTypes.h'
4366--- .pc/no-selfconnect.patch/common/JackTypes.h 2011-03-31 13:54:50 +0000
4367+++ .pc/no-selfconnect.patch/common/JackTypes.h 1970-01-01 00:00:00 +0000
4368@@ -1,58 +0,0 @@
4369-/*
4370- Copyright (C) 2001 Paul Davis
4371-
4372- This program is free software; you can redistribute it and/or modify
4373- it under the terms of the GNU Lesser General Public License as published by
4374- the Free Software Foundation; either version 2.1 of the License, or
4375- (at your option) any later version.
4376-
4377- This program is distributed in the hope that it will be useful,
4378- but WITHOUT ANY WARRANTY; without even the implied warranty of
4379- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4380- GNU Lesser General Public License for more details.
4381-
4382- You should have received a copy of the GNU Lesser General Public License
4383- along with this program; if not, write to the Free Software
4384- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4385-
4386- $Id: JackTypes.h,v 1.2.2.1 2006/06/20 14:44:00 letz Exp $
4387-*/
4388-
4389-#ifndef __JackTypes__
4390-#define __JackTypes__
4391-
4392-#include "JackCompilerDeps.h"
4393-
4394-typedef unsigned short UInt16;
4395-#if __LP64__
4396-typedef unsigned int UInt32;
4397-typedef signed int SInt32;
4398-#else
4399-typedef unsigned long UInt32;
4400-typedef signed long SInt32;
4401-#endif
4402-
4403-#include "JackTypes_os.h"
4404-
4405-/**
4406- * Type used to represent the value of free running
4407- * monotonic clock with units of microseconds.
4408- */
4409-typedef uint64_t jack_time_t;
4410-
4411-typedef uint16_t jack_int_t; // Internal type for ports and refnum
4412-
4413-typedef enum {
4414- JACK_TIMER_SYSTEM_CLOCK,
4415- JACK_TIMER_CYCLE_COUNTER,
4416- JACK_TIMER_HPET,
4417-} jack_timer_type_t;
4418-
4419-typedef enum {
4420- NotTriggered,
4421- Triggered,
4422- Running,
4423- Finished,
4424-} jack_client_state_t;
4425-
4426-#endif
4427
4428=== removed file '.pc/no-selfconnect.patch/common/Jackdmp.cpp'
4429--- .pc/no-selfconnect.patch/common/Jackdmp.cpp 2011-03-31 13:54:50 +0000
4430+++ .pc/no-selfconnect.patch/common/Jackdmp.cpp 1970-01-01 00:00:00 +0000
4431@@ -1,534 +0,0 @@
4432-/*
4433-Copyright (C) 2001 Paul Davis
4434-Copyright (C) 2004-2008 Grame
4435-
4436-This program is free software; you can redistribute it and/or modify
4437-it under the terms of the GNU General Public License as published by
4438-the Free Software Foundation; either version 2 of the License, or
4439-(at your option) any later version.
4440-
4441-This program is distributed in the hope that it will be useful,
4442-but WITHOUT ANY WARRANTY; without even the implied warranty of
4443-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4444-GNU General Public License for more details.
4445-
4446-You should have received a copy of the GNU General Public License
4447-along with this program; if not, write to the Free Software
4448-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4449-
4450-*/
4451-
4452-#include <iostream>
4453-#include <assert.h>
4454-#include <cassert>
4455-#include <csignal>
4456-#include <sys/types.h>
4457-#include <getopt.h>
4458-#include <cstring>
4459-#include <cstdio>
4460-#include <list>
4461-
4462-#include "types.h"
4463-#include "jack.h"
4464-#include "JackConstants.h"
4465-#include "JackDriverLoader.h"
4466-
4467-#if defined(JACK_DBUS) && defined(__linux__)
4468-#include <dbus/dbus.h>
4469-#include "audio_reserve.h"
4470-#endif
4471-
4472-/*
4473-This is a simple port of the old jackdmp.cpp file to use the new Jack 2.0 control API. Available options for the server
4474-are "hard-coded" in the source. A much better approach would be to use the control API to:
4475-- dynamically retrieve available server parameters and then prepare to parse them
4476-- get available drivers and their possible parameters, then prepare to parse them.
4477-*/
4478-
4479-#ifdef __APPLE__
4480-#include <CoreFoundation/CFNotificationCenter.h>
4481-#include <CoreFoundation/CoreFoundation.h>
4482-
4483-static void notify_server_start(const char* server_name)
4484-{
4485- // Send notification to be used in the JackRouter plugin
4486- CFStringRef ref = CFStringCreateWithCString(NULL, server_name, kCFStringEncodingMacRoman);
4487- CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterGetDistributedCenter(),
4488- CFSTR("com.grame.jackserver.start"),
4489- ref,
4490- NULL,
4491- kCFNotificationDeliverImmediately | kCFNotificationPostToAllSessions);
4492- CFRelease(ref);
4493-}
4494-
4495-static void notify_server_stop(const char* server_name)
4496-{
4497- // Send notification to be used in the JackRouter plugin
4498- CFStringRef ref1 = CFStringCreateWithCString(NULL, server_name, kCFStringEncodingMacRoman);
4499- CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterGetDistributedCenter(),
4500- CFSTR("com.grame.jackserver.stop"),
4501- ref1,
4502- NULL,
4503- kCFNotificationDeliverImmediately | kCFNotificationPostToAllSessions);
4504- CFRelease(ref1);
4505-}
4506-
4507-#else
4508-
4509-static void notify_server_start(const char* server_name)
4510-{}
4511-static void notify_server_stop(const char* server_name)
4512-{}
4513-
4514-#endif
4515-
4516-static void copyright(FILE* file)
4517-{
4518- fprintf(file, "jackdmp " VERSION "\n"
4519- "Copyright 2001-2005 Paul Davis and others.\n"
4520- "Copyright 2004-2011 Grame.\n"
4521- "jackdmp comes with ABSOLUTELY NO WARRANTY\n"
4522- "This is free software, and you are welcome to redistribute it\n"
4523- "under certain conditions; see the file COPYING for details\n");
4524-}
4525-
4526-static void usage(FILE* file)
4527-{
4528- fprintf(file, "\n"
4529- "usage: jackdmp [ --no-realtime OR -r ]\n"
4530- " [ --realtime OR -R [ --realtime-priority OR -P priority ] ]\n"
4531- " (the two previous arguments are mutually exclusive. The default is --realtime)\n"
4532- " [ --name OR -n server-name ]\n"
4533- " [ --timeout OR -t client-timeout-in-msecs ]\n"
4534- " [ --loopback OR -L loopback-port-number ]\n"
4535- " [ --port-max OR -p maximum-number-of-ports]\n"
4536- " [ --slave-backend OR -X slave-backend-name ]\n"
4537- " [ --internal-client OR -I internal-client-name ]\n"
4538- " [ --verbose OR -v ]\n"
4539-#ifdef __linux__
4540- " [ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]\n"
4541-#endif
4542- " [ --replace-registry ]\n"
4543- " [ --silent OR -s ]\n"
4544- " [ --sync OR -S ]\n"
4545- " [ --temporary OR -T ]\n"
4546- " [ --version OR -V ]\n"
4547- " -d master-backend-name [ ... master-backend args ... ]\n"
4548-#ifdef __APPLE__
4549- " Available master backends may include: coreaudio, dummy or net.\n\n"
4550-#endif
4551-#ifdef WIN32
4552- " Available master backends may include: portaudio, dummy or net.\n\n"
4553-#endif
4554-#ifdef __linux__
4555- " Available master backends may include: alsa, dummy, freebob, firewire or net\n\n"
4556-#endif
4557-#if defined(__sun__) || defined(sun)
4558- " Available master backends may include: boomer, oss, dummy or net.\n\n"
4559-#endif
4560- " jackdmp -d master-backend-name --help\n"
4561- " to display options for each master backend\n\n");
4562-}
4563-
4564-// To put in the control.h interface??
4565-static jackctl_driver_t *
4566-jackctl_server_get_driver(
4567- jackctl_server_t *server,
4568- const char *driver_name)
4569-{
4570- const JSList * node_ptr;
4571-
4572- node_ptr = jackctl_server_get_drivers_list(server);
4573-
4574- while (node_ptr)
4575- {
4576- if (strcmp(jackctl_driver_get_name((jackctl_driver_t *)node_ptr->data), driver_name) == 0)
4577- {
4578- return (jackctl_driver_t *)node_ptr->data;
4579- }
4580-
4581- node_ptr = jack_slist_next(node_ptr);
4582- }
4583-
4584- return NULL;
4585-}
4586-
4587-static jackctl_internal_t * jackctl_server_get_internal(jackctl_server_t *server, const char *internal_name)
4588-{
4589- const JSList * node_ptr = jackctl_server_get_internals_list(server);
4590-
4591- while (node_ptr) {
4592- if (strcmp(jackctl_internal_get_name((jackctl_internal_t *)node_ptr->data), internal_name) == 0) {
4593- return (jackctl_internal_t *)node_ptr->data;
4594- }
4595- node_ptr = jack_slist_next(node_ptr);
4596- }
4597-
4598- return NULL;
4599-}
4600-
4601-static jackctl_parameter_t *
4602-jackctl_get_parameter(
4603- const JSList * parameters_list,
4604- const char * parameter_name)
4605-{
4606- while (parameters_list)
4607- {
4608- if (strcmp(jackctl_parameter_get_name((jackctl_parameter_t *)parameters_list->data), parameter_name) == 0)
4609- {
4610- return (jackctl_parameter_t *)parameters_list->data;
4611- }
4612-
4613- parameters_list = jack_slist_next(parameters_list);
4614- }
4615-
4616- return NULL;
4617-}
4618-
4619-int main(int argc, char* argv[])
4620-{
4621- jackctl_server_t * server_ctl;
4622- const JSList * server_parameters;
4623- const char* server_name = "default";
4624- jackctl_driver_t * master_driver_ctl;
4625- jackctl_driver_t * loopback_driver_ctl;
4626- int replace_registry = 0;
4627-
4628- const char *options = "-d:X:I:P:uvshVrRL:STFl:t:mn:p:"
4629-#ifdef __linux__
4630- "c:"
4631-#endif
4632- ;
4633-
4634- struct option long_options[] = {
4635-#ifdef __linux__
4636- { "clock-source", 1, 0, 'c' },
4637-#endif
4638- { "loopback-driver", 1, 0, 'L' },
4639- { "audio-driver", 1, 0, 'd' },
4640- { "midi-driver", 1, 0, 'X' },
4641- { "internal-client", 1, 0, 'I' },
4642- { "verbose", 0, 0, 'v' },
4643- { "help", 0, 0, 'h' },
4644- { "port-max", 1, 0, 'p' },
4645- { "no-mlock", 0, 0, 'm' },
4646- { "name", 1, 0, 'n' },
4647- { "unlock", 0, 0, 'u' },
4648- { "realtime", 0, 0, 'R' },
4649- { "no-realtime", 0, 0, 'r' },
4650- { "replace-registry", 0, &replace_registry, 0 },
4651- { "loopback", 0, 0, 'L' },
4652- { "realtime-priority", 1, 0, 'P' },
4653- { "timeout", 1, 0, 't' },
4654- { "temporary", 0, 0, 'T' },
4655- { "version", 0, 0, 'V' },
4656- { "silent", 0, 0, 's' },
4657- { "sync", 0, 0, 'S' },
4658- { 0, 0, 0, 0 }
4659- };
4660-
4661- int i,opt = 0;
4662- int option_index = 0;
4663- char* master_driver_name = NULL;
4664- char** master_driver_args = NULL;
4665- int master_driver_nargs = 1;
4666- int do_mlock = 1;
4667- int do_unlock = 0;
4668- int loopback = 0;
4669- bool show_version = false;
4670- sigset_t signals;
4671- jackctl_parameter_t* param;
4672- union jackctl_parameter_value value;
4673-
4674- std::list<char*> internals_list;
4675- std::list<char*> slaves_list;
4676- std::list<char*>::iterator it;
4677-
4678- // Assume that we fail.
4679- int return_value = -1;
4680- bool notify_sent = false;
4681-
4682- copyright(stdout);
4683-#if defined(JACK_DBUS) && defined(__linux__)
4684- server_ctl = jackctl_server_create(audio_acquire, audio_release);
4685-#else
4686- server_ctl = jackctl_server_create(NULL, NULL);
4687-#endif
4688- if (server_ctl == NULL) {
4689- fprintf(stderr, "Failed to create server object\n");
4690- return -1;
4691- }
4692-
4693- server_parameters = jackctl_server_get_parameters(server_ctl);
4694-
4695- // Default setting
4696- param = jackctl_get_parameter(server_parameters, "realtime");
4697- if (param != NULL) {
4698- value.b = true;
4699- jackctl_parameter_set_value(param, &value);
4700- }
4701-
4702- opterr = 0;
4703- while (!master_driver_name &&
4704- (opt = getopt_long(argc, argv, options,
4705- long_options, &option_index)) != EOF) {
4706- switch (opt) {
4707-
4708- #ifdef __linux__
4709- case 'c':
4710- param = jackctl_get_parameter(server_parameters, "clock-source");
4711- if (param != NULL) {
4712- if (tolower (optarg[0]) == 'h') {
4713- value.ui = JACK_TIMER_HPET;
4714- jackctl_parameter_set_value(param, &value);
4715- } else if (tolower (optarg[0]) == 'c') {
4716- value.ui = JACK_TIMER_CYCLE_COUNTER;
4717- jackctl_parameter_set_value(param, &value);
4718- } else if (tolower (optarg[0]) == 's') {
4719- value.ui = JACK_TIMER_SYSTEM_CLOCK;
4720- jackctl_parameter_set_value(param, &value);
4721- } else {
4722- usage(stdout);
4723- goto destroy_server;
4724- }
4725- }
4726- break;
4727- #endif
4728-
4729- case 'd':
4730- master_driver_name = optarg;
4731- break;
4732-
4733- case 'L':
4734- loopback = atoi(optarg);
4735- break;
4736-
4737- case 'X':
4738- slaves_list.push_back(optarg);
4739- break;
4740-
4741- case 'I':
4742- internals_list.push_back(optarg);
4743- break;
4744-
4745- case 'p':
4746- param = jackctl_get_parameter(server_parameters, "port-max");
4747- if (param != NULL) {
4748- value.ui = atoi(optarg);
4749- jackctl_parameter_set_value(param, &value);
4750- }
4751- break;
4752-
4753- case 'm':
4754- do_mlock = 0;
4755- break;
4756-
4757- case 'u':
4758- do_unlock = 1;
4759- break;
4760-
4761- case 'v':
4762- param = jackctl_get_parameter(server_parameters, "verbose");
4763- if (param != NULL) {
4764- value.b = true;
4765- jackctl_parameter_set_value(param, &value);
4766- }
4767- break;
4768-
4769- case 's':
4770- jack_set_error_function(silent_jack_error_callback);
4771- break;
4772-
4773- case 'S':
4774- param = jackctl_get_parameter(server_parameters, "sync");
4775- if (param != NULL) {
4776- value.b = true;
4777- jackctl_parameter_set_value(param, &value);
4778- }
4779- break;
4780-
4781- case 'n':
4782- server_name = optarg;
4783- param = jackctl_get_parameter(server_parameters, "name");
4784- if (param != NULL) {
4785- strncpy(value.str, optarg, JACK_PARAM_STRING_MAX);
4786- jackctl_parameter_set_value(param, &value);
4787- }
4788- break;
4789-
4790- case 'P':
4791- param = jackctl_get_parameter(server_parameters, "realtime-priority");
4792- if (param != NULL) {
4793- value.i = atoi(optarg);
4794- jackctl_parameter_set_value(param, &value);
4795- }
4796- break;
4797-
4798- case 'r':
4799- param = jackctl_get_parameter(server_parameters, "realtime");
4800- if (param != NULL) {
4801- value.b = false;
4802- jackctl_parameter_set_value(param, &value);
4803- }
4804- break;
4805-
4806- case 'R':
4807- param = jackctl_get_parameter(server_parameters, "realtime");
4808- if (param != NULL) {
4809- value.b = true;
4810- jackctl_parameter_set_value(param, &value);
4811- }
4812- break;
4813-
4814- case 'T':
4815- param = jackctl_get_parameter(server_parameters, "temporary");
4816- if (param != NULL) {
4817- value.b = true;
4818- jackctl_parameter_set_value(param, &value);
4819- }
4820- break;
4821-
4822- case 't':
4823- param = jackctl_get_parameter(server_parameters, "client-timeout");
4824- if (param != NULL) {
4825- value.i = atoi(optarg);
4826- jackctl_parameter_set_value(param, &value);
4827- }
4828- break;
4829-
4830- case 'V':
4831- show_version = true;
4832- break;
4833-
4834- default:
4835- fprintf(stderr, "unknown option character %c\n", optopt);
4836- /*fallthru*/
4837-
4838- case 'h':
4839- usage(stdout);
4840- goto destroy_server;
4841- }
4842- }
4843-
4844- // Long option with no letter so treated separately
4845- param = jackctl_get_parameter(server_parameters, "replace-registry");
4846- if (param != NULL) {
4847- value.b = replace_registry;
4848- jackctl_parameter_set_value(param, &value);
4849- }
4850-
4851- if (show_version) {
4852- printf( "jackdmp version " VERSION
4853- " tmpdir " jack_server_dir
4854- " protocol %d"
4855- "\n", JACK_PROTOCOL_VERSION);
4856- return -1;
4857- }
4858-
4859- if (!master_driver_name) {
4860- usage(stderr);
4861- goto destroy_server;
4862- }
4863-
4864- // Master driver
4865- master_driver_ctl = jackctl_server_get_driver(server_ctl, master_driver_name);
4866- if (master_driver_ctl == NULL) {
4867- fprintf(stderr, "Unknown driver \"%s\"\n", master_driver_name);
4868- goto destroy_server;
4869- }
4870-
4871- if (optind < argc) {
4872- master_driver_nargs = 1 + argc - optind;
4873- } else {
4874- master_driver_nargs = 1;
4875- }
4876-
4877- if (master_driver_nargs == 0) {
4878- fprintf(stderr, "No driver specified ... hmm. JACK won't do"
4879- " anything when run like this.\n");
4880- goto destroy_server;
4881- }
4882-
4883- master_driver_args = (char **) malloc(sizeof(char *) * master_driver_nargs);
4884- master_driver_args[0] = master_driver_name;
4885-
4886- for (i = 1; i < master_driver_nargs; i++) {
4887- master_driver_args[i] = argv[optind++];
4888- }
4889-
4890- if (jackctl_parse_driver_params(master_driver_ctl, master_driver_nargs, master_driver_args)) {
4891- goto destroy_server;
4892- }
4893-
4894- // Setup signals
4895- signals = jackctl_setup_signals(0);
4896-
4897- // Open server
4898- if (! jackctl_server_open(server_ctl, master_driver_ctl)) {
4899- fprintf(stderr, "Failed to open server\n");
4900- goto destroy_server;
4901- }
4902-
4903- // Slave drivers
4904- for (it = slaves_list.begin(); it != slaves_list.end(); it++) {
4905- jackctl_driver_t * slave_driver_ctl = jackctl_server_get_driver(server_ctl, *it);
4906- if (slave_driver_ctl == NULL) {
4907- fprintf(stderr, "Unknown driver \"%s\"\n", *it);
4908- goto close_server;
4909- }
4910- jackctl_server_add_slave(server_ctl, slave_driver_ctl);
4911- }
4912-
4913- // Loopback driver
4914- if (loopback > 0) {
4915- loopback_driver_ctl = jackctl_server_get_driver(server_ctl, "loopback");
4916-
4917- // XX: What if this fails?
4918- if (loopback_driver_ctl != NULL) {
4919- const JSList * loopback_parameters = jackctl_driver_get_parameters(loopback_driver_ctl);
4920- param = jackctl_get_parameter(loopback_parameters, "channels");
4921- if (param != NULL) {
4922- value.ui = loopback;
4923- jackctl_parameter_set_value(param, &value);
4924- }
4925- jackctl_server_add_slave(server_ctl, loopback_driver_ctl);
4926- }
4927-
4928- }
4929-
4930- // Start the server
4931- if (!jackctl_server_start(server_ctl)) {
4932- fprintf(stderr, "Failed to start server\n");
4933- goto close_server;
4934- }
4935-
4936- // Internal clients
4937- for (it = internals_list.begin(); it != internals_list.end(); it++) {
4938- jackctl_internal_t * internal_driver_ctl = jackctl_server_get_internal(server_ctl, *it);
4939- if (internal_driver_ctl == NULL) {
4940- fprintf(stderr, "Unknown internal \"%s\"\n", *it);
4941- goto stop_server;
4942- }
4943- jackctl_server_load_internal(server_ctl, internal_driver_ctl);
4944- }
4945-
4946- notify_server_start(server_name);
4947- notify_sent = true;
4948- return_value = 0;
4949-
4950- // Waits for signal
4951- jackctl_wait_signals(signals);
4952-
4953- stop_server:
4954- if (! jackctl_server_stop(server_ctl)) {
4955- fprintf(stderr, "Cannot stop server...\n");
4956- }
4957- if (notify_sent) {
4958- notify_server_stop(server_name);
4959- }
4960- close_server:
4961- jackctl_server_close(server_ctl);
4962- destroy_server:
4963- jackctl_server_destroy(server_ctl);
4964- return return_value;
4965-}
4966
4967=== removed directory '.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6'
4968=== removed directory '.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin'
4969=== removed file '.waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Build.py'
4970--- .waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Build.py 2010-06-19 18:54:29 +0000
4971+++ .waf-1.5.0-8e39a4c1c16303c1e8f010bf330305f6/wafadmin/Build.py 1970-01-01 00:00:00 +0000
4972@@ -1,525 +0,0 @@
4973-#! /usr/bin/env python
4974-# encoding: utf-8
4975-import sys
4976-if sys.hexversion < 0x020400f0: from sets import Set as set
4977-import os,sys,cPickle,types,imp,errno,re,glob,gc,time,shutil
4978-import Runner,TaskGen,Node,Scripting,Utils,Environment,Task,Logs,Options
4979-from Logs import debug,error,info
4980-from Constants import*
4981-SAVED_ATTRS='root srcnode bldnode node_sigs node_deps raw_deps task_sigs id_nodes'.split()
4982-g_modcache={}
4983-bld=None
4984-class BuildError(Utils.WafError):
4985- def __init__(self,b=None,t=[]):
4986- self.bld=b
4987- self.tasks=t
4988- self.ret=1
4989- Utils.WafError.__init__(self,self.format_error())
4990- def format_error(self):
4991- lst=['Build failed']
4992- for tsk in self.tasks:
4993- txt=tsk.format_error()
4994- if txt:lst.append(txt)
4995- return'\n'.join(lst)
4996-class BuildContext(object):
4997- def __init__(self):
4998- global bld
4999- bld=self
5000- self.task_manager=Task.TaskManager()
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: