Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Partially Outdated] JACK Audio Connection Kit Howto
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
shakti
Guru
Guru


Joined: 15 May 2002
Posts: 358
Location: omnipresent

PostPosted: Thu Jul 01, 2004 1:45 am    Post subject: Reply with quote

Did you try all the steps (particular Kernel, Alsa and 7) in the HowTo above? I had same error at first but it turned out to be a alsa prob. What alsa / kernel version are you using?
_________________
Using Gentoo since 2002.
Back to top
View user's profile Send private message
BennyP
Guru
Guru


Joined: 09 May 2003
Posts: 497
Location: Toronto, Canada

PostPosted: Thu Jul 01, 2004 7:21 am    Post subject: Reply with quote

For a brief and wonderful time, jack was running well with alsa-lib 1.0.3-r3, then I started getting these massive xruns,
I did

chmod u+s /usr/bin/jackd and
chmod u+s /usr/bin/jackstart

and now jack wont run at all! I get the infamous

Could Not Connect to JACK as client error

This is after remerging alsa-lib and jack with jack-tmpfs and caps use flags and only after I ran the chmod. Now I cant start jack in realtime or otherwise and i'm FREAKING OUT because I'm going to Teknival in 2 days to perform!!!
_________________
Could it be?
Back to top
View user's profile Send private message
BennyP
Guru
Guru


Joined: 09 May 2003
Posts: 497
Location: Toronto, Canada

PostPosted: Thu Jul 15, 2004 3:10 am    Post subject: Reply with quote

*shameless bump*
It occurs to me that aftr syncing portage any changes i made t the alsa and jack ebuilds are lost, but now alsa-lib is 1.0.5 and jack is 0.98.
will I still need to edit these ebuilds?
_________________
Could it be?
Back to top
View user's profile Send private message
shakti
Guru
Guru


Joined: 15 May 2002
Posts: 358
Location: omnipresent

PostPosted: Thu Sep 30, 2004 6:20 am    Post subject: Reply with quote

Just to update, no modifications to any e-builds are nessesary, the only thing one has to do to get jack to work with gentoo is patch 2.6 kernel for real time.
_________________
Using Gentoo since 2002.
Back to top
View user's profile Send private message
benxor
n00b
n00b


Joined: 18 Jan 2004
Posts: 19
Location: Sydney, Australia

PostPosted: Tue Nov 02, 2004 4:29 am    Post subject: can someone help me out? Reply with quote

I've been following this and other tutorials - I've managed to get jack *working*, but only if I run it and all the clients that connect to it as root. I still can't get it running as a normal user. Here are the steps I've followed, maybe somebody might see something wrong in what I'm doing and could put me on the right course:

I'm running kernel 2.6.10-rc1-mm2
I've got a C-MEDIA 8738 sound 'card' onboard, the module compiled for it, and that's all configured and working fine with ALSA

I have the following packages:
Code:

alsa-lib (1.0.6), alsa-oss (1.0.6), alsa-jack (1.0.6), alsa-headers (1.0.6a), alsa-utils (1.0.6), jack-audio-connection-kit (0.99.0), mplayer (1.0_pre5-r4)


and the following use flags:

Code:
USE="3dnow 3dnowex aac acpi acpi4linux aim audiofile caps cdinstall \
     cdparanoia cdrom cdrw codecs curl dba dga divx4linux dts dv dvd dvdr \
     dvdread dvdrw faac faad fbcon ffmpeg flac freetype ftp gd gimp gimp2 \
     gstreamer hal icq imlib2 ipod ipv6 jabber jack jack-tmpfs java \
     javascript jp2 jpeg2k lcms libcaca libsamplerate lirc live lzo \
     matroska mime mmx mng mp3 mp4 mpeg4 mpi mplayer msn network no_wxgtk1 \
     nptl offensive ogg openal oscar pda pic plotutils ppds radeon real \
     recode rtc samba silc sndfile soundtouch sse svg tga theora thumbnail \
     tiff transcode unicode usb vcdimager vorbis wmf xpm xvid xvmc yahoo \
     -oss -arts -libg++ -opengl -xmms -esd -kde"


I have patched my kernel code directly to get POSIX capabilities working, have emerged realtime-lsm from portage and built it against the kernel, turned on default capabilties and other security sruff exactly as requested by the realtime-lsm emerge instructions, and I load the following modules at startup:
Code:

/etc/modules.autload.d/kernel-2.6:

commoncap
realtime gid=18 mlock=1


group id 18 is the audio group, and here is it's entry in /etc/group:

audio:x:18:benxor,jack

I've added the 'jack' user in hopes of getting that to run jackd, but it's working about as well as running it as my standard user 'benxor'.

