capture problem with zoom h4n (jackd configuration)

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
svictor
Established Member
Posts: 4
Joined: Sun May 02, 2010 10:16 am

capture problem with zoom h4n (jackd configuration)

Post by svictor »

Hi !
I'm trying to set up my zoom h4n recorder to work with jack (through usb connection, it is supposed to behave like a soundcard). I am using a fresh ubuntu lucid install. I have tried several settings, but jackd only starts if I ask for playback only on the h4n. The onboard card of my laptop works just fine (in duplex mode). Here is the verbose output of qjackctl when I try duplex from the h4n.

Code: Select all

13:15:07.719 JACK is starting...
13:15:07.722 /usr/bin/jackd -v -dalsa -r44100 -p1024 -n4 -D -Chw:1 -Phw:1
13:15:07.764 JACK was started with PID=2027.
jackd 0.118.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd 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
getting driver descriptor from /usr/lib/jack/jack_alsa.so
getting driver descriptor from /usr/lib/jack/jack_dummy.so
getting driver descriptor from /usr/lib/jack/jack_net.so
getting driver descriptor from /usr/lib/jack/jack_oss.so
JACK compiled with System V SHM support.
server `default' registered
cannot lock down memory for jackd (Cannot allocate memory)
loading driver ..
apparent rate = 44100
creating alsa driver ... hw:1|hw:1|1024|4|44100|0|0|nomon|swmeter|-|32bit
control device hw:1
configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 4 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 4 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 4 periods for playback
registered builtin port type 32 bit float mono audio
registered builtin port type 8 bit raw midi
clock source = system clock via clock_gettime
new client: alsa_pcm, id = 1 type 1 @ 0x9c51448 fd = -1
start poll on 3 fd's
new buffer size 1024
JACK: unable to mlock() port buffers: Cannot allocate memory
JACK: unable to mlock() port buffers: Cannot allocate memory
registered port system:capture_1, offset = 4096
registered port system:capture_2, offset = 8192
registered port system:playback_1, offset = 0
registered port system:playback_2, offset = 0
++ jack_sort_graph
++ jack_rechain_graph():
+++ client is now alsa_pcm active ? 1
client alsa_pcm: internal client, execution_order=0.
-- jack_rechain_graph()
-- jack_sort_graph
ALSA: could not start playback (Broken pipe)
DRIVER NT: could not start driver
cannot start driver
starting server engine shutdown
server thread back from poll
stopping driver
unloading driver
freeing shared port segments
stopping server thread
stopping watchdog thread
last xrun delay: 0.000 usecs
max delay reported by backend: 0.000 usecs
freeing engine shared memory
max usecs: 0.000, engine deleted
cleaning up shared memory
cleaning up files
unregistering server `default'
13:15:07.906 JACK was stopped successfully.
13:15:07.908 Post-shutdown script...
13:15:07.909 killall jackd
jackd: no process found
13:15:08.328 Post-shutdown script terminated with exit status=256.
13:15:09.842 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
The messages about "JACK: unable to mlock() port buffers: Cannot allocate memory" also appear when I start jack on the onboard soundcard, but this does not prevent it from working (so they may not be the problem with the h4n neither). Apart from that, I do not see any meaningfull error message.

For info, aplay -l gives :

