jackd bus error on raspbian [probably solved]


4 posts
by pevo » Tue Dec 18, 2012 5:20 am
Hi ,
I tried to get jackd2 running with an external USB soundcard on raspbian/wheezy last weekend, but noticed the infamous bus error problem. It has been mentioned here in the forum and elsewhere. After compiling jackd2 from the current git repo and a bit of debugging with gdb and looking for answers I found out here:

http://planet.linuxaudio.org/bugs/ ( search for bug #295)

that the problem has actually already been solved, is has to do with missing 32bit alignment of some data structures in jackd. The alignment is needed for the ARM cpu of the pi. __attribute__((__packed__)) causes misalignment of some struct members, which in turn causes a bus error when they are accessed by a pointer. So the solution is to not use __attribute__((__packed__)).

I'll attach the patch that I made up and tried out , it applies to the latest jackd2 git repository HEAD, after commit 95a1162d6aecc91882e4d8b01ba7fb12f6d29d1c. It makes jackd start without the bus error, although I did not yet manage to run sooperlooper with it (which was my aim).

I start jackd with:

# jackd -n jacktest -p 11 -d alsa -d hw:1 -r 16000 -i 2 -o 2
jackdmp 1.9.10
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2012 Grame.
jackdmp 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
JACK server starting in realtime mode with priority 10
creating alsa driver ... hw:1|hw:1|1024|2|16000|2|2|nomon|swmeter|-|32bit
configuring for 16000Hz, period = 1024 frames (64.0 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 2 periods for playback

My USB audio device is a "LogiLink 7.1 channel USB sound box":

Bus 001 Device 004: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device

So thats about as far as I got during last sunday evening, I thought this might be valuable information for some other people around here experimenting with jackd on raspbian.

Have fun ;)
Attachments
0001-fix-bus-error-on-raspberry-pi.patch.gz
patch
(1.16 KiB) Downloaded 195 times
Posts: 1
Joined: Sun Dec 16, 2012 11:20 am
by moony » Thu Jan 17, 2013 8:35 pm
Hi, I get "Hunk #1 FAILED at 33." if I try to apply your patch. I tried the described commit and the latest git version.
And is it possible to use jackd2 with the internal sound chip at all or just with an USB sound interface?
Posts: 25
Joined: Sat Sep 08, 2012 5:28 pm
by theoB610 » Thu Jan 31, 2013 4:13 pm
How do I apply the patch?
TuringPi- powered USB Hub (kbd, mouse) and VGA screen via adapter.
LorenzPi - powered by phone charger, with breakout board and camera module.
Both connected by Ad-hoc network, Lorenz ssh'ed from Turing.
User avatar
Posts: 231
Joined: Sat Jan 05, 2013 12:40 pm
Location: Devon
by ianmacs » Fri Apr 26, 2013 10:21 pm
Source code on github is fixed since 2013-04-13.

Compile with
./waf configure --alsa
./waf build
sudo ./waf install

Edit:
Upstream BTS link: http://trac.jackaudio.org/ticket/295
Commit: https://github.com/jackaudio/jack2/comm ... 1de6e7aa0d
Posts: 30
Joined: Mon Jul 09, 2012 10:42 am