LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Using Jack audio connection kit with Fedora Core 2 (http://www.linuxquestions.org/questions/linux-software-2/using-jack-audio-connection-kit-with-fedora-core-2-a-261015/)

exitium 11-30-2004 02:33 PM

Using Jack audio connection kit with Fedora Core 2
 
Hi!

I'm trying to install and use Rosegarden audio application on my Fedora Core 2 x86_64 box running a 2.6.9 kernel.

My system is the following:
AMD Athlon 64 3000+
Asus K8V SE mobo
1GB of DDR400 memory
SATA-150 RAID0 with 2xSeagate Barracuda 7200.2 120MB disks on promise controller

I have succeeded to recompile my kernel so that I have selected a proper CPU (AMD Athlon 64), pre-emptive kernel option and Default security set to module so that I'm able to load realtime-lsm-0.1.1 kernel module.

The module loads up fine and I''m using following command:
Code:

modprobe --first-time realtime allcaps=1 any=1
I have compiled the JACK audio connection kit 0.99 with following options:
Code:

./configure --with-default-tmpdir=/mnt/ramfs --enable-capabilities
I'm using qjackctl to control my jack server and have been able to tweak the configuration so that the latency is ie. 5,9ms. However when running the jackd or jackstart there is a huge amount of XRuns and when the latency is around 5,9ms my processor usage is up to 89% even there is only jackd running.

It seems that most of the how-to and project documentations handle only 2.4 series kernels. Also it seems that 64bit version help is hard to find.

Should I consider to install another distro (ie SuSe 9.2 or Debian with agnus?) or is there any hope for me to get this system working?

If you need any more details (config files, commands that I've used etc.) please ask for them since I have not necessarily provided all the needed info.

Best Regards:
Exitium

exitium 11-30-2004 06:40 PM

Just some more bits of information for my case.

Audacity was able to play 20 cd quality mono tracks on Fedora Core 2 stock kernel 2.6.9-1.6FC2 with no problems after I had it compiled (does not use Jack)
Ardour plays the track but I've only tried it with latency of about 50ms so the sound breaks up badly even with one mono track
Rosegarden seems like it's playing, but there's no sound. This is only tested with 50ms latency too...

exitium 11-30-2004 06:51 PM

Oh, I forgot.

I have tried LD_ASSUME_KERNEL=2.4.19 but then the Jack will not even do ./configure saying that my selected processor does not support x86 command set

foo_bar_foo 11-30-2004 08:43 PM

hi,

i can't really help but can at least fill in a little bit
i'm using jack on LFS with kernel 2.6.3
kernel is compiled with ICC not GCC (Pentium 4) 32 bit
never used the realtime module like you said
just use sudo on jackd and jack apps so they run as root
with jackd and ladccad running CPU usage is from 0.2 to 0.4 percent
the jackcontroll configuration page says down in the corner latency is 42.7 msec
never tweeked those settings at all..
never had any latency troubles at all and never had sound breaking up.
both midi keyboard and mic input is perfectly in sync with playback.

something is definitly wack about the high cpu usage and that's what is causing sound troubles i think

exitium 12-01-2004 08:37 AM

Hi!

I also tried executing the Jack as a root when still running the FC2 stock kernel. The latency reported by qjackctll was then about that 48 - 50ms and then there was no overwhelming CPU usage. However with Ardour the sound broke up badly.

Best Regards:
Exitium

foo_bar_foo 12-01-2004 12:00 PM

possibly some alsa software mixing thing -- just guessing
i have this in .asoundrc (i give the whole thing cause i don't know what might effect)
Code:

pcm.jackplug {
                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
                }
        }
# this makes OSS apps use dmix
pcm.dsp0 {
    type plug
    slave.pcm "dmix"
}
# mixer0 can stay unchanged, because it isn't used anyway, I guess ;)
ctl.mixer0 {
    type hw
    card 0
}

# this makes native ALSA apps default to using dmix
pcm.!default {
    type plug
    slave.pcm "dmix"
}

or possibly some setting in ardour itself
in the mixer window thingy down at the bottom you have those buttons labled "output"
click on them and choose edit to see what's what
you can either output each individual track to alsa_pcm:playback_1 alsa_pcm:playback_2
or output each track to Ardour/master/in and run master to alsa_pcm:playback
(i think that's how it works anyway)
just play with it
it is possible to make some horrible feedback loops here i found out
my suspicion is just alsa not set up to do software mixing ?

edit to turn off those smily faces

foo_bar_foo 12-01-2004 12:18 PM

another thought
make sure you are not overdriving your soundcard with things turned up too loud
ardour mixer sliders as well as alsamixer settings
seems to be real easy to do with alsa drivers for some reason
and some effects plugins don't work and break up sound real bad in ardour
but i bet you haven't goten to them yet

exitium 12-01-2004 06:00 PM

Hi!

Thank you for your suggestions foo_bar_foo.

Did you mean with that .asoundrc a file that shoud be located at ~/.asoundrc ? I checked out my /usr/share/alsa//alsa.conf and it tries to load some configuration from

Code:

@hooks [
        {
                func load
                files [
                        "/etc/asound.conf"
                        "~/.asoundrc"
                ]
                errors false
        }
]

However Ardour will not connect with Jack now and prints out the following error message. Is this the problem that was mentioned somewhere about Jack unable to create realtime threads? I really don't know if the .asoundrc had anything to do with this since I think I saw this message allready yesterday...

Code:

ardour
Ardour/GTK 0.536.1 running with libardour 0.838.0
Copyright 1999-2004 Paul Davis
Ardour 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 UI configuration file /usr/local/etc/ardour/ardour_ui.rc
Loading system configuration file /usr/local/etc/ardour/ardour_system.rc
Loading user configuration file /home/romu/.ardour/ardour.rc
ardour: [WARNING]: No MMC control (MIDI port "seq" not available)
ardour: [WARNING]: Your system generates "Mod2" when the NumLock key is pressed. This can cause problems when editing so Ardour will use Mod3 to mean Meta rather than Mod2
jack_create_thread: error -1 switching current thread to rt for inheritance: Unknown error 18446744073709551615
Loading session /home/romu/test using snapshot test
Segmentation fault

Oh. That segmentaton fault comes up when I try to play a wav file in Ardour...

foo_bar_foo 12-01-2004 10:13 PM

yea ~/.asoundrc sorry for not being clear
(if things are running as root /root/.asoundrc)
i put it both places
try
arecord -L
if that reads out without complaint then alsa understands .asoundrc ok i think
the other issue i have never seen
it looks lke the kernel module is not loaded
/sbin/lsmod | grep real
should give you realcap and commoncap
have never tried to patch kernel for realtime so not alot of help
jack_create_thread: error -1
that's a jack error not arbour
try this for starting realcap before you start jack
http://ccrma.stanford.edu/planetccrm...init.d/realcap
then
/sbin/service realcap start
/sbin/service realcap stop

i tried reading about the planetccrma build for fedora core2 and they are having the same xrun troubles you were having with jack -R option so even very experienced people can't seem to get this to work yet
you can follow changelog here and try to install planetccrma packages using apt after they get it working
http://ccrma.stanford.edu/planetccrm...changelog.html
or i guess like you said try another distribution
appearently everything works great with fedora core 1
i personally would go with the debian or audioslack version
might also want to first try building the fastest smallest kernel you can (change the makefile otpimizations)
and trim out all the fat but leave out all the patches that don't seem to work then use sudo to safely get mlock and realtime access. But it is possible that only works for me because i have kernel compiled with intel compiler which is a huge performance gain ? i wonder ?

exitium 12-02-2004 02:41 AM

Hi and thanks again foo_bar_foo!

It seems that I have to work a bit more to get that .asoundrc working. At the end of this message is the output from arecord -L. It does not contain the changes you proposed so the configuration is not propably loading.

realcap is apparently an another way to patch the kernel realtime capable. I propably have to check that out too. I'm using the realtime-lsm-0.1.1 and grepping with lsmod tells:

Code:

/sbin/lsmod | grep real
realtime              13328  0

Actually the reason I haven't allready installed Fedora Core 1 and Planet CCRMA is that I would like to use 64bit distro with my 64bit computer. Currently Planet CCRMA is not supporting 86_64 distros. One possibility could be Debian AMD64 port once it's officially available. It's really strong candidate for me since I used to have Woody on my workplace laptop some time ago and still like setting up Linux servers with Debian. I don't know however is there going to be trouble considering that Debian packages are updated quite conservatively. Perhaps the unstable distro would be the choise for audio system?

I'll check out your proposals in more detail at the evening.

Best Regards:
Exitium


Code:

arecord -L
PCM list:
hw {
        @args.0 CARD
        @args.1 DEV
        @args.2 SUBDEV
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars {
                                0 ALSA_PCM_CARD
                                1 ALSA_CARD
                        }
                        default {
                                @func refer
                                name 'defaults.pcm.card'
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars {
                                0 ALSA_PCM_DEVICE
                        }
                        default {
                                @func refer
                                name 'defaults.pcm.device'
                        }
                }
        }
        @args.SUBDEV {
                type integer
                default {
                        @func refer
                        name 'defaults.pcm.subdevice'
                }
        }
        type hw
        card $CARD
        device $DEV
        subdevice $SUBDEV
}
plughw {
        @args.0 CARD
        @args.1 DEV
        @args.2 SUBDEV
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars {
                                0 ALSA_PCM_CARD
                                1 ALSA_CARD
                        }
                        default {
                                @func refer
                                name 'defaults.pcm.card'
                        }
                }
        }
        @args.DEV {
                type integer
                default {
                        @func igetenv
                        vars {
                                0 ALSA_PCM_DEVICE
                        }
                        default {
                                @func refer
                                name 'defaults.pcm.device'
                        }
                }
        }
        @args.SUBDEV {
                type integer
                default {
                        @func refer
                        name 'defaults.pcm.subdevice'
                }
        }
        type plug
        slave.pcm {
                type hw
                card $CARD
                device $DEV
                subdevice $SUBDEV
        }
}
plug {
        @args.0 SLAVE
        @args.SLAVE {
                type string
        }
        type plug
        slave.pcm $SLAVE
}
dmix {
        @args.0 SLAVE
        @args.1 FORMAT
        @args.2 RATE
        @args.SLAVE {
                type string
                default 'hw:0,0'
        }
        @args.FORMAT {
                type string
                default S16_LE
        }
        @args.RATE {
                type integer
                default 48000
        }
        type dmix
        ipc_key 5678293
        ipc_key_add_uid yes
        slave {
                pcm $SLAVE
                format $FORMAT
                rate $RATE
        }
}
dsnoop {
        @args.0 SLAVE
        @args.1 FORMAT
        @args.2 RATE
        @args.SLAVE {
                type string
                default 'hw:0,0'
        }
        @args.FORMAT {
                type string
                default S16_LE
        }
        @args.RATE {
                type integer
                default 48000
        }
        type dsnoop
        ipc_key 5778293
        ipc_key_add_uid yes
        slave {
                pcm $SLAVE
                format $FORMAT
                rate $RATE
        }
}
shm {
        @args.0 SOCKET
        @args.1 PCM
        @args.SOCKET {
                type string
        }
        @args.PCM {
                type string
        }
        type shm
        server $SOCKET
        pcm $PCM
}
tee {
        @args.0 SLAVE
        @args.1 FILE
        @args.2 FORMAT
        @args.SLAVE {
                type string
        }
        @args.FILE {
                type string
        }
        @args.FORMAT {
                type string
                default raw
        }
        type file
        slave.pcm $SLAVE
        file $FILE
        format $FORMAT
}
file {
        @args.0 FILE
        @args.1 FORMAT
        @args.FILE {
                type string
        }
        @args.FORMAT {
                type string
                default raw
        }
        type file
        slave.pcm null
        file $FILE
        format $FORMAT
}
null {
        type null
}
cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
jackplug {
        type plug
        slave {
                pcm jack
        }
}
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
        }
}
dsp0 {
        type plug
        slave.pcm dmix
}
default {
        type plug
        slave.pcm dmix
}