Code: Select all

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC269 Analog [ALC269 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: H4 [H4], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I am running kernel 2.6.32-22-generic. My /etc/security/limits.d/audio.conf file says :

Code: Select all

@audio   -  rtprio     99
# @audio   -  memlock    unlimited
@audio   -  nice      -19
I had to deactivate memlock because it would prevent even jack from starting even with the onboard soundcard.

I am stuck here. Any help would be appreciated.
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: capture problem with zoom h4n (jackd configuration)

Post by autostatic »

Hello svictor, and welcome!

You do need the memlock setting, that's what JACK is complaining about. But in your case don't set it to unlimited but use the outcome of 0.8 x your RAM size in kilobytes (so your RAM size minus 20%). If JACK still refuses to start, try lowering the memlock settings in like steps of 10%.
Also make sure the settings in /etc/security/limits.d/audio.conf aren't also in /etc/security/limits.conf.

Best,

Jeremy
svictor
Established Member
Posts: 4
Joined: Sun May 02, 2010 10:16 am

Re: capture problem with zoom h4n (jackd configuration)

Post by svictor »

Thanks for the tip !
This does not seem to work in my case. I have 1 GB of memory installed.

Code: Select all

cat /proc/meminfo 
MemTotal:        1017992 kB
MemFree:           42456 kB
Buffers:            9888 kB
Cached:           782820 kB
SwapCached:          192 kB
Active:           646224 kB
Inactive:         281744 kB
Active(anon):     512508 kB
Inactive(anon):   170460 kB
Active(file):     133716 kB
Inactive(file):   111284 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:        130696 kB
HighFree:            240 kB
LowTotal:         887296 kB
LowFree:           42216 kB
SwapTotal:       1000440 kB
SwapFree:         999904 kB
Dirty:                64 kB
Writeback:             0 kB
AnonPages:        135056 kB
Mapped:            66572 kB
Shmem:            547708 kB
Slab:              19720 kB
SReclaimable:      10416 kB
SUnreclaim:         9304 kB
KernelStack:        2024 kB
PageTables:         3840 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1509436 kB
Committed_AS:    1110268 kB
VmallocTotal:     122880 kB
VmallocUsed:       25280 kB
VmallocChunk:      88956 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       4096 kB
DirectMap4k:       24568 kB
DirectMap4M:      884736 kB
So I started by setting a memlock of 814393 and tested all the way down to 100000 by 100000 steps. No success !

Commenting the whole memlock line in audio.conf solves the problem for my onboard card (but not for the h4n through usb).

Here is the output of qjackctl (with "@audio - memlock 500000") :

Code: Select all

20:32:43.960 JACK is starting...
20:32:43.961 /usr/bin/jackd -v -dalsa -r44100 -p1024 -n4 -D -Chw:1 -Phw:1
jackd 0.118.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd 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
getting driver descriptor from /usr/lib/jack/jack_alsa.so
getting driver descriptor from /usr/lib/jack/jack_dummy.so
20:32:43.995 JACK was started with PID=5955.
getting driver descriptor from /usr/lib/jack/jack_net.so
getting driver descriptor from /usr/lib/jack/jack_oss.so
JACK compiled with System V SHM support.
server `default' registered
loading driver ..
apparent rate = 44100
creating alsa driver ... hw:1|hw:1|1024|4|44100|0|0|nomon|swmeter|-|32bit
registered builtin port type 32 bit float mono audio
registered builtin port type 8 bit raw midi
clock source = system clock via clock_gettime
start poll on 3 fd's
new client: alsa_pcm, id = 1 type 1 @ 0x893f448 fd = -1
control device hw:1
20:32:45.213 JACK was stopped successfully.
20:32:45.214 Post-shutdown script...
20:32:45.215 killall jackd
20:32:45.216 JACK has crashed.
jackd: no process found
20:32:45.675 Post-shutdown script terminated with exit status=256.
20:32:46.090 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
I would appreciate any other suggestions. Thanks for you help anyway !
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: capture problem with zoom h4n (jackd configuration)

Post by Pablo »

Hi,

Some ideas in case they help.

I would say that, unless you have different "devices" that you need to use one for playback and the other for capture, it is neater to leave these fields "default" and select only the proper "interface". According to "aplay -l" you have only one device in your "interface" (card number hw:1).

I have read here and there that periods / buffer should normally be 2. Maybe 3. Also, those usb cards normally work at 48000, afaik.

Also, try in other connections. It is better if the audio card is the only device in a bus. Check with lsusb.

Cheers! Pablo
svictor
Established Member
Posts: 4
Joined: Sun May 02, 2010 10:16 am

Re: capture problem with zoom h4n (jackd configuration)

Post by svictor »

Thanks ! I will leave the "default" fields and leave the "interface" for further tests. This alone does not solve the problem though.

I had also read about the best periods/buffer being 3 for usb soundcards. More does not hurt though (as far as I know) : it just increases latency.

The h4n lets you chosse between 44100 and 44800 when used as a soundcard. I have tried both but no success.

Regarding the usb bus, I cannot seem to get a dedicated one for anything I plug in. I use a eeepc 1000H and the plugs seem to actually be linked to onboard hubs (the built-in mic for example also gets in there according to lsusb). This is not a problem for my other external soundcard though : an edirol ua-25, which works just fine with jack. (So why don't I just stick to that ? Because I need to travel around, and the h4n being more versatile - multi-track recorder, built-in mics, etc. - it is my first choice for the backpack).

Blue skies !
Victor
marec
Posts: 1
Joined: Wed Dec 01, 2010 11:12 pm

Re: capture problem with zoom h4n (jackd configuration)

Post by marec »

Hi svictor!

I have exactly the same problem with my H4n and ubuntu 10.10. Did you find any sollution for your setup?

-Marec
svictor
Established Member
Posts: 4
Joined: Sun May 02, 2010 10:16 am

Re: capture problem with zoom h4n (jackd configuration)

Post by svictor »

Hi Marec,
I didn't really get any further with the zoom h4n. So I switched back to using my other card (edirol ua-25)...
Good luck,
Victor
Rusty8
Posts: 1
Joined: Sun Apr 10, 2011 11:00 pm

Re: capture problem with zoom h4n (jackd configuration)

Post by Rusty8 »

Hi Marec

i know this post is outdates but found a solution

running linux mint 10 with jackd and ardour, these are my settings after pluging h4n and connecting.

server jackd -s driver > alsa > input device hw1 (h4n)

did little searching - comined results form other posts and turned up with this. easey. fired up ardour and audacity both pickup h4 no prob awesome!!!!!

any more info glad to help ----- im only newbie but i like a good freebie!!!!
Post Reply