How to do USB audio
Pages: 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ... 52
Dave Higton (1515) 3526 posts |
Another little progress report. I’m slowly going through adding support for Release 2 devices. The support may initially be a bit shaky, but if it works at all, we can progress from there. I know how to interrogate the clock source for its sample rate information. I can parse the information and copy it to where it’s needed inside the module. Next step will be to add code to set the sample rate for Release 2 devices, because it’s done entirely differently from Release 1. Compatibility clearly was low on the list of priorities of the people who worked on Release 2. I feel as if they went out of their way to make things different. |
jim lesurf (2082) 1438 posts |
IIRC MS were involved. That may explain it. :-) Jim |
Colin (478) 2433 posts |
Dave. I’ve got EHCI isochronous split transactions working – testing at the moment – which means you should be able to use a class 1 (read dirt cheap USB1) audio device via a USB2 hub on your beagle board – or any board which used EHCI. So if you want to try your devices on a beagleboard we need to find a way to get the new modules on there. |
Dave Higton (1515) 3526 posts |
Wow!!!!! I’d better look some more at that issue. I’ve had my head buried in trying to add Release 2 support to USBAudio. (You have email.) |
Dave Higton (1515) 3526 posts |
I’ve linked the audio directory on my web site http://davehigton.me.uk from the front page. It’s only a directory at the moment – there isn’t an HTML page. Also I’ve updated the proposed USBAudio API document. I realised that some of the functions needed more parameters, but they are already in the parameter block passed to and updated by the OpenOut/OpenIn calls, so I’ve made R1 point to the parameter block for most calls. It simplifies and makes things more consistent. Comments welcome. |
Dave Higton (1515) 3526 posts |
Bingo – it has just run on my BBxM without stiffing it! Now where’s the new stuff? |
Colin (478) 2433 posts |
USBmodule.zip I’ve got rid of the taskwindows so it should load without problems – I’ve included a readme file. Everything should work as before after loading the modules so if you can check the internet just to confirm etherUSB is ok. This should make isochronous USB available to all boards other than the raspberry pi. Note for USB1 devices you’ll need to plug them into a USB2 hub. If you are running an old scsisoftusb module you may get a ‘device not found’ when shutting down after running the modules. This is due to a bug in old scsisoftusb modules – now fixed in RO 5.20 Recording should also work |
Chris Gransden (337) 1207 posts |
If I run !UsbModule on a Pandaboard ES with the latest OMAP4 rom I get an abort from devicefs, *where Address &20010408 is at offset &00000B94 in module DeviceFS *showregs Register dump (stored at &2000B270) is: R0 = 80000000 R1 = 20182EED R2 = 80000000 R3 = 0000FEA1 R4 = 00010000 R5 = 20183490 R6 = 00000000 R7 = 00000000 R8 = 00000050 R9 = 00000006 R10 = 2000FD64 R11 = 00000004 R12 = 2000B474 R13 = FA2078C0 R14 = 80000113 R15 = 20010408 Mode SVC32 flags set: nzcvqjggggeAift PSR = 00000113 * Running USBReplaceModulesTest get things back to normal. |
Chris Gransden (337) 1207 posts |
The above was with alignment execptions turned on.!UsbModule works fine if I turn alignment exceptions off. |
Colin (478) 2433 posts |
These things are sent to try us. Apparently DeviceFS is compiled differently on Different machines. The offending code is
Presumably
is true for a Pandaboard ES as that’s what sets NoUnaligned. Isn’t Arminix a Pandaboard? That must be running with alignment exceptions off as DeviceFS works with that. If you are running the latest riscos you can comment out the rmkilling and rmloading of DeviceFS |
Colin (478) 2433 posts |
This version of USBModule.zip should now work on the pandaboard es. I’ve recompiled DeviceFS with NoUnaligned = true. It works on the iyonix too. |
Chris Gransden (337) 1207 posts |
That did the trick. !UsbModule now works ok on a Pandaboard ES and BeagleBoard Xm with alignment exceptions turned on. I’ve been testing two USB class 1 devices on the Pandaboard and Beagleboard. The other device is this. SDFS::HardDisc0.$.usb.Track1/wav 44100 2 2 16 USB7 1 1 2 2 16 1 1 Bad request (274) I’ve uploaded the output from !USBDescriptors here. This is just the output from the Pandaboard ES. |
Colin (478) 2433 posts |
Recording was never going to work out of the box. I’ll concentrate on playing for now. Everything looks fine up to where it failed – its finding the correct endpoint. It looks like it failed where the frequency is set. It would work with the old usbmodules up to this point – the isochronous stream hasn’t been opened yet. If you look in !IsocPlayer.USB line 52 in FNusb_open If you put a REM in front of
does it work now. Its likely that the frequency is wrong – it probably defaults to 48000 – but it should play. |
Chris Gransden (337) 1207 posts |
That got it working on both. Albeit playing at 48000 instead of 44100. Thanks. Mouse movement and clicking is sluggish on the Pandaboard while playing and extremely so on the Beagleboard. Also the sound crackles a bit on the Beagleboard. I normally run the Beagleboard with zero page protecion turned on. Double clicking on a WAV then gives the following abort, *where Address &2019153C is at offset &00004708 in module EHCIDriver *showregs Register dump (stored at &2000B8D0) is: R0 = 02020203 R1 = 2010E97C R2 = 00020203 R3 = 00000002 R4 = 00000000 R5 = 20196DD4 R6 = 2018B1D8 R7 = 000000B0 R8 = 20197814 R9 = 00000000 R10 = FA20021C R11 = FA207E38 R12 = 000000AF R13 = FA207DE8 R14 = 201914F4 R15 = 2019153C Mode SVC32 flags set: nzCvqjggggeAIft PSR = 20000193 * |
Dave Higton (1515) 3526 posts |
Congratulations again, Colin. I’ve had various audio devices plugged into my Iyonix via a hub and playing out audio. Similar for the BBxM, although I’ve only tried one device so far. I did have to comment out the line to load DADebug because that wanted to get it from the hard drive, which of course stiffed it. Once the line is commented out it loads OK. I can confirm the Ethernet still works, because the BBxM has just fetched my email :-) |
Colin (478) 2433 posts |
Chris you’re my hero! I’ve been looking for that bug for what seems like ages – I had thought it a reentrancy problem. I only got it intermittantly on softloading but it totally stiffed my machine so couldn’t figure out how to investigate it – and it was doing my back in getting up to switch the machine off :-). Fixing the cause of the abort – memory allocation failure – stopped it crashing I could then fix a number of other problems (memory allocation shouldn’t have failed in the first place). Would you like to try this version of USBModule.zip. Can you run it with zero page protection on to see if anything else turns up. Does it fix the mouse sluggishness? I don’t think it will do anything to set the frequency on your Behringer device – it should have worked. I’ve made the control commands just report the error and continue in !IsocPlayer. They just set and read the frequency from the device. The taskwindow should say if usb_control failed after double clicking on a wav file. |
Colin (478) 2433 posts |
It think the mouse sluggishness may be be due the hub you have. From the descriptors you posted it looks like the board has 2 USB ports and a USB ethernet port. You have a powered hard drive and powered hub plugged into the board. The hub has a wireless dongle for keyboard and mouse, webcam and behringer device plugged in. The trouble is that the powered hub only has a single transaction translator which means all usb1 devices plugged into it share a single usb1 bandwidth. The keyboard dongle counts as 3 usb1 devices as it includes a usb1 hub and they share bandwidth with the audio device. Isochronous gets priority over all other transfers so the others share what bandwidth is left. If you plug the audio device directly into the board and plug the hard drive into the hub it should work ok. The hub on the motherboard has a transaction translator for each port so the keyboard shouldn’t be affected by the audio device. |
Chris Gransden (337) 1207 posts |
It’s a USB DVI KVM. It looks to be the case. I’ve now plugged the keyboard and mouse into normal hub and the audio device directly. The mouse and keyboard no longer keep pausing while audio is playing.
I think it is now playing at the correct rate. Here’s the output from IsocPlayer, SDFS::HardDisc0.$.usb.Track1/wav 44100 2 2 16 USB7 1 1 2 2 16 1 1 usb_control: bmRType=0x22 bRequest=0x1 wValue=0x100 wIndex=0x2 wLength=0x3 buf=0x207F48 usb_control failed: Bad request usb_control: bmRType=0xA2 bRequest=0x81 wValue=0x100 wIndex=0x2 wLength=0x3 buf=0x207F48 Sample Frequency get: 12288000 USB7#nopad;noblock;size176400;samplerate44100;samplesize4;interface1;alternate1;endpoint2: Started Press escape to abort Escape (6) Escape
The new version has cured the abort with zero page protection. No other problems so far. Thanks. |
Dave Higton (1515) 3526 posts |
I also had trouble with a sluggish mouse – it would keep being ignored for about 1 second at a time, periodically. I put this down to having to read from a USB hard drive while also having to keep a USB isochronous buffer filled – but actually that doesn’t make sense; ~1 second is far too long to be explained by that mechanism. So I downloaded today’s version, installed the new modules on the BBxM, and tried with my iMic plugged directly into the BBxM; the keyboard, mouse and hard drive are plugged via a 7 port hub. I was rewarded by somewhat scratchy audio but no sign of sluggishness. (44100 Hz sample rate.) I tried playing a 48000 Hz file, and the sluggishness was back, although the sound quality was good. I copied the 48000 Hz file to RAM disc and played it from there. It’s still sluggish. So, please, everybody, try various sample rates and several playback sessions, and see if you get consistent results. If there are any other tests you’d like me to do, or if there’s any diagnostic information I can get for you, please let me know. |
Colin (478) 2433 posts |
Changing where you plug in USB2 devices, eg disc drives, will make little difference they are sharing USB2 bandwidth. As we are trying to use USB1 over USB2 its the location of the USB1 devices that matter. At present on my Iyonix I have everything plugged into a 7 port hub and can play from a USB2 memory stick to a USB1 audio device. Can you run USBDescriptors.zip with your devices plugged in on your beagleboard. |
Colin (478) 2433 posts |
Chris. Thats good news. You are now officially the 4th person to get usb audio working :-). Your device is interesting. It doesn’t let you set the frequency but does let you read it. The odd thing is that it reads 12mhz. It may be that it automatically sets the frequency depending on the amount of data it is sent per millisec. |
rob andrews (112) 200 posts |
Hi colin just connected up to USB record deck to panada ES to see it worked, it shows as usb10 burr-brown usb -audio codec all i need to do now is to try and connect the audio out into the mic in and find some software to capture the stream?? is their any out there?? |
Colin (478) 2433 posts |
You’ve confused me there Rob. You have a USB record deck and you don’t want to record a record from it is that right? Or is it that there is an audio out on the record deck that you want to record via the audio in of the pandaboard that instead of via USB. If you just want to try and record a wav file from it via usb I can probably knock up something if you run USBDescriptors.zip and post the results somewhere for me. May work – may not work. Be interesting to find out. |
rob andrews (112) 200 posts |
No i want to be able to copy my old LP’s over to the computer via USB if i can just wondering if i could use pro sound or studio sound?? and how i would capture the stream?? |
rob andrews (112) 200 posts |
Here is the link to the descriptor file https://dl.dropboxusercontent.com/u/33574509/recordplayer.txt |
Pages: 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 ... 52