<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>Happened again, this time slightly different place in my code, so not at jack_port_disconnect() this time, but I am certain it's the same problem:</div><div><br></div><div>    STDERR output from my program:</div><div><br></div><div>Cannot read socket fd = 7 err = Success</div><div>CheckRes error</div><div>JackSocketClientChannel read fail</div><div>Server is not running</div><div><br></div><div>  With a corresponding time stamped log entry in my programs log file:</div><div><br></div><div>Dec 04, 2019 04:57:20 | ars9550 | jack-audio- jackd audio server has gone away: We are shutting down too.</div><div></div><div><br></div><div>    And then my program shuts itself down, as designed.</div><div><br></div><div>     This corresponds to a jack log (~/.log/jack/jackdbus.log) report...</div><div><br></div><div>     Normal operation of my application:</div><div><br></div><div>Wed Dec  4 04:55:54 2019: New client 'arPlayer-3' with PID 13198</div><div>Wed Dec  4 04:55:54 2019: Connecting 'arPlayer-3:ctlOut' to 'ars9550:ctlIn'</div><div>Wed Dec  4 04:55:54 2019: Connecting 'ars9550:ctlOut' to 'arPlayer-3:ctlIn'</div><div>Wed Dec  4 04:55:54 2019: Connecting 'arPlayer-3:Output0' to 'ars9550:In3ch0'</div><div>Wed Dec  4 04:55:54 2019: Connecting 'arPlayer-3:Output1' to 'ars9550:In3ch1'</div><div>Wed Dec  4 04:55:54 2019: Disconnecting 'ars9550:ctlOut' from 'arPlayer-1:ctlIn'</div><div>Wed Dec  4 04:55:54 2019: Disconnecting 'arPlayer-1:ctlOut' from 'ars9550:ctlIn'</div><div>Wed Dec  4 04:55:54 2019: Client 'arPlayer-1' with PID 13145 is out</div><div><br></div><div> Then the trouble... looks like jackd crashed, and UbuntuStudioControl presumably restart it:</div><div><br></div><div>Wed Dec  4 04:57:31 2019: ------------------</div><div>Wed Dec  4 04:57:31 2019: Controller activated. Version 1.9.12 (unknown) built on Mon Jan 14 13:01:07 2019</div><div>Wed Dec  4 04:57:33 2019: Loading settings from "/home/bcaster/.config/jack/conf.xml" using expat_2.2.7 ...</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'engine':'driver':'(null)' to value "alsa"</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'drivers':'alsa':'device' to value "hw:US4x4,0,0"</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'drivers':'alsa':'capture' to value "none"</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'drivers':'alsa':'playback' to value "none"</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'drivers':'alsa':'rate' to value "48000"</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'drivers':'alsa':'period' to value "128"</div><div>Wed Dec  4 04:57:33 2019: setting parameter 'drivers':'alsa':'nperiods' to value "3"</div><div>Wed Dec  4 04:57:33 2019: Listening for D-Bus messages</div><div>Wed Dec  4 04:57:34 2019: Starting jack server...</div><div>Wed Dec  4 04:57:34 2019: JACK server starting in realtime mode with priority 10</div><div>Wed Dec  4 04:57:34 2019: self-connect-mode is "Don't restrict self connect requests"</div><div>Wed Dec  4 04:57:34 2019: Acquired audio card Audio1</div><div>Wed Dec  4 04:57:34 2019: creating alsa driver ... hw:US4x4,0,0|hw:US4x4,0,0|128|3|48000|0|0|nomon|swmeter|-|32bit</div><div>Wed Dec  4 04:57:34 2019: configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods</div><div>Wed Dec  4 04:57:34 2019: ALSA: final selected sample format for capture: 32bit integer little-endian</div><div>Wed Dec  4 04:57:34 2019: ALSA: use 3 periods for capture</div><div>Wed Dec  4 04:57:34 2019: ALSA: final selected sample format for playback: 32bit integer little-endian</div><div>Wed Dec  4 04:57:34 2019: ALSA: use 3 periods for playback</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:capture_1'</div><div>Wed Dec  4 04:57:34 2019: New client 'system' with PID 0</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:capture_2'</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:capture_3'</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:capture_4'</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:playback_1'</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:playback_2'</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:playback_3'</div><div>Wed Dec  4 04:57:34 2019: graph reorder: new port 'system:playback_4'</div><div>Wed Dec  4 04:57:35 2019: Saving settings to "/home/bcaster/.config/jack/conf.xml" ...</div><div>Wed Dec  4 04:57:39 2019: New client 'NVidia,0,0-out' with PID 13374</div><div>Wed Dec  4 04:57:39 2019: New client 'NVidia,0,0-in' with PID 13379</div><div><br></div><div>     Then it crashes and gets run again and crashes, two more</div><div> times every 20 seconds. No further run attempts are made </div><div>      seem to be made to restart jackd for ***exactly** 3 hours, </div><div> and final jackd runs runs and stays running.  My application </div><div>       is long gone:</div><div><br></div><div>Wed Dec  4 07:57:43 2019: ------------------</div><div>Wed Dec  4 07:57:43 2019: Controller activated. Version 1.9.12 (unknown) built on Mon Jan 14 13:01:07 2019</div><div>Wed Dec  4 07:57:43 2019: Loading settings from "/home/bcaster/.config/jack/conf.xml" using expat_2.2.7 ...</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'engine':'driver':'(null)' to value "alsa"</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'drivers':'alsa':'device' to value "hw:US4x4,0,0"</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'drivers':'alsa':'capture' to value "none"</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'drivers':'alsa':'playback' to value "none"</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'drivers':'alsa':'rate' to value "48000"</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'drivers':'alsa':'period' to value "128"</div><div>Wed Dec  4 07:57:43 2019: setting parameter 'drivers':'alsa':'nperiods' to value "3"</div><div>Wed Dec  4 07:57:43 2019: Listening for D-Bus messages</div><div>Wed Dec  4 07:57:43 2019: Starting jack server...</div><div>Wed Dec  4 07:57:43 2019: JACK server starting in realtime mode with priority 10</div><div>Wed Dec  4 07:57:43 2019: self-connect-mode is "Don't restrict self connect requests"</div><div>Wed Dec  4 07:57:43 2019: Acquired audio card Audio1</div><div>Wed Dec  4 07:57:43 2019: creating alsa driver ... hw:US4x4,0,0|hw:US4x4,0,0|128|3|48000|0|0|nomon|swmeter|-|32bit</div><div>Wed Dec  4 07:57:43 2019: configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods</div><div>Wed Dec  4 07:57:43 2019: ALSA: final selected sample format for capture: 32bit integer little-endian</div><div>Wed Dec  4 07:57:43 2019: ALSA: use 3 periods for capture</div><div>Wed Dec  4 07:57:43 2019: ALSA: final selected sample format for playback: 32bit integer little-endian</div><div>Wed Dec  4 07:57:43 2019: ALSA: use 3 periods for playback</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:capture_1'</div><div>Wed Dec  4 07:57:44 2019: New client 'system' with PID 0</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:capture_2'</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:capture_3'</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:capture_4'</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:playback_1'</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:playback_2'</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:playback_3'</div><div>Wed Dec  4 07:57:44 2019: graph reorder: new port 'system:playback_4'</div><div>Wed Dec  4 07:57:45 2019: Saving settings to "/home/bcaster/.config/jack/conf.xml" ...</div><div>Wed Dec  4 07:57:49 2019: New client 'NVidia,0,0-out' with PID 2329</div><div>Wed Dec  4 07:57:49 2019: New client 'NVidia,0,0-in' with PID 2330</div><div><br></div><div>Ubuntu Studio Control is managing jakld in the scenario.  While I can't rule out </div><div>a bug in my program, it doesn't look like it is triggered by my program.  Does </div><div>any one have any idea how I can troubleshoot this further?</div><div><br></div><div>Thanks,</div><div>Ethan...</div><div><br></div><div><br></div><div>On Tue, 2019-11-26 at 13:44 -0700, Ethan Funk wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>Related question then: Any idea what my application could be doing</pre><pre>wrong to cause jack to not get back with a response?  It had been</pre><pre>waiting for about an hour, while I was off doing paying work, and my</pre><pre>applications process function was still being called by jack when I</pre><pre>finally noticed it. My best plan for now is to test again, and wait for</pre><pre>it to happen, then see if I can get another jack program to</pre><pre>connect/disconnect after my program hangs, and check the jack logs</pre><pre>right away.  The jack log file from this test is full of underruns from</pre><pre>my debugging, so that is mostly useless.  Any other debuging approach I</pre><pre>should be taking?  </pre><pre><br></pre><pre>Thanks,</pre><pre>Ethan...</pre><pre><br></pre><pre>On Tue, 2019-11-26 at 10:10 -0700, Paul Davis wrote:</pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>jack clients and the server on linux communicate via reading and</pre><pre>writingthrough a FIFO. there's nothing unusual about read(2) showing</pre><pre>up here - theclient has asked the server for a port disconnect and is</pre><pre>waiting for aresponse.</pre><pre>On Tue, Nov 26, 2019 at 9:45 AM Ethan Funk <</pre><a href="mailto:ethan@redmountainradio.com"><pre>ethan@redmountainradio.com</pre></a><pre>>wrote:</pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>After days of testing, I got a crash (of sorts) out of my program.</pre><pre>More ofa hang than a crash. So I attached gdb to the process and</pre><pre>looked around. Mymain thread appears to be hung deep inside a jack</pre><pre>call, viajack_port_disconnect(). This is a point in my code where</pre><pre>it cleans up afteran jack-attached media player that is done</pre><pre>playing. The player processterminates when it's jack connections</pre><pre>are disconnected. I re-started thecode execution and then stopped</pre><pre>it again to find that the main thread wasstill waiting at the same</pre><pre>libc_read() spot. After taking a look at the jacksource code, I</pre><pre>didn't find that jack_port_disconnect() would result in aread any</pre><pre>place down the jack call chain. To be fair to jack, I am</pre><pre>stillmostly unfamiliar with the library structure, so I could be</pre><pre>missingsomething. Any insight as to what I might be doing wrong?</pre><pre>The port I ampassing to jack_port_disconnect() appears to be valid,</pre><pre>unless my code isoverwriting memory. Backtrace of the main thread</pre><pre>is below.</pre><pre>Thanks all.Ethan...</pre></blockquote></blockquote><pre><br></pre><pre><br></pre><pre>_______________________________________________</pre><pre>Linux-audio-dev mailing list</pre><a href="mailto:Linux-audio-dev@lists.linuxaudio.org"><pre>Linux-audio-dev@lists.linuxaudio.org</pre></a><pre><br></pre><a href="https://lists.linuxaudio.org/listinfo/linux-audio-dev"><pre>https://lists.linuxaudio.org/listinfo/linux-audio-dev</pre></a><pre><br></pre></blockquote></body></html>