exitium 12-08-2004 04:44 PM

Hi!

Just solved my problem. 2 minutes ago!-) (I'll propably go out and throw
a party ;-)

My solution was to disable the onboard sound chipset and install SB
Audigy Platinum Ex to PCI slot 4 (only slot that does not share the IRQ
channel). I had the card standing unused on my another computer. Then I
just recompiled Jack and everything was working fine!

I suspect that the problem I had might been related to the fact that the
VIA82xxx sound card (onboard) did not have any latency setting when I
looked at it with lspci. Also I had Dlink WLan (ACX111) on my PCI4 slot
and now it is moved to the slot 2 sharing with Marvel Gigabit
controller.

Also I had to tweak modules.conf manually to load Audigy driver
(snd-emu10k1) at startup. Currently I'm loading snd-emu10k1-synth
manually. Should I add it to the modules.conf also? What should be the
alias for the driver? How do I get Alsa/Jack/another software to know
about the synth?

So. Only thing to resolve is how to get sound out of Rosegarden. Ardour
seems to work fine now.

Thank you all for your help!

Best Regards:
Exitium

exitium 12-09-2004 06:29 AM

Forgot to mention that I now run jackd with following command line.

Code:

/usr/local/bin/jackd -R -P17 -dalsa -dhw:0 -r44100 -p128 -n2
qjackctl reports 5.8ms latency on the setup page and I have no more XRuns. CPU usage with jackd and qjackctl running is about 0.8%

Best Regards:
Exitium

Hano 12-09-2004 06:40 AM

You can also get great help for linux audio on irc at irc.freenode.net, channel #lad.

Hope it helps


All times are GMT -5. The time now is 03:44 PM.