Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Jack, kde
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Progman3K
l33t
l33t


Joined: 03 Jan 2004
Posts: 783

PostPosted: Mon Apr 01, 2024 1:37 pm    Post subject: Jack, kde Reply with quote

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
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3407

PostPosted: Mon Apr 01, 2024 2:08 pm    Post subject: Reply with quote

Quote:
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:
$ 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 Computing Fun Again
Back to top
View user's profile Send private message
Progman3K
l33t
l33t


Joined: 03 Jan 2004
Posts: 783

PostPosted: Tue Apr 02, 2024 11:41 am    Post subject: Reply with quote

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:
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:
# ------------------------------------------------------
# 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"
}
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 631

PostPosted: Tue Apr 02, 2024 12:36 pm    Post subject: Reply with quote

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:
#!/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
.asoundrc:
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.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3407

PostPosted: Tue Apr 02, 2024 12:42 pm    Post subject: Reply with quote

Quote:
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 Computing Fun Again
Back to top
View user's profile Send private message
The Main Man
Veteran
Veteran


Joined: 27 Nov 2014
Posts: 1171
Location: /run/user/1000

PostPosted: Wed Apr 03, 2024 10:43 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
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