usx2y jack driver
PATCH 1/1 usx2y jack driver
hi,
this adds a hw_dep device to snd-usb-usx2y to communicate pcm in native usb chuncs with userspace.
it also adds a usx2y driver to jack, so you can play with it.
works fine here.
I can reliably use 128frames 2periods now on kernel 2.6.9-rc2-mm1-S1. Without crackles of course.
(On a 500MHz PIII with UHCI-usb. Problems with OHCI may still be there, don't know.)
The tar.bz2 file is made of 4 parts:
Apply snd-usb-usx2y.patch.0.7.3+hwdep_pcm to alsa-kernel/usb, snd-usb-usx2y.patch.0.7.3+hwdep_pcm_asound.h to alsa-kernel/include/asound.h.
Apply jack_usx2y_driver.patch to jack and cp usx2y to jack/drivers.
To build Jack, you'll have to call autogen.sh and then configure. The tweaked snd-usb-usx2y will propably only build in linux-kernel. I tried nothing else.
By the way: is there a script to cp alsa-kernel source to the linux kernel source?
Please comment.
Best regards,
Karsten
P.S.:
This snd-usb-usx2y keeps on working exactly as before, if it is used as before.
New behaviour will only show, if you start jackd like this:
jackd -dusx2y -dhw:x
Hi Karsten,
Quoted 10 lines
this adds a
hw_depdevice to snd-usb-usx2y to communicate pcm in native usb chuncs with userspace. it also adds a usx2y driver to jack, so you can play with it.works fine here.
I can reliably use 128frames 2periods now on kernel 2.6.9-rc2-mm1-S1. Without crackles of course. (On a 500MHz PIII with UHCI-usb. Problems with OHCI may still be there, don't know.)
Amazing! I will check this out soon on my US-224. I'm a bit busy right now, so can't afford to trash my alsa/jack environment, at least for the time being.
BTW, that OHCI issue is really still open and quite ugly (cf. alsa-driver bug #0000425). It makes my US-224 almost useless on my laptop :( Every time I try to open the pcm device I get a fatal kernel oops. Midi is ok however.
I must remember you that this all used to work satisfactorily around alsa-driver-1.0.5a inclusive. IIRC it was that "no sleeping in ALSA's pcm START/STOP callback" patch (as of CVS circa July 12-13) that broke something, unfortunately I'm sure.
If you find the patience/time to lead me on debugging this, I'll appreciate a lot.
Cheers,
Signature · 10 lines
rncbc aka Rui Nuno Capela [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Hi,
Quoted 12 lines
Quoted 10 lines · Karsten Wiese
this adds a
hw_depdevice to snd-usb-usx2y to communicate pcm in native usb chuncs with userspace. it also adds a usx2y driver to jack, so you can play with it.works fine here.
I can reliably use 128frames 2periods now on kernel 2.6.9-rc2-mm1-S1. Without crackles of course. (On a 500MHz PIII with UHCI-usb. Problems with OHCI may still be there, don't know.)
Quoted 4 lines
Amazing! I will check this out soon on my US-224. I'm a bit busy right now, so can't afford to trash my alsa/jack environment, at least for the time being.
That's right.
I've already worked out this new usx2y jack driver with my US-224 and the results are really excellent! Kudos to Karten!
No crackles at all, while starting jackd -R -d usx2y -p 128 -n 2. A real breakthrough achievement!
Real good stuff, considering that while on these settings with the stock alsa jack driver my ears could not stand the annoyance of all the boiling :) The minimum alsa settings were -p256 -n2, even barely crackling.
This has been just tested on my SUSE 9.1 box, P4 2.8GHz HT, happy now with a 2.6.9-rc2-mm3-S6 SMP/HT (full VP), UHCI USB controller.
I'm so happy that even qjackctl has already experimental support for this usx2y driver thing (qjackctl 0.2.11.9). You can check it out from CVS (sf.net lag time applies here :)
I have also setup a web directory where I'll keep related packages files (e.g. jack RPMS for SUSE 9.1 are in there).
It's here:
http://www.rncbc.org/usx2y/
Please note that this will be only maintained while being experimental.
So here it goes, my lobbying but serious vote to include this usx2y driver in the official JACK CVS tree.
Quoted 6 lines
BTW, that OHCI issue is really still open and quite ugly (cf. alsa-driver bug #0000425). It makes my US-224 almost useless on my laptop :( Every time I try to open the pcm device I get a fatal kernel oops. Midi is ok however.
Quoted 8 lines
I must remember you that this all used to work satisfactorily around alsa-driver-1.0.5a inclusive. IIRC it was that "no sleeping in ALSA's pcm START/STOP callback" patch (as of CVS circa July 12-13) that broke something, unfortunately I'm sure.
If you find the patience/time to lead me on debugging this, I'll appreciate a lot.
I hadn't the time yet to test the new usx2y kernel and jack code on this yet. This OHCI issue is probably still roaring its ugly head.
Bye now.
Signature · 10 lines
rncbc aka Rui Nuno Capela [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 1 line · Rui Nuno Capela
I've already worked out this new usx2y jack driver with my US-224 and the
Maybe I am missing something. Why does this device need a specific jack driver, as opposed to using the ALSA driver? Wouldn't it be better to improve the ALSA driver so that it can be used with jack?
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Am Samstag 25 September 2004 04:15 schrieb Lee Revell:
Quoted 7 lines · Rui Nuno Capela
Quoted 1 line
I've already worked out this new usx2y jack driver with my US-224 and the
Maybe I am missing something. Why does this device need a specific jack driver, as opposed to using the ALSA driver? Wouldn't it be better to improve the ALSA driver so that it can be used with jack?
Its usb's unableness to atomically handle power of 2 period sized data chuncs, what led to:
This usx2y-alsa-jack driver pair uses a hardware dependant alsa-device for mmaped pcm transport.
Advantage achieved:
The usb_hcd places reads/writes pcm data into dma-memory.
That memory is mmaped by jack's usx2y driver.
Jack's usx2y driver is the first/last to read/write pcm data. Read/write is a combination of power of 2 period shaping and float/int conversation.
Compared to mainline alsa/jack we leave out power of 2 period shaping inside snd-usb-* which needs memcpy() and additional buffers.
As a side effect possible unwanted pcm-data coruption resulting of plain alsa's snd-usb-usx2y period shaping scheme falls away. Result is sane jack operation at buffering schemes down to 128frames, 2 periods.
plain usx2y alsa mode is able to achieve 64frames, 4periods, but only at the cost of easier triggered i.e. aeolus xruns (128 or 256frames, 2periods works but is useless cause of crackling).
New functionality would possibly be better integrated into mainlines at more apropriate places.
Target could be: jack mmaping power of 2 period sized float-pcm buffers and letting alsa (snd-usb-lib - alsa-lib - plugin) do power of 2 period shaping and float/int conversation.
erm, but I'd rather make some sounds with this stuff before i dig into that deeper. And there is still that ohci issue.
Best,
Karsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 6 lines · Karsten Wiese
Quoted 5 lines · Lee Revell
Maybe I am missing something. Why does this device need a specific jack driver, as opposed to using the ALSA driver? Wouldn't it be better to improve the ALSA driver so that it can be used with jack?
One thing I'm sure as my ears can't lie: the generic jack_alsa driver crackles quite badly (no xruns however), the jack_usx2y don't. Period. :)
Quoted 22 lines
Its usb's unableness to atomically handle power of 2 period sized data chuncs, what led to:
This usx2y-alsa-jack driver pair uses a hardware dependant alsa-device for mmaped pcm transport.
Advantage achieved:
Theusb_hcdplaces reads/writes pcm data into dma-memory.
That memory is mmaped by jack's usx2y driver.
Jack's usx2y driver is the first/last to read/write pcm data. Read/write is a combination of power of 2 period shaping and
float/int conversation.
Compared to mainline alsa/jack we leave out power of 2 period shaping inside snd-usb-* which needsmemcpy()and additional buffers.
As a side effect possible unwanted pcm-data coruption resulting of plain alsa's snd-usb-usx2y period shaping scheme falls away. Result is sane jack operation at buffering schemes down to 128frames, 2 periods.
plain usx2y alsa mode is able to achieve 64frames, 4periods, but only at the cost of easier triggered i.e. aeolus xruns (128 or 256frames, 2periods works but is useless cause of crackling).
Quoted 8 lines
New functionality would possibly be better integrated into mainlines at more apropriate places. Target could be: jack mmaping power of 2 period sized float-pcm buffers and letting alsa (snd-usb-lib - alsa-lib - plugin) do power of 2 period shaping and float/int conversation.
erm, but I'd rather make some sounds with this stuff before i dig into that deeper. And there is still that ohci issue.
FYI, on my laptop, that OHCI issue is still a serious showstopper. I am collecting some log/trace data to file and append on alsa's bugtracker (bug #0000425).
One thing I've noticed, but just related to VP, is that while having hardirq-preempt=1 and /proc/irq/10/ohci_hcd/threaded=1, the kernel doesn't crash when opening the PCM hw device (either via jackd or aplay). But still useless or zombie anyway. It does crash however when I unplug my US-224 (switch its power down).
With hardirq-preempt=0 or /proc/irq/10/ohci_hcd/threaded=0, I get the same old bad behavior: a kernel oops somewhere on the ohci_irq handling, almost immediately when the PCM device is open (e.g. by jackd or aplay).
If someone have an idea on how to dig on this, like some debugging silver-bullet :) I'll very thankful. Ingo Molnar has taught me the serial console method but, guess what, this is a post-modern laptop: it doesn't have a serial port. Duh?
Cheers.
Signature · 10 lines
rncbc aka Rui Nuno Capela [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 1 line · Rui Nuno Capela
Karsten Wiese wrote:
Thanks for the excellent description of the driver.
Quoted 5 lines
If someone have an idea on how to dig on this, like some debugging silver-bullet :) I'll very thankful. Ingo Molnar has taught me the serial console method but, guess what, this is a post-modern laptop: it doesn't have a serial port. Duh?
This is a really good point, I asked about it on LKML. I don't think an equivalent procedure is currently available for a legacy-free machine. This will become a serious problem as such machines become more common, as the serial console is the only way to diagnose some bugs.
For now you have to get by with magic sysrq.
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 3 lines · Lee Revell
For now you have to get by with magic sysrq.
That would be real magic to get SysRq+T to show up anything. It doesn't. Nor any other SysRq key comination. And just in case you'll ask next, I do have that magic included by kernel config, rest assured ;)
I guess the only chance I have right now, as kindly suggested by Karsten, is about taking a photo of the kernel oops screens (which I have done already, a couple of times), feeding it into some ocr, and disassemble that with ksymoops. Just thinking about it makes me feel the creeps.... :)
Oh my!
Signature · 11 lines
rncbc aka Rui Nuno Capela [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 9 lines · Rui Nuno Capela
Quoted 3 lines · Lee Revell
For now you have to get by with magic sysrq.
That would be real magic to get SysRq+T to show up anything. It doesn't. Nor any other SysRq key comination. And just in case you'll ask next, I do have that magic included by kernel config, rest assured ;)
Quoted 6 lines
I guess the only chance I have right now, as kindly suggested by Karsten, is about taking a photo of the kernel oops screens (which I have done already, a couple of times), feeding it into some ocr, and disassemble that with ksymoops. Just thinking about it makes me feel the creeps.... :)
You tried Ingo's suggestion of making the keyboard aka i8042 IRQ non-threaded, and still sysrq is not magic?
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 8 lines · Rui Nuno Capela
Quoted 3 lines · Karsten Wiese
erm, but I'd rather make some sounds with this stuff before i dig into that deeper. And there is still that ohci issue.
FYI, on my laptop, that OHCI issue is still a serious showstopper. I am collecting some log/trace data to file and append on alsa's bugtracker (bug #0000425).
One other idea. Do you have CONFIG_DEBUG_SPINLOCK_SLEEP enabled? If this problem is indeed related to the sleeping in PCM start/stop callbacks, and you enable this option, then I believe you would get a "Bad: scheduling while atomic" error in the syslog before the machine hangs.
Lee
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Quoted 6 lines · Lee Revell
Quoted 4 lines · Rui Nuno Capela
FYI, on my laptop, that OHCI issue is still a serious showstopper. I am collecting some log/trace data to file and append on alsa's bugtracker (bug #0000425).
Quoted 6 lines
One other idea. Do you have
CONFIG_DEBUG_SPINLOCK_SLEEPenabled? If this problem is indeed related to the sleeping in PCM start/stop callbacks, and you enable this option, then I believe you would get a "Bad: scheduling while atomic" error in the syslog before the machine hangs.
Yes I have CONFIG_DEBUG_SPINLOCK_SLEEP enabled and nothing shows up on the logs, at least as you say. I have already conducted my tests with netconsole as you and Ingo suggested, and posted some early results on alsa's bugtracker.
Hope to light up some bulb on Karsten's head ;)
Thank.
Signature · 10 lines
rncbc aka Rui Nuno Capela [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
usx2y jack driver: missing usx2yhwdeppcm.h
In reply to Karsten WieseHi Karsten,
Quoted 7 lines
The tar.bz2 file is made of 4 parts:
Apply snd-usb-usx2y.patch.0.7.3+hwdep_pcm to alsa-kernel/usb,
snd-usb-usx2y.patch.0.7.3+hwdep_pcm_asound.htoalsa-kernel/include/asound.h.
Quoted 5 lines
Apply jack_usx2y_driver.patch to jack and cp usx2y to jack/drivers.
To build Jack, you'll have to call
autogen.shand then configure. The tweaked snd-usb-usx2y will propably only build in linux-kernel. I tried nothing else.
I got the snd-usb-usx2y kernel module part done OK.
The jack usx2y driver part is missing the "usx2yhwdeppcm.h" header file. Apparently it was included in the tarball as a symlink to some local file of yours. Can't build jack without it.
Would you please send it to us?
Cheers.
Signature · 10 lines
rncbc aka Rui Nuno Capela [email protected] ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Re: usx2y jack driver: missing usx2yhwdeppcm.h
Am Freitag 24 September 2004 17:28 schrieb Rui Nuno Capela:
Quoted 14 lines
Hi Karsten,
Quoted 11 lines
The tar.bz2 file is made of 4 parts:
Apply snd-usb-usx2y.patch.0.7.3+hwdep_pcm to alsa-kernel/usb,
snd-usb-usx2y.patch.0.7.3+hwdep_pcm_asound.htoalsa-kernel/include/asound.h.Apply jack_usx2y_driver.patch to jack and cp usx2y to jack/drivers.
To build Jack, you'll have to call
autogen.shand then configure. The tweaked snd-usb-usx2y will propably only build in linux-kernel. I tried nothing else.
Quoted 7 lines
I got the snd-usb-usx2y kernel module part done OK.
The jack usx2y driver part is missing the "
usx2yhwdeppcm.h" header file. Apparently it was included in the tarball as a symlink to some local file of yours. Can't build jack without it.Would you please send it to us?
you propably already have it: its exactly the same as in alsa-kernel/usb/usx2y. make the symlink point to where alsa-kernel/usb/usx2y/usx2yhwdeppcm.h is on your system.
best,
karsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 20040926091255.GA3526@linux
jack crackles using ice1712 or es1968 recently intoduced? was: usx2y jack driver
<alsa and jack readers may skip the first lines>
Am Sonntag 26 September 2004 11:12 schrieben Sie:
Quoted 6 lines
Quoted 1 line
P.S.: Will you make aeolus stops data persistent somewhen?I'm not sure what exactly you mean by 'stops data' --- the definition of the stops themselves or the stop combinations you use to play.
I mean the data calculated at aeolus startup or on retune.
Quoted 8 lines
Both can be saved iff the stops directory and everything inside it is writeable for the user. If you are using a packaged distribution (e.g. CCRMA), the stops dir will be in a system-wide place and then you can't save anything. Just put it in your home dir and use the -S option or put
Aeolus.stops: /home/<your_login>/stops-0.0.9
does it have to be that name stops-0.0.9?
Quoted 7 lines
in your ~/.aeolusrc.
The stop combination memories and midi routing are then saved when you click 'Save' in the main window.
(All this assuming you are using aeolus-0.2.1)
My setup looks alike, but aeolus still takes its minute to boot, which it shurely deserves ;-)
Just rechecked aeolus - jack - snd_es1968 at 128frames/2periods:
Crackles en masse :-/
I thought I have used it not too long ok without Crackles. Everything OK with playback only:/usr/bin/jackd -R -dalsa -Phw:0 -p128 -n2
The same with zynaddsubfx: Crackles with input & output. output only ok.
using this (standard snd-usb-usx2y, 2ins 2outs, 4periods) /usr/bin/jackd -R --unmlock -dalsa -dhw:1 -i2 -n4 -p64 -r48000 is still ok.
Are there some subtle changes in alsa/jack relating ice1712 and es1968 recently introduced?
like in alsa pcm device syncing code, which jackd uses to simultaneously start/stop capture and playback?
Best,
Karsten
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Re: jack crackles using ice1712 or es1968 recently intoduced? was: usx2y jack driver
On Sun, Sep 26, 2004 at 05:24:53PM +0200, Karsten Wiese wrote:
<alsa and jack readers may skip the first lines>
Quoted 1 line
I mean the data calculated at aeolus startup or on retune.
The actual wavetables. These depend on four things:
1. stop definitions
2. tuning
3. temperament
4. sample frequency
So there are a lot of possible combinations. Most users will use the same one most of the time, so it would make sense to cache the wavetables somehow. It's one of the things I may implement some rainy day...
Quoted 2 lines
My setup looks alike, but aeolus still takes its minute to boot, which it shurely deserves ;-)
:-) A real organ takes some time to build up the air pressure :-) (agreed, less than a minute)
Quoted 4 lines
Are there some subtle changes in alsa/jack relating ice1712 and es1968 recently introduced?
like in alsa pcm device syncing code, which jackd uses to simultaneously start/stop capture and playback?
I strongly suspect there are, but it's difficult to point out what exactly has changed. I recently upgraded to SL9.1. This didn't work at all (for audio). After an on-line update of the kernel (now 2.6.5-7.104-default) and instaling a more recent JACK and qjackctl things are usable again. I will upgrade the kernel again when the dust settles down.
I think your suspicion of the syncing code is warranted. Also the snd-usb-audio remapping from 48 frames to 2^n is suspect, but that's of course one of the things usx2y is meant to solve (haven't tried it yet).
Besides the Terratec (ice1712) I also have an Edirol UA-5, and this actually worked better (with snd-usb-audio) before the upgrade than after.
Meanwhile I found out some more about the xruns reported in my previous message. The ones I have when Aeolus is calculating its wavetables with -p64 or -p128 are due to memory allocation in a non-RT thread (blocks of about one Mbyte at a time). Probably an -mm kernel would fix that. The cracks that remain afterwards are triggered by qjackctl updating its connection diplay every 10 seconds. No idea what's the mechanism here.
But all by all, the system I have now works quite well with -p256, and that's about all I need ATM.
Signature · 13 lines
Fons ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php