WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: no sound with jackd  (Read 179 times)

Offline marttt

  • WikiUser
  • *
  • Posts: 8
no sound with jackd
« on: November 01, 2017, 01:25:43 PM »
Hi. I would like to edit audio with 'non-daw' on TC 7.2 (x86), using an external device for playback.
Sound from this device works with ALSA, but with JACK I only hear silence.
And non-daw only utilizes JACK.

The playback device (Zoom H1) is mapped as 'hw:2,0'. I've created an .asoundrc to make it the system's default device:

Code: [Select]
pcm.!default {
 type plug
 slave {
 pcm "hw:2,0"
 }
}

I've tried launching jackd realtime with the following commands:

Code: [Select]
sudo jackd -R -d alsa -d hw:2,0

and also:

Code: [Select]
set_rlimits jackd

And I set up a ~/.jackdrc with the same jackd command (without sudo).
Eventually I also tried 'qjackctl' (from TC 2.x repository, but it seems to work).

Console outputs don't seem suspicious -- e.g see the issue I posted on non-daw's github:

https://github.com/original-male/non/issues/222

But I still get no sound in non-timeline. Neiter with the version in the repos nor the one I compiled myself from latest source.
Neither is JACK recognized by Audacity (should it be?), nor by Ecasound (it should be; I compiled it with jack support).
But, once more, with ALSA the 'hw:2,0' device works, so the mapping seems to be correct.
Looks like TC doesn't recognize JACK the way it should.

I really need (and want) to get non-daw going on this machine. What else could I try?

(Also, I was suggested to try the 'jack-play' command for testing playback.
It's in the 'jack-tools' bundle; unfortunately this is not available on TC,
and the compilation failed for me.
Maybe somebody else can try compiling it?
The source can be found here:
http://rd.slavepianos.org/?t=rju)

Many thanks!

Offline marttt

  • WikiUser
  • *
  • Posts: 8
Re: no sound with jackd
« Reply #1 on: November 01, 2017, 01:39:35 PM »
Additionally, I also tried JACK-ALSA routing (as described here) with this in ~/.asoundrc:

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

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

For that to work, I compiled the alsa JACK plugin (it wasn't included in the available alsa-plugins package).
Unfortunately this doesn't seem to work either:

Code: [Select]
$ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
jack
JACK Audio Connection kit

$ aplay -D jack file.wav
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
aplay: main:722: audio open error: No such device or address

The shared library is actually present in /usr/local/lib/alsa-lib/. But that's not recognized either.
What's wrong?
Thanks again!
« Last Edit: November 01, 2017, 01:41:32 PM by marttt »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9611
Re: no sound with jackd
« Reply #2 on: November 02, 2017, 01:24:19 AM »
No idea about jack, but some things to try on why your jack plugin fails to load:
- run ldd and file on /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
- LD_DEBUG=all aplay -D jack file.wav
- strace -olog aplay -D jack file.wav
The only barriers that can stop you are the ones you create yourself.

Offline marttt

  • WikiUser
  • *
  • Posts: 8
Re: no sound with jackd
« Reply #3 on: November 02, 2017, 06:07:04 AM »
No idea about jack, but some things to try on why your jack plugin fails to load:
- run ldd and file on /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
- LD_DEBUG=all aplay -D jack file.wav
- strace -olog aplay -D jack file.wav

Thanks curaga!
Outputs for these commands are as follows:

Code: [Select]
tc@box:~$ ldd /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
        linux-gate.so.1 (0xb7788000)
        libasound.so.2 => /usr/local/lib/libasound.so.2 (0xb76c9000)
        libm.so.6 => /lib/libm.so.6 (0xb768e000)
        libdl.so.2 => /lib/libdl.so.2 (0xb768a000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7673000)
        librt.so.1 => /lib/librt.so.1 (0xb766a000)
        libc.so.6 => /lib/libc.so.6 (0xb7555000)
        /lib/ld-linux.so.2 (0x8000e000)

tc@box:~$ file /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
/usr/local/lib/alsa-lib/libasound_module_pcm_jack.so: symbolic link to /tmp/tcloop/alsa-jack-plugin/usr/local/lib/alsa-lib/libasound_module_pcm_jack.so

tc@box:~$ file /tmp/tcloop/alsa-jack-plugin/usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
/tmp/tcloop/alsa-jack-plugin/usr/local/lib/alsa-lib/libasound_module_pcm_jack.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

tc@box:~$ strace -olog aplay -D jack /home/tc/aju/oy/oetjen/piano2.wav
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
aplay: main:722: audio open error: No such device or address

Output for 'LD_DEBUG=all aplay -D jack /home/tc/aju/oy/oetjen/piano2.wav' is very long;
no idea how to interpret this unfortunately.
I posted it here:
http://okturing.com/src/1722/body

Following other advice, I can also list ports jack listens to:

Code: [Select]
tc@box:~$ jack_lsp
system:capture_1
system:capture_2
system:playback_1
system:playback_2

This corresponds to what I have in ~/.asoundrc.
Should I somehow change these to 'hw:2,0'?

Thanks for thinking along.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: no sound with jackd
« Reply #4 on: November 02, 2017, 06:31:12 AM »
I'd say the problem is here:
Code: [Select]
      4536: /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so: error: symbol lookup error: undefined symbol: jack_port_name (fatal)
...
audio open error: No such device or address      4536: symbol=_IO_putc;  lookup in file=aplay [0]

Is jack compiled against a different version of alsa to the one you're using?

Offline marttt

  • WikiUser
  • *
  • Posts: 8
Re: no sound with jackd
« Reply #5 on: November 02, 2017, 07:45:02 AM »
Quote from: Juanito
Is jack compiled against a different version of alsa to the one you're using?

Indeed, it was (alsa-plugin version 1.1.4; jack version 1.1.0).
I recompiled it now (jack ver 1.1.0, alsa-plugin ver 1.1.0) -- but the output is still the same:

Code: [Select]
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/local/lib/alsa-lib/libasound_module_pcm_jack.so
aplay: main:722: audio open error: No such device or address

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9611
Re: no sound with jackd
« Reply #6 on: November 02, 2017, 10:16:31 AM »
Your plugin is not linked against libjack when it should be. See if you can find out why it ended that way in the alsa-plugins compile.
The only barriers that can stop you are the ones you create yourself.

Offline marttt

  • WikiUser
  • *
  • Posts: 8
Re: no sound with jackd
« Reply #7 on: November 02, 2017, 12:03:08 PM »
Your plugin is not linked against libjack when it should be. See if you can find out why it ended that way in the alsa-plugins compile.
I'll look ito that, thanks!
However, a fellow non-daw user helped me out, so audio is working now.
This is really embarrassing, but it was as simple as connecting non-daw and system playback ports correctly. :/
Also, a nice replacement for qjackctl for that purpose is here:
https://sourceforge.net/projects/njconnect/

I'll also package this for the repo soon, I guess.

Thanks again for all the help,
and I apologize for all the noise I made, due to my foolishness. I almost feel like a troll. :/

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5470
Re: no sound with jackd
« Reply #8 on: November 02, 2017, 12:23:57 PM »
Hi marttt
... and I apologize for all the noise I made, due to my foolishness. I almost feel like a troll. :/
What noise? This is how you learn. Sometimes you miss something that later seems obvious. Guess what, you're not alone. It
happens to everyone.