When I run jackd or jackstart as root, everything's fine. I can use jack, mplayer et al can use jack - but only if I run *them* as root. If I run jackstart or jackd as a normal user, I get simply:

Code:
back from read, ret = 1 errno == Success
jackd 0.99.0
Copyright 2001-2003 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

cannot bind server to socket (Permission denied)
cannot create server sockets
cannot create engine


jackstart is suid root, but only because if I don't do this it gives me a warning to suid it root anyway. If suid root jackd, and then run it as a normal user, I get:
Code:
mugatu /home/benxor # chmod u+s /usr/bin/jackd
mugatu /home/benxor # exit
benxor@mugatu ~ $ jackd -p -R -dalsa -dhw:0 -r 44100 -H -D -z s
jackd 0.99.0
Copyright 2001-2003 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

loading driver ..
apparent rate = 44100
creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|hwmon|swmeter|-|32bit
control device hw:0
configuring for 44100Hz, period = 1024 frames, buffer = 2 periods
Couldn't open hw:0 for 32bit samples trying 24bit instead
Couldn't open hw:0 for 24bit samples trying 16bit instead
Couldn't open hw:0 for 32bit samples trying 24bit instead
Couldn't open hw:0 for 24bit samples trying 16bit instead
Noise-shaped dithering at 16 bits
cannot create shm segment /jck-[32 bit float mono audio] (Invalid argument)
cannot create new port segment of 0 bytes, name = /jck-[32 bit float mono audio] (Invalid argument)
no ports available!
ALSA: cannot register port for capture_1
no ports available!
ALSA: cannot register port for playback_1


trying to access the damaged deamon by playing a song (as normal user) with say mplayer in the next console, I just get 'can't open sound, can't open video', blah blah blah, mplayer doesn't work.


So *what* is going on? What have I forgotton, or done wrong, to get jackd just running as a normal user? I'm up to my eyeballs in properly implemented realtime scheduling stuff, but nothing seems to work. I know the realtime modules are loaded, and even that jackstart/jackd is hooking into them to some extent because I got the old

Code:
jackstart: cannot get realtime capabilities, current capabilities are:
           =ep cap_setpcap-ep
    probably running under a kernel with capabilities disabled,
    a suitable kernel would have printed something like "=eip"


when I had forgotten to go into include/linux/capabilities.h in my kernel and patch those two lines. I no longer get that error, and the realtime module runs happily, but of course this doesn't mean I can actually get realtime for normal user processes in the audio group, oh no.

So since I've done that; enabled capabilities; enabled alsa, and alsa-oss compatability; have sound working on my soundcard; have *jack* working; why can't i get jack running as a normal user? Can anyone help me out?
_________________
'I'll tell you something the great Maharishi Guru taught me - and I don't think there's a day goes by that I don't remember this one simple lesson. "Always"... no, wait it was "Never"... '
--Steve Martin
Back to top
View user's profile Send private message
shakti
Guru
Guru


Joined: 15 May 2002
Posts: 358
Location: omnipresent

PostPosted: Tue Nov 02, 2004 4:42 am    Post subject: Reply with quote

My first guess is that you did some mistake in patching your kernel, retrace your steps, all you need is right in this forum. Does alsa work ok? If you did more than emerge jackblabla and patched kernel you did something wrong. No chmod's are nessessary. But again make sure alsa works fine before trying to get jack to work.
_________________
Using Gentoo since 2002.
Back to top
View user's profile Send private message
benxor
n00b
n00b


Joined: 18 Jan 2004
Posts: 19
Location: Sydney, Australia

PostPosted: Tue Nov 02, 2004 7:28 am    Post subject: Reply with quote

alsa works fine, and indeed jack works fine with it (running as root).

how do you mean messed up patching? getting things working for realtime-lsm, or just changing those two lines in capabilities.h?
_________________
'I'll tell you something the great Maharishi Guru taught me - and I don't think there's a day goes by that I don't remember this one simple lesson. "Always"... no, wait it was "Never"... '
--Steve Martin
Back to top
View user's profile Send private message
benxor
n00b
n00b


Joined: 18 Jan 2004
Posts: 19
Location: Sydney, Australia

PostPosted: Thu Nov 11, 2004 6:11 am    Post subject: SOLVED Reply with quote

Just an update - I discovered the problem was not the kernel, capabilities, realtime or any of that at all - it was actually problems with jack grabbing virtual memory. When I removed the jack-tmpfs USE flag, everything suddenly worked =) Now I can run Jack as a normal user, and I'm working on an init script =D
_________________
'I'll tell you something the great Maharishi Guru taught me - and I don't think there's a day goes by that I don't remember this one simple lesson. "Always"... no, wait it was "Never"... '
--Steve Martin
Back to top
View user's profile Send private message
jannis
Guru
Guru


