How to do USB audio
Pages: 1 ... 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 ... 52
jim lesurf (2082) 1438 posts |
Couldn’t resist having a quick delve before quitting. Noticed that one behaviour of the UCA202 seems to be that the first time you try to use it after installing the modules it returns rubbish. Have to unplug it and plug it in again. That may have muddled my initial tests. Maybe that was why it didn’t work and I blamed my program then proceeded to alter it. Also realised that the EnumerateRates listing is bigger than I thought because I’m currently only reading though the first set of ‘play’ results and I’ll have to see if the ‘record’ ones follow in the rest of the buffer. More tomorrow… Jim |
Dave Higton (1515) 3526 posts |
There is no way to pass the endpoint and alternate settings to openOut or OpenIn. I have no idea what you are doing. Have you tried reading the documentation? |
Colin (478) 2433 posts |
Raik. Thanks for that – it pointed me in the right direction. I finally got Angstrom linux working but couldn’t get the version you pointed to working. I think the main problem has been the SD cards I’ve been using I finally got a 2gb image of angstrom working by using the 2gb card out of my satnav. At the moment the test sine wave works where I configured sound – don’t know if it’s the right place :-) but I can’t get music to play in gnome player. My high res DAC is undetected too so it may not be useful even when I get it working :-( If those that are modifying the video system to auto detect the screen mode. RISC OS defaulted to 640 × 480 on my HD Ready TV – can’t change it easily so I’ve left it, first thoughts not very good. But it’s better than this linux which picks a screen mode which is 40mm to the left and 10mm too big at the top. I can’t figure out easily how to fix that either. But at least with RISC OS I’m not being asked to fill in text fields with the field names off screen :-(. |
Raik (463) 2061 posts |
Angström: It was a old link from my bookmarks ;-) dmesg (To look at your DAC is detected?) and alsamixer (To activate.) It works with the Pandora Angström. The Beagleboard one I never really use. If I find the time, I will compare. |
Ronald May (387) 407 posts |
A couple of things I noted from this site http://www.diyaudio.com/forums/digital-source/188902-xmos-based-asynchronous-usb-i2s-interface.html They seem to be getting a serial number from the device which would perhaps identify it from other gear that is plugged in. Jim, it sounds like the UA202 is a fully working option for people happy with 96K data rates? Thanks, Ron |
Raik (463) 2061 posts |
The Beagleboard and the Pandora Angström are not really comparable. The Pandora-Angström much better and more stable. |
jim lesurf (2082) 1438 posts |
The UCA202 is only 32k/44.1k/48k 16 bit for play, and only rates up to 48k 16 bit for record. And at present it may not work nicely at rates other than 44.1k due to the mysterious ‘crackles’ Their UMC202, etc, ranges do 96k/24 and are class 2. So seem much more promising. However I haven’t yet managed to get any response from Behringer wrt some questions I have about the range. Also they don’t use domestic phonos for inputs to ADC but a mix of XLR and TRS jacks. Fine for semi-pro home music recording ‘studios’ but no the norm for domestic hifi. Also their line levels are based on studio specs which can be an awkward match. So I’m trying to find out more or find a dealer who can help. Otherwise I guess I’ll end up buying one ‘blind’ and then play with it. WRT power drain. I’m always using the UCA202 via an external hub with its own mains power to ensure I’m not dragging current out of the ARMiniX. But as yet I have no comment to make on anything like mains ripple, etc, this may add to the audio. Look at that once the more basic problems are sorted! :-) Jim |
jim lesurf (2082) 1438 posts |
Yes. Have been. That doesn’t guarantee I always understand it though! Nor that reality always seems to have read the documentation, either. :-) I think the problem I had was that the UCA202 seems happy to crash and then refuse to communicate if, say, I have it plugged in when I load Colin + your modules. So I was finding it would not play and thinking my program was wrong. That then lead me to try various changes until it started working. But I need to spend some more time on this later today. Have something else to do this morning, but I’ll check this afternoon. Jim |
Colin (478) 2433 posts |
Thanks. That looks more up to date but how did you copy it to an SD card? I’ve been using win32DiskImager an my laptop. That worked for .img files. The image you pointed out is a .raw file. I changed that to a .img file and used win32DiskImager. Looking at the partitions on the disc the card now has 2 partitions as expected but the first one isn’t fat32 formatted. Do you know if I need to do something else? |
jim lesurf (2082) 1438 posts |
Colin, if you want some info on how to sort out ALSA on a Linux box then http://www.audiomisc.co.uk/Linux/ALSA/NoMoreSilence.html and http://www.audiomisc.co.uk/Linux/ALSA/ALSAforUsers.html may help. Note you can use the Jim |
Raik (463) 2061 posts |
Rename the raw-image to img shouldt work. |
Colin (478) 2433 posts |
USBit gave the same result as win32DiscImage 2 partitions first (small one) not FAT formatted. Do you know if the first one has to be FAT formatted I would have thought so. |
Raik (463) 2061 posts |
In WIN you can look in the RAW e.g. with 7zip (right mousebutton and open). Both Partitions are from Linux (ext?). The ready card is working. USBit has a small bug (sorry I forgot) the Statusbar is out but the card is not ready. Click at the USBit Window and the statusbar came back. Not sure if this works with the opensuse Image. Normally I use DD with Linux e.g. gunzip -c /Path/…/Image_Name.img.gz | sudo dd of=/dev/mmcblk0 or dd if=/drivename/…/Image_Name.raw of=/dev/mmcblk0 |
Colin (478) 2433 posts |
Hmmm… it shows that it has 2 linux partitions. The version of angstrom I can get to work has a FAT partition first. You must be booting from a linux partition which doesn’t seem to work here. |
Raik (463) 2061 posts |
Not sure. I can try but it is weekend :-( |
Colin (478) 2433 posts |
I found that page thanks. It looks like I’ll need to get the serial connection to work – such fun :-) |
jim lesurf (2082) 1438 posts |
Does USBAudio_EnumerateRates give output for both play and record when the same device does both of these? I’m currently either getting odd results because my ‘probe’ program is buggy (likely!) or because it does this in a way not explained. Example below. The UCA202 has many play and many record settings and rates. If I run my probe program at present it gives the following: USB Audio Probe 0.5 =================== Scans USB to find and report on the details of Audio devices Using USBAudio_EnumerateDevices to find out what is connected ------------------------------------------------------------- List of devices by ID = USB17,USB13,USB14 Device 1 => USB17 Device 2 => USB13 Device 3 => USB14 Devices counted = 3 Now examine each device in detail ================================= Device 1 details ------------------ ID [USB17] Maker = Burr-Brown from TI Device = USB Audio CODEC Number of resolutions available = 6 play using 16 bits per sample using 2 bytes per subframe play using 8 bits per sample using 1 bytes per subframe rec using 16 bits per sample using 2 bytes per subframe rec using 8 bits per sample using 1 bytes per subframe Rates buffer size used/needed = 336 play ch = 2 res = 16 bytes/ch = 2 lpcm number of rates = 3 rates are: 32000 44100 48000 samples/sec offsets 20 bytes = 5 ints Next 0 1 16 Next 2 1 0 Device 2 details ------------------ ID [USB13] Maker = Halide Design Device = SPDIF Bridge Number of resolutions available = 1 play using 24 bits per sample using 3 bytes per subframe Rates buffer size used/needed = 24 play ch = 2 res = 24 bytes/ch = 3 lpcm number of rates = 4 rates are: 44100 48000 88200 96000 samples/sec offsets 24 bytes = 6 ints [snipped the rest here] I get the results for the play rates but it doesn’t list the record settings. Which should include a whole series of rates like 8000, 24000, etc, as well as the usual suspects. I’d thought that these might follow on from the ‘play’ values but start with an The ‘next’ values show the 6 bytes after the nominal end of the ‘play’ results as integer values. You can see the zero where I guessed a 128 should appear. The above was with three devices connected, but I’ve snipped the above once the results for the second (play only) have been given. My guess now is that I’ll get ‘play’ results for 1ch and then for 8bit, etc, so there may me a series of such ‘play’ and ‘rec’ sections in whatever order the device maker decided. Does that sound right? If so the API should probably warn about this. The implication is that you have to keep parsing until you reach the end of the buffer size returned to catch any more sections. (Following on from that I guess that there may be sections for some devices which are neither ‘play’ or ‘record’ but something else if the maker dreams up something! :-) ] Jim |
jim lesurf (2082) 1438 posts |
Yes, if I loop the parsing it does list all the play and rec details OK. Afraid the API doc didn’t make this clear to me, but makes sense. FWIW I don’t have any devices that give a range of sample rates. All mine list specific sets of values. So I’ve not (yet) been able to examine that. Jim |
Ronald May (387) 407 posts |
Jim, I just noticed that !USBDescripters has the C source included, and the program appears to be broad in it’s capabilities. I’m only a part timer, so I would start at the main() (inside main.c) and trace the operation adding comments until I found out whats doing what, sometimes adding a printf() here and there acts like a TRACE, but this program is printing regularly anyway. One thing with the devices such as UCA202, as it uses an all in one chip, (combined USB interface and DAC) I’d expect identical usb functionality from anything that uses this chip wether it is Behringer, Muse or a DIY kit. (2) could be clearer, I’m assuming that it reports the state of controls, that can be set by using (1) or perhaps (1) is exclusively for setting rates, I dont know. HID isn’t needed for basic operation anyway. EDIT: one difference I can see with this chip is that it uses a technique to http://www.diyaudio.com/forums/digital-line-level/231138-asynchronous-usb-dac-clock-source.html |
Raik (463) 2061 posts |
@Colin |
jim lesurf (2082) 1438 posts |
Does Jim |
jim lesurf (2082) 1438 posts |
I have been looking at other programs to some extent. But my main aim in writing programs at present is to try and ensure I know how to use the swis, etc, so I can explain them in due course to others. I find that easiest by writing my own code and making my own idiotic mistakes. Helps me spot where things have been taken for granted. Slow, and can mean I’m a pest who keeps asking ‘daft’ questions. But I find it works best for me in the end. Jim |
Colin (478) 2433 posts |
Raik. It’s looking like a waste of time. I got Angstom Gnome working as you suggested and after it autologged in as root was presented with a black blank screen with a grey bar across the bottom with nothing on it. But that wasn’t going to stop me :-) my screen has the top and left missing :-) so I clicked around outside the top of the screen until I discovered a bar which eventually I was able to move to the left – yippee! I could see something. It’s surprising how many windows open at the top left. Can’t find an xterm yet but I run some program and it said xterm not available. I’m stuck with the offscreen display the monitor configuration gives me no display options. Also I can’t right click on the desktop without creating a new folder ie the first item on the menu is selected before I can do anything. I plough on. Jim. :-) Your online tutorials failed at the first hurdle with the words ‘type in’. The question was where and how do I get to where. On the linux version I tried yesterday I eventually found xterm and could run |
Raik (463) 2061 posts |
@Colin |
jim lesurf (2082) 1438 posts |
Sorry. Classic case of taking things for granted in that I didn’t think to explain about terminals. If you can find alsamixer then the ALSA system is nominally installed. To check: Open an xterm and type in BTW if you find the xterm window text too small, you can change things. e.g. by using I can’t tell if the Linux you’ve installed is worth your experimenting with as I have no idea how much it may have been hacked down or altered. But if you have alsamixer I’d expect aplay to be present. If it isn’t then I suggest you give up as it may be harder for you to make sense of the hardware using that Linux distro than using RO! A linux version that lacks aplay is probably hacked to the point of being crippled so far as audio is concerned. If you want to persist, remind me of the Linux distro name and where you got it. I’ll see if I can find out some more details. But TBH it seems like this will be a waste of time and will simply divert effort. Jim |
Pages: 1 ... 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 ... 52