Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firefox and Jack audio
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
Linubie
Apprentice
Apprentice


Joined: 11 Jun 2004
Posts: 261

PostPosted: Tue Sep 10, 2019 9:22 am    Post subject: Firefox and Jack audio Reply with quote

To use guitarix I had to install jack which after some fiddling around works fine right now.
But I would like to take some guitar lessons online where I need to have jack working with Firefox.
To connect all input and output modules I use qtjackctl but when started I can't see any modules that could be connected to have sound in Firefox.

Jack support is set globally:

Code:
euse -a -i jack
global use flags (searching: jack)
************************************************************
[+ C    ] jack - Add support for the JACK Audio Connection Kit

local use flags (searching: jack)
************************************************************
[+ C    ] jack
    media-sound/denemo: Enable jack support through virtual/jack
        [+  ] 2.2.0 [gentoo]
        [+  ] 2.3.0 [gentoo]

[+ C    ] jack
    media-sound/xwax: Adds support for audio input/output via the JACK
    Audio Connection Kit.
        [+  ] 1.6 [gentoo]

[+ C    ] jack
    media-tv/mythtv: Allows MythTV to use JACK as your sound output
    device. You will have to manually configure the path to your JACK
    settings.
        [+  ] (0/29.1) 29.1-r1 [gentoo]


Code:
[ebuild   R   ~] www-client/firefox-69.0::gentoo  USE="gmp-autoupdate jack pulseaudio screenshot startup-notification system-av1 system-h-debug -eme-free -geckodriver -hardened -hwaccel -lto (-neon) -pgo (-selinux) -test -wayland -wifi" CPU_FLAGS_X86="-avx2" L10N="de -ach - -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -nl -nn -

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]


.asoundrc

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

pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
    description "JACK Audio Connection Kit"
    }
}


Code:
aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
usbstream:CARD=Adapter
    Rocksmith USB Guitar Adapter
    USB Stream Output
default:CARD=Audigy2
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Default Audio Device
sysdefault:CARD=Audigy2
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Default Audio Device
front:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Front speakers
rear:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Rear speakers
center_lfe:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Center and Subwoofer speakers
side:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Side speakers
surround21:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=Audigy2
    SB Audigy 4 [SB0610]
    USB Stream Output
default:CARD=Sound
    HyperX Virtual Surround Sound, USB Audio
    Default Audio Device
sysdefault:CARD=Sound
    HyperX Virtual Surround Sound, USB Audio
    Default Audio Device
front:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    Front speakers
surround21:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Sound,DEV=0
    HyperX Virtual Surround Sound, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=Sound
    HyperX Virtual Surround Sound
    USB Stream Output


Thank you
_________________
Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something...
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1675
Location: Switzerland (Romandie)

PostPosted: Wed Sep 11, 2019 3:04 pm    Post subject: Reply with quote

You must be able to use the pulseaudio jack sink, but as I have "-pulseaudio" as global use flag, I don't remember how it must be set up.

A nice alternative is to make jack to fully replace pulseaudio. For that, you must install alsa-plugins[jack], it will provide the ALSA jack plugin that can be used to interface the ALSA software with jack.

All the ALSA software will use by default the first sound device. I use a fake ALSA device which is redirected into jack with the jack ALSA plugin. For that, you can create a /etc/modprobe.d/alsa.conf file. Mine look like:

Code:
# Alsa kernel modules' configuration file.

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

# Reserve first slot for snd-aloop
options snd slots=snd-aloop

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
##  ALSA portion
alias snd-card-0 snd-aloop
alias snd-card-1 snd-hda-intel
##  OSS/Free portion
alias sound-slot-0 snd-aloop
alias sound-slot-1 snd-hda-intel
##
options snd-aloop index=0
options snd-hda-intel index=1 model=alc271-dmic

# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
##  OSS/Free portion - card #2
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss
##
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.
options snd cards_limit=2


With that setting (snd_allop as first ALSA sound card, I have a ~/.asoundrc file:
Code:
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
}


With that setup, the ALSA only software will appear into jack. A nice alternative to qjackctl is cadence. You will find it into the new audio-overlay available via layman, or into the old proaudio overlay which can be outdated, but have more sound software. http://proaudio.tuxfamily.org/wiki/index.php?title=Main_Page
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Back to top
View user's profile Send private message
Linubie
Apprentice
Apprentice


Joined: 11 Jun 2004
Posts: 261

PostPosted: Wed Sep 11, 2019 5:15 pm    Post subject: Reply with quote

Thank you for your reply,

alsa plugins is installed with jack enabled:

Code:
ebuild   R    ] media-plugins/alsa-plugins-1.1.8::gentoo  USE="ffmpeg jack libsamplerate mix pulseaudio speex usb_stream -arcam_av -debug -libav -oss" ABI_X86="32 (64) (-x32)" 0 KiB



There seem to be to different approaches to make jack run with alsa, one is the direct way with the .asoundrc only with the entries I am using and the other way is via a virtual soundcard.
you are using the virtual soundcard which indicates your alsa.conf file that includes snd-aloop .

this link shows the two approaches:

https://wiki.ubuntuusers.de/.asoundrc/
it's in german but explaines both ways
JACK > Direkt
and
JACK > Via virtueller Soundkarte
_________________
Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something...
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1675
Location: Switzerland (Romandie)

PostPosted: Wed Sep 11, 2019 6:17 pm    Post subject: Reply with quote

These 2 ways are explained in Englisj into the wiki of the proaudio overlay (Howtos menu at the preceding link). It is maybe outdated for a few stuffs, but the ways of doing this are still the same. It is also the linuxmao website for the French speaking peoples.

If you need pulseaudio as a dependency, it have a setting to completely disable it. Pulseaudio is a consumer grade audio server when jack is a professional one. Jack provide a constant latency when the latency of pulseaudio will augment at the first xrun, and will not get down until the next pulseaudio complete restart. Depending on what you want to do, it can be better to just disable pulse.
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
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