A few people have asked me since I made the MBox2 driver whether the original Mbox (with Focusrite preamps) could be made to work with Linux.
The current status in the mainline kernel is that playback is supported but users have reported issues with loud static noises appearing sporadically. Capture is not supported currently at all.
I FIXED IT!
You need two things:
1) Firmware update from Avid here, also mirrored on my site here.
You need access to a Mac computer to flash the updated firmware to the device to fix the problem with the sporadic white noise.
Run this command in linux with the device plugged in to check your current firmware version:
sudo lsusb -vv -d 0dba:1000 |grep bcdDevice |awk '{print $2}'
Anything less than 0.22 and you will need the updated firmware above.
2) My driver code (kernel lower than 3.5)
Make sure you have kernel headers installed and a working C compiler.
You can download my working driver here:
git clone http://www.github.com/zamaudio/alsa-driver.git
cd alsa-driver/alsa
git checkout mbox1clean
./gitcompile
sudo make install
Reboot and enjoy!
Alternatively, if you want to run a newish 3.14 kernel grab this tarball instead.
tar zxvf mbox1-3.14.tar.gz
cd mbox1-3.14
make
sudo make install
Reboot and enjoy!
NOTE: Kernels 3.5 – 3.13 are NOT supported.
There was some bug that caused a bucketload of xruns.
As of Linux Kernel 3.19, these changes are merged into the kernel already.
95 thoughts on “Digidesign (original Mbox) Linux Driver”
This is excelent news and thanks for posting on my post on kx studios forums!. I had given up on the device and it has been sitting in a cupboard for months. Look forward to seeing this put to use instead of my current method of using a tascam wav recorder as a preamp going into my noisy internal sound card.
will a mbox 3 driver come sometime ?
Do you have a mbox3? Have you tried it with linux? It might just work out of the box.
I can only find 1 reference to mbox 3 in linux from back in 2009 which says it works with alsa and shows up, but did not in jack. The mbox 2 patch got it to show up in jack however jack would not start, this may be due to a USB bug in the kernel back then but cant know for sure.
If you have an mbox you just have to try and see but dont hold your breath.
If it doesnt work, i dont see a driver coming out anytime soon. The developer doesnt get paid for the patch development and is pretty busy. its all dependand on if he can get the time and if he can get hold of the hardware.
Please consider donating though to help future development of digidesign workarounds
Looking forward to being able to record using an original mbox on linux (made donation).
Thanks! Well you can now. See above.
I couldnt get it to find the kernel headers unless, apperenlty there in a different location in newer ubuntu distros.
So i managed to fix that by linking a file (found on another site)
It got past that but errored out with make error (2)
currently trying a few things and will get back if i managed to get it installed
n file included from /home/bazsound/alsa-driver/alsa/acore/hrtimer.c:1:0:
/home/bazsound/alsa-driver/alsa/include/adriver.h:127:0: warning: “GFP_DMA32” redefined [enabled by default]
include/linux/gfp.h:154:0: note: this is the location of the previous definition
In file included from /home/bazsound/alsa-driver/alsa/acore/hrtimer.c:1:0:
/home/bazsound/alsa-driver/alsa/include/adriver.h:363:28: error: static declaration of ‘jiffies_to_msecs’ follows non-static declaration
include/linux/jiffies.h:292:21: note: previous declaration of ‘jiffies_to_msecs’ was here
/home/bazsound/alsa-driver/alsa/include/adriver.h:382:29: error: static declaration of ‘msecs_to_jiffies’ follows non-static declaration
include/linux/jiffies.h:294:22: note: previous declaration of ‘msecs_to_jiffies’ was here
In file included from /usr/src/linux-headers-3.8.0-32-lowlatency/arch/x86/include/asm/pci.h:4:0,
from include/linux/pci.h:1422,
from /home/bazsound/alsa-driver/alsa/include/adriver.h:461,
from /home/bazsound/alsa-driver/alsa/acore/hrtimer.c:1:
include/linux/mm.h:294:14: error: conflicting types for ‘snd_compat_vmalloc_to_page’
/home/bazsound/alsa-driver/alsa/include/adriver.h:316:14: note: previous declaration of ‘snd_compat_vmalloc_to_page’ was here
In file included from /usr/src/linux-headers-3.8.0-32-lowlatency/arch/x86/include/asm/pci.h:148:0,
from include/linux/pci.h:1422,
from /home/bazsound/alsa-driver/alsa/include/adriver.h:461,
from /home/bazsound/alsa-driver/alsa/acore/hrtimer.c:1:
include/asm-generic/pci-dma-compat.h:110:19: error: expected identifier or ‘(’ before numeric constant
In file included from /home/bazsound/alsa-driver/alsa/acore/hrtimer.c:1:0:
/home/bazsound/alsa-driver/alsa/include/adriver.h:1152:0: warning: “page_to_pfn” redefined [enabled by default]
include/asm-generic/memory_model.h:72:0: note: this is the location of the previous definition
/home/bazsound/alsa-driver/alsa/include/adriver.h:1207:27: error: conflicting types for ‘dev_name’
include/linux/device.h:731:27: note: previous definition of ‘dev_name’ was here
/home/bazsound/alsa-driver/alsa/include/adriver.h: In function ‘dev_name’:
/home/bazsound/alsa-driver/alsa/include/adriver.h:1209:12: error: ‘struct device’ has no member named ‘bus_id’
/home/bazsound/alsa-driver/alsa/include/adriver.h: At top level:
/home/bazsound/alsa-driver/alsa/include/adriver.h:1300:21: error: static declaration of ‘pci_ioremap_bar’ follows non-static declaration
include/linux/pci.h:1628:15: note: previous declaration of ‘pci_ioremap_bar’ was here
/home/bazsound/alsa-driver/alsa/include/adriver.h: In function ‘pid_vnr’:
/home/bazsound/alsa-driver/alsa/include/adriver.h:1382:18: error: dereferencing pointer to incomplete type
/home/bazsound/alsa-driver/alsa/include/adriver.h: At top level:
/home/bazsound/alsa-driver/alsa/include/adriver.h:1501:21: error: static declaration of ‘vzalloc’ follows non-static declaration
include/linux/vmalloc.h:55:14: note: previous declaration of ‘vzalloc’ was here
/home/bazsound/alsa-driver/alsa/include/adriver.h:1512:19: error: redefinition of ‘div_u64’
include/linux/math64.h:82:19: note: previous definition of ‘div_u64’ was here
make[3]: *** [/home/bazsound/alsa-driver/alsa/acore/hrtimer.o] Error 1
make[2]: *** [/home/bazsound/alsa-driver/alsa/acore] Error 2
make[1]: *** [_module_/home/bazsound/alsa-driver/alsa] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-32-lowlatency’
make: *** [compile] Error 2
hmm yeah this is where im stuck
right think i have it. switched to kernel 3.5 and … its now doing a hell of a lot more.
Seems that recent kernels have too many changes that breaks your patch.
So, there should be a note that recent kernels may not work.
3.11 and 3.8 didnt work for me. 3.5 does 🙂
Success!! it successfully compiled and installed.
mbox seems to be working, however im still getting the white noise problem. dmesg is giving me this
[ 360.419909] ALSA pcm.c:1324 >delay: estimated 177, actual 44
[ 364.924504] retire_capture_urb: 2 callbacks suppressed
[ 364.927505] ALSA pcm.c:1324 >delay: estimated 177, actual 1
[ 366.321339] ALSA pcm.c:1324 >delay: estimated 309, actual 0
[ 367.847195] ALSA pcm.c:1324 >delay: estimated 221, actual 0
[ 367.894216] ALSA pcm.c:1324 >delay: estimated 222, actual 1
[ 369.360103] ALSA pcm.c:1324 >delay: estimated 397, actual 45
[ 369.365080] ALSA pcm.c:1324 >delay: estimated 178, actual 45
[ 372.346775] ALSA pcm.c:1324 >delay: estimated 222, actual 1
[ 372.390817] retire_capture_urb: 6 callbacks suppressed
[ 372.392798] ALSA pcm.c:1324 >delay: estimated 221, actual 0
[ 373.924716] ALSA pcm.c:1324 >delay: estimated 353, actual 45
[ 373.926678] ALSA pcm.c:1324 >delay: estimated 266, actual 1
[ 378.372214] ALSA pcm.c:1324 >delay: estimated 133, actual 1
[ 443.551101] ALSA pcm.c:1324 >delay: estimated 221, actual 0
[ 445.546205] ALSA pcm.c:1324 >delay: estimated 397, actual 44
[ 445.548162] ALSA pcm.c:1324 >delay: estimated 265, actual 1
[ 446.484239] ALSA pcm.c:1324 >delay: estimated 310, actual 1
[ 446.485206] ALSA pcm.c:1324 >delay: estimated 310, actual 1
[ 447.908255] ALSA pcm.c:1324 >delay: estimated 177, actual 45
[ 456.120542] ALSA pcm.c:1324 >delay: estimated 222, actual 45
[ 468.832998] ALSA pcm.c:1324 >delay: estimated 353, actual 1
[ 468.833022] ALSA pcm.c:1324 >delay: estimated 354, actual 45
[ 468.833928] retire_capture_urb: 7 callbacks suppressed
[ 468.837989] ALSA pcm.c:1324 >delay: estimated 133, actual 0
[ 468.895002] ALSA pcm.c:1324 >delay: estimated 398, actual 45
[ 468.899948] ALSA pcm.c:1324 >delay: estimated 178, actual 45
[ 488.951496] ALSA pcm.c:1324 >delay: estimated 353, actual 0
[ 488.952449] retire_capture_urb: 15 callbacks suppressed
[ 488.953451] ALSA pcm.c:1324 >delay: estimated 265, actual 44
[ 497.537666] ALSA pcm.c:1324 >delay: estimated 353, actual 1
[ 497.538611] ALSA pcm.c:1324 >delay: estimated 310, actual 1
[ 497.538639] retire_capture_urb: 2 callbacks suppressed
[ 499.689623] ALSA pcm.c:1324 >delay: estimated 221, actual 0
[ 517.824954] ALSA pcm.c:1324 >delay: estimated 353, actual 0
[ 517.825864] retire_capture_urb: 7 callbacks suppressed
[ 518.945876] ALSA pcm.c:1324 >delay: estimated 265, actual 44
[ 521.949895] ALSA pcm.c:1324 >delay: estimated 90, actual 1
[ 523.404923] ALSA pcm.c:1324 >delay: estimated 309, actual 44
bazsound@bazsound-MS-7309:~$
bazsound: can you post the output of
lsusb -vv -d 0dba:1000
to a pastebin service please. Also don’t forget to reboot before testing the mbox.http://pastebin.com/JUkmacjT
Thanks.
Yes i rebooted and confirmed that your patch has definatly improved things as now input works. Ive just tested with a mic and it works fine. However playback the white noise issue still happens. It also happens if im not playing and i route the mic input to a bus which i have an effect on. So it pretty much happens anytime it has to produce sound.
Just a thought, what firmware was on the mbox you recieved? there are a couple of versions. There were reports of white noise problems on mac, digidesign released a firmware update that was to fix the issue, but apparantly it did not happen on windows.
anyawy i have the firmware that is for windows pc’s as i flashed it a while back to see if it would fix the white noise issues.
I could see if i can get someone to update the firmware back to R22
bazsound: how did you find out the firmware revision number?
Only way i know is runnning the windows firmware updater, or on a mac in i think system profiler.
i’ll give it a shot on my other computer (will need to install jack and ardour) incase its just this machine that is causing the issues.
just a thought, is it possible that something is interupting the mbox’s internal clock? or something isnt set right and its trying to use another clock instead of the mbox;s.
I seem to remember reading that the mbox2 the spdif lights are always on. the mbox 1 spdif lights stay off.
anyway just some thoughts. as the guy i got it off of when i said i had white noise issues but its probably a driver issue, he said it sounded like clock issues.
My comments never seemed to get posted.
I think the firmware v can only be found out on a mac via the system profiler, it might be able to be checked by running the firmware updater for the pc but i dont know if the updater reads the firmware reports it first before allowing the update. It might just check the firmware report it and and update the firmware.
anyway.
the guy i got the mbox from mentioned that he said it sounded like a clock issue. there are also other reports of bad usb cables or the particular usb port being used.
the white noise will suddenly happen for about 5 seconds then it will fade out with distortion then audio plays again, until a short time later it happens again and just keeps repeating like that.
sometimes if i stop playback, the white noise will also stop bbut sometimes it conintunes on for a short period before silencing again.
from what i know, the mbox has its own internal clock so i dont know if maybe something is interfering with the clock.
I’ll try and test it on another machine just incase my machine has poor USB.
failing that, i will give it to someone with a mac so they can update it with firmware 22 and see if that solves it.
I did test it on windows briefly a while back and had no problems as far as i remember. but that was on a different machine (EEE pc notebook)
hopefully these comments get posted this time
bazsound: i am also having white noise issues, it seems to occur whenever the stream is opened on every second or third time. The way to fix it is to use JACK sound server and if you get white noise, stop and restart jack once and you should be good to go.
I am still investigating the source of the problem but it appears to be hardware / firmware related, and I don’t think I can fix it easily.
ok i will get the latest mac firmware flashed and see if that solves the problem.
unfortnatly it seems the only way to flash the latest firmware is with a mac.
I should hopefully be able to leave it at work on the 31st and have a work collegue who is working on the 1st flash it for me.
its strange how it doesnt seem to happen in windows..
bazsound: I downloaded the firmware update from Avid and tried to flash my device, but it said “Your current Mbox firmware is already the same as this version.” (it was rev20).
Then I found a newer firmware, rev22, it works!! NO MORE NOISE!
excelent i knew it! i must have had v20 before i flashed to the older pc version.
great news!!! ill get someone to flash my box to v22
I’ll update the threads i have on ardour and kx studio forums with the news.
Thanks for all your hardwork and help in getting to the bottom of these issues.
Feel free to donate or encourage more donations. Its not that easy to reverse engineer peripherals.
Hello, thanks for the great work! Is this going to the alsadriver in the upstream kernel?
Because I can’t seem to compile the patch with my 3.10 kernel
sa: Hi sorry, I am in the process of getting it patched upstream, it’s taking a while to get a good response from the alsa devs, but yes it will eventually get into mainline.
no problem. I’m just happy that I soon can use my old Mbox again 🙂
I had problems compiling with recent kernels. that’s the problem with running software that is too new.
compiled it with kernel 3.5
newer is not always better.
./gitcompile: line 56: aclocal: command not found
If you get this error, you need to install automake. Just incase anyone else comes across this error
Success!
Can confirm that flashing the v22 firmware cures the horrible white noise. Patch gets inputs working.
I am having problems with clicks now and then but this may be due to my usb ports since im running a wireless mouse, hard drive, internet connectionn via tethering.
Dmesg displays this all while playing
[ 341.773895] ALSA pcm.c:1324 >delay: estimated 354, actual 177
[ 341.959975] ALSA pcm.c:1324 >delay: estimated 0, actual 177
[ 341.959991] ALSA pcm.c:1324 >delay: estimated 530, actual 177
[ 341.959998] ALSA pcm.c:1324 >delay: estimated 530, actual 177
[ 341.961963] ALSA pcm.c:1324 >delay: estimated 441, actual 176
[ 341.967965] ALSA pcm.c:1324 >delay: estimated 265, actual 176
[ 342.545272] ALSA pcm.c:1324 >delay: estimated 1, actual 177
[ 342.549259] ALSA pcm.c:1324 >delay: estimated 353, actual 176
[ 342.826423] ALSA pcm.c:1324 >delay: estimated 0, actual 177
[ 342.826500] ALSA pcm.c:1324 >delay: estimated 529, actual 176
[ 342.828437] ALSA pcm.c:1324 >delay: estimated 441, actual 176
[ 469.234562] ALSA pcm.c:1324 >delay: estimated 89, actual 0
[ 470.407149] ALSA pcm.c:1324 >delay: estimated 134, actual 45
I also get the odd xrun even with low dsp usage but that could just be due to my less than ideal setup of usb stuff.
I only have 4 ports on my motherboard plus an extra 2 that you connect headers 2 (these 2 are alot slower)
I’ll report back if i find the issue (which is probably more to do with my machine)
bazsound: You probably need to run a RT patched kernel and set up real time IRQ priorities correctly for you to receive the full benefit and stability.
Hi damo, After lots of trying different things i think your right, its the only thing i havnt tried yet. I enabled IRQ threading and installed that on my current lowlatency kernel and made sure my USB ports had higher priority but with same results.
so looks like i really need an RT kernel instead of lowlatency.
Hi damo,
First I would like to thank you for all the efforts you put in supporting Digidesign hardware, making them useful for our sucking-less plateform.
When i read this news I have got excited to the point I reinstalled OS X on my old ibook to update the firmware of my Mbox (v20 for now). Unluckily, I have not been able to update it. I have downloaded both dmg containers, and compared their checksums. As they returned the same, i concluded that my downloads were OK. You have to know that the only OS X i got is OS X 10.3, codename Panther. On the Avid website page dedicated to the firmware, they mainly mention OS X 10.4, codename Tiger. It seems to me that it could explain that the firmware update app just does not run on Panther. It quickly closes just after starting, without displaying anything.
I just wanted to let you know this compatibility issue for the firmware update step.
Do not worry about me, I will ask a friend who owns all what is needed to update the firmware for me.
About a bounty, I will support you when I could do, which could still take some months.
Anyway, thanks a lot again!
Cordially,
Julien
Hi Julien,
That is unfortunate about the firmware installer. Good luck with getting your firmware updated and I hope to read of your success soon. I am trying to get the patch into ALSA (kernel), so people won’t need to use customised code.
I had a similar problem in that i dont even have a mac. So had to borrow a friends mac. the firmware update is very quick, at first i didnt think it had done anything. it must be no more than 10 seconds.
anyway, i have given up trying to solve the clicks and pops on my system, ive tried different distros, different usb ports, cables, IRQ assigments, all sorts of bios options. Jack settings. even the most recent kernels dont help though the clicks and pops in 3.11 are less noisy.
So im just putting it down to my cheap motherboard. I may try a PCI USB card so that it is completly seperate from my other USB devices.
Hi, I got up to ./gitcompile and got a whole bunch of warnings/errors [1]. I didn’t go any further, since I was worried of breaking my system. (Also, does this install a new version of alsa? Could I use checkinstall during installation to allow me to revert it easily?)
[1] http://pastebin.com/jBMdX7ag
Haathi: Yes this builds a whole set of alsa drivers… unfortunately it is not compatible with latest kernels like 3.11. I had mine working with 3.2.0 and someone else reported 3.5 works too. Sorry, I can’t provide more code until the alsa team merge my changes.
Ah bummer. Thanks for the reply, though.
I’m about to upgrade to (K)ubuntu 14.04 with kernel 3.13, to fix some horrible mesa bugs, so rolling back all the way to 3.5 is not a great option for me. I suppose you don’t have any idea when the changes might be merged into alsa?
Thanks again.
Haathi: You can follow the thread on the ALSA dev mailing list here: http://mailman.alsa-project.org/pipermail/alsa-devel/2014-March/073627.html but it looks like there are some more major issues with the code that need to be fixed before my code can be merged.
Thanks. I can’t say I understand the code, but it looks like you are getting much feedback. I look forward to using the driver! I’ve donated in anticipation. Cheers.
Looking very much forward to being able to use this. Unfortunately I’d really like to avoid downgrading my kernel. Is there any news on getting this into ALSA? Also, if this gets accepted into ALSA, does that mean it will start compiling against the latest kernels right away? I’m on Ubuntu 14.04 (kernel 3.13.0), is there any hope for me that this might work with that?
StFS: Yes, that is the plan.
Ubuntu 14.04 is still in beta. Its testing software.
I woudnt use it if you want to have reliable work.
12.04 is the latest i would use even then there are still lots of bugs.
Also remember that the newest kernels are not always best, there are bugs still being worked out particulary with USB sound. Its been recomended to roll back to 3.5 or lower in certain circumstances (usually with asyncronous usb interfaces)
Im running 3.11 on my machine (old athlon 64 dual core) ive been tod 3.5 best matches my hardware. ive not been able to get any of the kernes past 3.11 to work on my machine. they all lock up after login.
If you want to use the mbox, its very easy to install another kerne, you dont have to downgrade. You can have multipe kernels and choose which one you use at boot.
bazsound. One’s kernel experience is probably quite variable. There are bugs in older kernels that affect me, so using newer ones is preferred. However, using multiple kernels is a good idea.
Hi,
Has anyone got an MBox 3 working on Ubuntu?
Here’s the lsusb dump – http://pastebin.com/2J0g1q0c
Cheers,
How do I know if kernel headers are installed on my mac that is running 10.9.2 Mavericks and how do I know if i have a working c compiler?
how does a common non programming guy like me run this driver code and not screw anything up?
In a Terminal
sudo apt-get install linux-headers-$(uname -r)
That is if your running Ubuntu based distrobutions, Debian based distros should work aswell
Compiling the driver is unlikly to screw anything up, I dont program and i regularly compile stuff, but it does take practice, googling and the occasional mistake which sometimes has odd resuts, but generally as long as your carefull it either installs or it doesnt.
be carefull with the sudo command, it will allow to do anything you want to your system even delete or modify important system files. Sudo has the potential to play havock on your system if it is used carelessly.
Thanks for the info. I’ll try it out. First I’ll have to figure out Ubuntu based distributions.
Thanks for the info. I’ll try it out. First I’ll have to figure out Ubuntu based distributions.
Hi,
Has anyone got an MBox 3 working on Ubuntu?
Here’s the lsusb dump – http://pastebin.com/2J0g1q0c
Cheers,
If your running ubuntu based distro it should be fairly straitforward. I would recomend kx studio which is based on ubuntu and is setup the best for audio work IMO.
you will want to install kernel 3.5 as it will only compile in kernels 3.5 and lower.
sometimes the grub menu doesnt show on boot so you will need to get that showing so you can select which kernel to boot up.
Once you are booted up in kernel 3.5 install kernel headers then the patch should compile fine