Joined: 05 Dec 2004
Posts: 326
Location: Germany / Bavaria / Aschaffenburg

PostPosted: Mon May 09, 2005 7:12 pm    Post subject: Reply with quote

Hello, I just wanna post my experiences here:

I emerged jackd yesterday and it was working great! I was totally happy with it, even arstd worked using the jack-output. It was the first time I could listen to music (xmms with jack output), hear my icq-msgs (artsdsp play <file>) which were played by arts to the jackd and play Q3A (artsdsp -m quake3) at the same time.

Then I emerged anything (maybe I updated jackd or something similar, I don't know anymore) and suddenly, artsd wasn't able to play his sound through the jackd. It could connect to jack and was shown in the "connect"-panel of qjackctl but didn't play any sound. "mplayer -ao artsd" got stuck when it tried to play sound. even worse: "mplayer -ao jack" crashed after loading the jack-library.

My solution up to now:
JACKD is running fine. I emerged libjackasyn (it worked ^^) (it routes the sound going to /dev/dsp to jack, similar to artsdsp), I can start artsd with "jacklaunch artsd -a oss" but I didn't find a way to do so automatically. Renaming artsd to something else and making an script called "artsd" which launches "jacklaunch artsd $1" doesn't work. So the sound from artsd goes to jack, fine!
My licq plays his sound by jacklaunch, too.
The only problem is that Q3A needs MMAP and jacklaunch can't do this. Q3A is launched with "artsdsp -m quake3", meaning the q3a-sound goes to alsa, which has it's sound-output routed to jack which plays the sound to the soundcard. Hm..... "low delay system"? Not really. Playing quake3 with 1 second sound-delay SUXX.

BTW: The way, I start my jackd:
/etc/conf.d/local.start:
Code:
su - kripton -c "jackstart -s -d alsa -p 2048 -o 2 -i 2 -H -M -S -D &"

it doesn't detach from the console but it works.

I didn't manage to get the alsa-jack-plugin working. Here's my /etc/asound.conf:
Code:
pcm.intel8x0 {
   type hw
   card 0
}
ctl.intel8x0 {
   type hw
   card 0
}
pcm.!default {
   type plug
   slave { pcm jack }
}
pcm.jack {
   type jack
   playback_ports {
      0 alsa_pcm:playback_1
      1 alsa_pcm:playback_2
   }
   capture_ports {
      0 alsa_pcm:capture_1
      1 alsa_pcm:capture_2
   }
   monitor_ports {
      0 alsa_pcm:monitor_1
      1 alsa_pcm:monitor_2
   }
}

Maybe someone can help me with this so the artsd can play his sound to "ALSA".

Thanks for all the stuff in this thread, it was pretty useful.

*UPDATE*:
I ran artsd in debug mode and here is the problem:
Code:
AudioSubSystem: rBuffer is too full
(The previous message was repeated 383 times.)

Artsd sourcecode tells me:
Code:

         if(rBuffer.size() < _fragmentSize * _fragmentCount * bits() / 8 * channels())
         {
             rBuffer.write(len,fragment_buffer);
#ifdef DEBUG_WAVEFORM
            float * end = (float *)(fragment_buffer + len);
            float * floatbuffer = (float *)fragment_buffer;
            while(floatbuffer < end)
            {
               d->plotfile << *floatbuffer++ << "\n";
               ++floatbuffer;
            }
#endif
         }
         else
         {
            arts_debug( "AudioSubSystem: rBuffer is too full" );
         }

No, it doesn't help me :/
Anyone got artsd working with the jack-driver?
[code]The strange thing is: I got it working once :/
Back to top
View user's profile Send private message
jannis
Guru
Guru


Joined: 05 Dec 2004
Posts: 326
Location: Germany / Bavaria / Aschaffenburg

PostPosted: Tue May 10, 2005 8:07 pm    Post subject: Reply with quote

Ok, another update.

After having emerged jackd-0.98.1 (I had 0.99.0 before) and re-emerging arstd aftwewards my artsd really plays his sound through jack.
it works great again =DDD
Back to top
View user's profile Send private message
Coltie
Guru
Guru


Joined: 22 Apr 2005
Posts: 305
Location: N 46° 7' 26.7" E 7° 6' 11.2"

PostPosted: Thu May 26, 2005 7:30 pm    Post subject: Re: More questions Reply with quote

[quote="fireboy1919"]Also, anybody know how to get one machine's client to communicate with another? Is this beyond jack's capabilities?[/quote]

Just in case, here is the app you are looking for: jack.plumbing

http://www.alphalink.com.au/~rd/sw/jack.html
_________________
Unreleased Kollektiv
"If by noise you mean uncomfortable sound, then pop music is noise to me."
Masami Akita
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum