Re: Jackdbus and pulse

2013-01-10 Thread David Henningsson

On 01/10/2013 07:54 AM, Len Ovens wrote:


On Wed, January 9, 2013 7:28 pm, David Henningsson wrote:

On 01/10/2013 12:46 AM, Len Ovens wrote:



I have played around with this and there is a hack that will work. This
is
not a fix. When setting up qjackctl, there is a tab called Options. On
that panel there is a line with Execute script on Startup. If this is
enabled and the line:

pasuspender sleep 5 


Interesting; I didn't think this would work, it probably shouldn't -
pasuspender should suspend all sinks, including the JACK sink.

It must be because the JACK sink is created *after* pasuspender starts,
would be the reason why it is not suspended properly.


That is the pre-start script in qjackctl.


Which should be removed/changed, I talked to Kaj about this on IRC a few 
days ago.



The word devices caught my eye. It seemed to mean physical devices not
just backends. Anyway I figured once jack had the device I could unsuspend
pulse and because jack already had it, pulse would not be able to take it
back. That seemed to be true and pulse seemed to feel jack-sink was the
best option to stream audio to. That is why I felt the sleep option should
work fine.


Ah; yes, that's true, pasuspender just runs for a tiny while, not during 
the entire jackd process.



know if pasuspender uses dbus to tell
PA to release HW devices?


It uses PA's native protocol (which in turn uses unix sockets for
communication, and SHM for memory tranfers).


Hmm, ok I can't conclude anything from that then.


To fix it in the right way you need to figure out why this happens in
the first place - I mean, it could be either one of these three:

1) PulseAudio does not release the device before answering on dbus
2) Jackd2 does not wait for dbus answer before opening the device
3) The kernel (or alsa-lib) does not release the device properly before
returning from snd_pcm_close.


It looks like ... 4)


Thanks for looking into it.


Something interesting happens in the jack logfile, The time stamps are not
in order. The logging that qjackctl captures seems to come from different
places (different colours too).

Here is a section of the log where it fails:
(my comments are indented)

17:53:18.689 D-BUS: JACK server could not be started. Sorry
 This looks like the first line, but it is not.
 D-BUS was free to write logs sooner thats all.

 Now we have quite a normal jack startup.
Wed Jan  9 17:53:17 2013: Starting jack server...


If you actually have two instances of jackdbus, shouldn't you have two 
rows of Starting jack server... too?



Wed Jan  9 17:53:18 2013: JACK server starting in realtime mode with
priority 10
Wed Jan  9 17:53:18 2013: control device hw:1
Wed Jan  9 17:53:18 2013: control device hw:1
Wed Jan  9 17:53:18 2013: Acquired audio card Audio1
 Hmm, we just aquired hw:1


Audio1 likely refers to the dbus reservation, whereas hw:1 refers to 
the kernel object.


hw:1 is translated by alsa-lib into /dev/snd/pcmC1D0p (playback), 
/dev/snd/pcmC1D0c (capture), or /dev/snd/controlC1 (mixer). The mixer 
can be opened by several apps simultaneously, but playback and capture 
are for one app at a time.



Wed Jan  9 17:53:18 2013: creating alsa driver ...
hw:1|hw:1|64|2|48000|0|0|nomon|swmeter|-|32bit
Wed Jan  9 17:53:18 2013: control device hw:1
 Up till here it looked good

 Then (no time stamp, I assume this means direct error output from
 Qjackctl as this is the same output I see if I use jack_control.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
 It was running how did it stop?

 Now this looks like a failed start up... device in use. But, jack was
 Already able to acquire it.
Wed Jan  9 17:53:18 2013: ERROR:
ATTENTION: The playback device hw:1 is already in use. Please stop the
application using it and run JACK again


Again notice the difference between Audio1 and hw:1.

It would be interesting to know sudo fuser -v /dev/snd/pcm* at exactly 
this point in time, because it should be unused.



Wed Jan  9 17:53:18 2013: ERROR: Cannot initialize driver
Wed Jan  9 17:53:18 2013: ERROR: JackServer::Open failed with -1
Wed Jan  9 17:53:18 2013: ERROR: Failed to open server
Wed Jan  9 17:53:19 2013: Saving settings to
/home/joe/.config/jack/conf.xml ...
17:53:23.992 Could not connect to JACK server as client. - Overall
operation failed. - Unable to connect to server. Please check the messages
window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

Ok, this is what seems to happen. This is my hypothesis:
- Qjackctl sends a message via DBUS to start jack
- Jack starts and asks for the device.
- pulse gives the device.
- jack gets it.
- DBUS (on it's own or at the asking of qjackctl) checks that jack is
running.

Invitation to Community Council meeting on January 17th

2013-01-10 Thread Elizabeth Krumbach
Greetings Ubuntu Studio folks!

The Community Council has been meeting with teams this cycle to check
in and see if there are any ways the CC can help the teams. Next
Thursday, January 17th, at 17:00 UTC we're inviting the Ubuntu Studio
and Xubuntu team members to our meeting.

https://wiki.ubuntu.com/CommunityCouncilAgenda

This will be held in #ubuntu-meeting, so we welcome any team members
to join us if they can :)

-- 
Elizabeth Krumbach // Lyz // pleia2
http://www.princessleia.com

-- 
Ubuntu-Studio-devel mailing list
Ubuntu-Studio-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-studio-devel


Re: Jackdbus and pulse

2013-01-10 Thread Len Ovens

On Thu, January 10, 2013 12:14 am, David Henningsson wrote:
 On 01/10/2013 07:54 AM, Len Ovens wrote:

 On Wed, January 9, 2013 7:28 pm, David Henningsson wrote:
 On 01/10/2013 12:46 AM, Len Ovens wrote:

 I have played around with this and there is a hack that will work.
 This
 is
 not a fix. When setting up qjackctl, there is a tab called Options.
 On
 that panel there is a line with Execute script on Startup. If this
 is
 enabled and the line:

 pasuspender sleep 5 

 Interesting; I didn't think this would work, it probably shouldn't -
 pasuspender should suspend all sinks, including the JACK sink.

 It must be because the JACK sink is created *after* pasuspender starts,
 would be the reason why it is not suspended properly.

 That is the pre-start script in qjackctl.

 Which should be removed/changed, I talked to Kaj about this on IRC a few
 days ago.

Sorry I may not have been clear. I put it there for testing. I do not
think it is there by default. There are two startup script places
available in qjackctl. One just before the server starts and one after it
is running (for things like a2j or zita-a2j).

 To fix it in the right way you need to figure out why this happens in
 the first place - I mean, it could be either one of these three:

 1) PulseAudio does not release the device before answering on dbus
 2) Jackd2 does not wait for dbus answer before opening the device
 3) The kernel (or alsa-lib) does not release the device properly before
 returning from snd_pcm_close.

 It looks like ... 4)

 Thanks for looking into it.

Sorry I didn't add anything useful. At least I learned something.

As another note, once jack fails, even using pasuspender will not allow
jack to start, I have to do a jack_control exit first... Let me check if a
stop will work...No has to be exit. So jack continues to communicate with
dbus even though it is (semi) crashed.


 It would be interesting to know sudo fuser -v /dev/snd/pcm* at exactly
 this point in time, because it should be unused.

I can't do it at exactly any time. As fast as my fingers move, it shows
pulse owns it till jack tries to start, then no-one. It stays as no-one
till I try to start jack again, or jack exit. I don't know if a bash loop
(time, fuser, loop) would be fast enough to catch something. Or if it
would change things with more cpu/disk/whatever use.




-- 
Len Ovens
www.OvenWerks.net


-- 
Ubuntu-Studio-devel mailing list
Ubuntu-Studio-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-studio-devel