Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

Jack, kde

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
Progman3K
l33t
l33t
User avatar
Posts: 805
Joined: Sat Jan 03, 2004 11:59 pm
Contact:
Contact Progman3K
Website

Jack, kde

  • Quote

Post by Progman3K » Mon Apr 01, 2024 1:37 pm

Hi,

I'm trying to configure Jack so I can run a software that has it as a prerequisite.

Only even after following the jack guide

https://wiki.gentoo.org/wiki/JACK

And following the instructions, I can't seem to get sound to work, at least not completely.

For example, I can work it out to running smplayer, and setting jack as its output in the preferences, and although that does permit playback of video files and their soundtracks, the volume is very low and I can't adjust it.

For KDE, since logging out and logging back in, the global sound is non-functional. The sound-card no longer shows up in the volume-settings.

To sum up, if an application itself can be configured to use jack, there will be sound, albeit at a low volume that can't be adjusted, but all other apps, including the system, seem to not know about the soundcard.

I'm running sys-kernel/gentoo-sources-6.6.21:6.6.21::gentoo

with
media-sound/jack2-1.9.22:2::gentoo USE="alsa classic dbus libsamplerate opus pam systemd tools -doc -ieee1394 -metadata"
media-sound/pulseaudio-16.1::gentoo USE="bluetooth glib jack -daemon -ofono-headset"
media-video/pipewire-1.0.3:0/0.4::gentoo USE="X bluetooth dbus extra ffmpeg readline ssl systemd -doc -echo-cancel -flatpak -gsettings -gstreamer -ieee1394 -jack-client -jack-sdk -liblc3 -lv2 -man -modemmanager -pipewire-alsa -roc (-selinux) -sound-server (-system-service) -test -v4l -zeroconf"

I have the following software installed

media-sound/cadence-0.9.2-r1::gentoo USE="opengl pulseaudio -a2jmidid"
media-sound/qjackctl-0.9.13::gentoo USE="alsa dbus -debug -portaudio"


Any help is greatly appreciated, thank you
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Mon Apr 01, 2024 2:08 pm

To sum up, if an application itself can be configured to use jack, there will be sound, albeit at a low volume that can't be adjusted, but all other apps, including the system, seem to not know about the soundcard.
Ok, this looks like you lack a connection between jack and alsa.
You can use cadence to generate a config snippet which will route alsa applications through jack.

Huh... It looks like I even still have a relic of the past on my machine, both things were connected like this:

Code: Select all

$ cat ~/.asoundrc.back 
pcm.!default {
    type plug
    slave { pcm "jack" }
}

pcm.jack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
}

ctl.mixer0 {
    type hw
    card 0
}
Make Pipewire a system service
Top
Progman3K
l33t
l33t
User avatar
Posts: 805
Joined: Sat Jan 03, 2004 11:59 pm
Contact:
Contact Progman3K
Website

  • Quote

Post by Progman3K » Tue Apr 02, 2024 11:41 am

Some improvement:

I've worked out that pulseaudio might be adding an extra layer of complexity, so I've tried to remove its influence by setting USE="-pulseaudio" globally in /etc/portage/make.conf

There appears to be a hard dependency on pipewire, so in addition to removing its sound-server use-flag, I've added its jack-client use-flag

Now firefox has sound, no doubt because of its jack use-flag, but this is strange because it had no sound before...

I still can't get the volume-control or sound settings back in KDE.

However, I can run alsamixer in a terminal and set the global volume level that way

Code: Select all

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC897 Analog [ALC897 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC897 Digital [ALC897 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [SAMSUNG]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: Wireless [SteelSeries Arctis 1 Wireless], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code: Select all

# ------------------------------------------------------
# Custom asoundrc file for use with snd-aloop and JACK
#
# use it like this:
# env JACK_SAMPLE_RATE=44100 JACK_PERIOD_SIZE=1024 alsa_in (...)
#

# ------------------------------------------------------
# playback device
pcm.aloopPlayback {
  type dmix
  ipc_key 1
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,0,0"
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 4096
  }
}

# capture device
pcm.aloopCapture {
  type dsnoop
  ipc_key 2
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,0,1"
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 4096
  }
}

# duplex device
pcm.aloopDuplex {
  type asym
  playback.pcm "aloopPlayback"
  capture.pcm "aloopCapture"
}

# ------------------------------------------------------
# default device
pcm.!default {
  type plug
  slave.pcm "aloopDuplex"
}

# ------------------------------------------------------
# alsa_in -j alsa_in -dcloop -q 1
pcm.cloop {
  type dsnoop
  ipc_key 3
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,1,0"
    channels 2
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 32768
  }
}

# ------------------------------------------------------
# alsa_out -j alsa_out -dploop -q 1
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}
Top
Ralphred
l33t
l33t
Posts: 822
Joined: Tue Dec 31, 2013 11:52 am

  • Quote

Post by Ralphred » Tue Apr 02, 2024 12:36 pm

Progman3K wrote:I've worked out that pulseaudio might be adding an extra layer of complexity, so I've tried to remove its influence by setting USE="-pulseaudio" globally in /etc/portage/make.conf
I use this default.pa to "tame" pulseaudio to just act as a client (to programs like firefox) and pass the rest of the work off to Jack.

Code: Select all

#!/usr/bin/pulseaudio -nF
.fail
#mandatory for some reason...
load-module module-augment-properties
load-module module-switch-on-port-available

#sound card connections
load-module module-jack-sink channels=6 connect=0 sink_name=Speakers channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe client_name=Pulse_Speakers
load-module module-jack-sink channels=2 connect=0 sink_name=Headphones client_name=Pulse_Headphones
load-module module-jack-source channels=2 connect=0 source_name=Microphone client_name=Pulse_Microphone

#client connection
load-module module-native-protocol-unix

#nice stuff
load-module module-always-sink
load-module module-suspend-on-idle

#defaults and naming
set-default-sink Speakers
set-default-source Microphone

update-sink-proplist Speakers device.description=Speakers
update-sink-proplist Headphones device.description=Headphones
update-source-proplist Microphone device.description=Microphone
then use

Code: Select all

pcm.!default {
        type pulse
}
ctl.!default {
        type pulse
}
What this does it to essentially allow you to ignore the fact that jackd is running in the background, pulse and alsa clients work as normal (like KDE's volume controls, firefox etc). Then just set the jack use flag on the specific programs you want to use it. It does require that jackd is started before pulse (or pulse will fail) but putting a mechanism in for that is easier than trying to handhold programs that like to say they have jack compatibility but kinda don't. I've been running this way for a long time now and it's really the most maintenance free form of jack support I've ever used.
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Tue Apr 02, 2024 12:42 pm

I've worked out that pulseaudio might be adding an extra layer of complexity, so I've tried to remove its influence by setting USE="-pulseaudio" globally in /etc/portage/make.conf

There appears to be a hard dependency on pipewire, so in addition to removing its sound-server use-flag, I've added its jack-client use-flag
What? Just how complex setup are you trying to make there?
When I was running jack, I only had jack2 on top of alsa, connected with a bridge (alsa's default device was using a jack-type plugin), and it worked pretty well. Jack could see every ALSA application as an individual input.
I see you have jack connected to alsa via a loopback device; I don't know how it works and feels, it did looked like the second-best thing available, but the plugin method looked better and it worked so I never got to try it out.

Pulseaudio and pipewire can run side by side with jack, and I think those setups are described in PA and PW guides respectively, but honestly if you want to use both jack and pulseaudio, you better just ditch them both and install pipewire instead. It provides all 4 audio interfaces in one package, you'll have fewer headaches making it work.
Make Pipewire a system service
Top
The Main Man
Veteran
Veteran
Posts: 1173
Joined: Thu Nov 27, 2014 11:25 pm
Location: /run/user/1000

  • Quote

Post by The Main Man » Wed Apr 03, 2024 10:43 am

I'm using Jack for some time now, there's sound on everything, you just need to make sure that PulseAudio is bridged to Jack.
No need to deal with Alsa.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic