How to do USB audio
Pages: 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ... 52
Colin (478) 2433 posts |
If the external hub you plug your keyboard into is USB 2 then thats no problem the output from that is USB 2 if it is USB 1 then yes it ‘may’ have been a problem but putting the audio device on another hub on its own would bypass the problem. USBModule should cope with the situation anyway – but it’s early days :-). Your keyboard isn’t a problem. Is the socket on the back of the arminix a direct connection to the board? Can you get a decent size music file on a ram disc to see if you still get pauses? |
Dave Higton (1515) 3526 posts |
I’ve updated the USBAudio archive at http://davehigton.me.uk/Audio The USBAudio module is updated to code round the defective descriptors in Jim’s ARCAM DAC. I hope I’ve done it in a way that doesn’t break anything else. Reports from any and all testers would be welcome! |
Ronald May (387) 407 posts |
On my Iyonix 5.20 I get a request for a later USB driver, |
Dave Higton (1515) 3526 posts |
Yes, only a few messages back in this thread. |
Ronald May (387) 407 posts |
OK, tried this Turtle Beach Advantage (C-Media) on my Iyonix 5.20 and it is OK with both playing methods as long as the wav is 48000Hz. The RasPi 5.21 is a no go |
Colin (478) 2433 posts |
Your device is 48000hz only so IsocPlayer and Dave’s player will only play 48000 wav files. They don’t do any sample rate conversion and you can’t just feed the audio devices with the wrong sample rate data you have to do a sample rate conversion of the whole file. So the failure of Dave’s Program is a success for him as it correctly identified that your device won’t handle 44100 files The pi won’t work. That is the only device that doesn’t use the EHCIDriver that I am modifying at the moment. |
jim lesurf (2082) 1438 posts |
Colin: I’ve now tried playing wave files from ramdisc. Still get the pauses. Makes no difference I can notice. AIUI Yes, the sockets on the rear of the ARMiniX are actually on the PandaBoard. Whereas the ones on the front panel go via an ‘external’ (i.e. off-board) hub. The ones at the front seem far more reliable and flexible. FWIW my keyboard is a problem as it seems not to suit the rear sockets. :-/ But it seems like this isn’t a factor here. Although I do get the ‘added clicks’ when trying to use the rDAC from the rear sockets. Dave: Just tried your new player/module with the rDAC. Results interesting. It will play a 96k/24 bit file – with the pauses. But not play a files that are 16 bit. So I assume from that the rDAC is wanting 3byte samples? With my DAC Magic Plus (Class 2) your player won’t play anything. Whereas Colin’s !IsocPlayer plays fine any rate/depth I try, no pauses. In each case when it fails, your player gives “no matching parameter set at line 1580”. So again I guess this is because the DAC Magic Plus wants 4byte values. Jim |
Colin (478) 2433 posts |
Dave you are going to have to change that error to ‘Audio format not supported by your device’ or something like that :-) Jim you may as well try USBModule.zip it may fix the crackling from the back socket. |
Colin (478) 2433 posts |
Dave if you’d like to try the above set of modules on your beagleboard does it stop the sluggish mouse? If you’ve shut down for xmas it can wait until the new year. |
Dave Higton (1515) 3526 posts |
I think that’s a good idea!
Probably. In order to get it to work, you’d have to process some source material to a 32 bit stereo WAV file, but then edit the header to state 24 bit resolution while leaving the number of bytes per sample unchanged. These DACs are a damned nuisance. Shipping 32 bit samples around is one thing, but the ease of transmitting them is outweighed by the difficulty of bulking them out from their natural sample size to an artifical one. I may have to change the matching rules for the sampling parameters, although there’s an argument for leaving it to the player or recorder application. I’ve just added a SWI to the USBAudio module to enumerate the sample rates of a device, in a form that an audio application can easily understand. I need to test it a bit more, then I’ll put it up on my web site along with a test app that uses the information. Clearly I need to document it, but writing the HTML is likely to take longer than coding the SWI did. Anyway, as I’m sure you all know by now, I’ll keep you posted. |
Dave Higton (1515) 3526 posts |
I haven’t shut down, but I need to spend some time with other people over the next few days, so I may be delayed a bit. |
Rick Murray (539) 13840 posts |
Yeah, me too. A bloke known only as “the Doctor”, a cutie called Clara….. ;-) Merry Christmas (or other denominational celebration) everybody! |
Ronald May (387) 407 posts |
Recent developments has allowed libsndfile to compile and run. This has also allowed sndfile-resample to work. For example, *sndfile-resample -to 48000 dark.wav newdark.wav (dont forget the – in front of to). From a different place, I have compiled sr-convert. Both claim to use high quality techniques, but they take a long time on my Iyonix. |
jim lesurf (2082) 1438 posts |
Yes, interested. Can you say more about the sources and details? Also about the interpolation methods and what the “developments” were? Currently having a bit of an xmas break, but aim to pick things up again soon! :-) Jim |
Steffen Huber (91) 1953 posts |
For resampling, there is always the “Shibatch Sampling Rate Converter” aka ssrc. It was ported some time ago by Stefan Bellon, it is 32bit ready but probably not ARMv7. Source and binary can be downloaded from Stefan’s site: http://www.sbellon.de/archives/ssrc.zip |
Ronald May (387) 407 posts |
The ssrc source handbuilt makefile converted easily for !GCC so I have made a binary that should be OK on ARM7. Jim, regarding libsndfile, I found that the very latest changes in recent months available only by git are opening the files properly. Earlier versions were jumbling the wav header info or something. I suppose one could compare the resampling effort from sox(tried) or ffmpeg(untried) also. I have no facts to say for sure that they would be lesser than the specialised programs, I’m just expecting so. EDIT: I downloaded the original source for ssrc and it practically compiled straight out of the box. There is a high precision version included also. |
jim lesurf (2082) 1438 posts |
FWIW my reference point/method for rate conversions, etc, tends to be the way sox does this. Based on SRC which I think is also the ALSA default approach for high quality. Generally found this works very well. That said, I’m referring specifically to the Linux version of sox as I’ve not checked the RO port against it. Jim |
Ronald May (387) 407 posts |
These file in file out programs should have the same output in the RISC OS ports, one check would be to compare the output files. With archiving tools a reasonable check is just to compare the file sizes. |
Chris Evans (457) 1614 posts |
I can think of two reasons why the files may vary: Differences in accuracy and variations in rounding. But it’s worth trying I’d have thought. |
Ronald May (387) 407 posts |
‘I can think of two reasons why the files may vary: Differences in accuracy and variations in rounding.’ I’m not sure what you mean here. But the subject was wether !GCC output from another platform gcc output, using the same c source code, in one instant, and perhaps different if non floating point hardware is implemented. |
Chris Evans (457) 1614 posts |
I’m no C expert so you almost certainly correct. I was thinking that the algorithm used would be honed for speed to be just as accurate as to get the last significant digit and no more. Your “converted easily for !GCC” made me think it was using a different compiler. |
jim lesurf (2082) 1438 posts |
I’ve not had time to check any of the above as yet as I’m otherwise busy at present. However I do have progs already to let me compare different examples of output – e.g. by doing a sample by sample subtraction. So I can check when I get a chance. WRT dithering or noise shaping differences. This may depend on the ‘random’ functions used. I don’t know if these work identically for the different compilers on different platforms. I use GCC for Linux but the ‘ROOL’ compiler for RO, but not compared them on this. FWIW sox always applies simple triangular dither by default, and that’s what I tend to expect. So I’d expect no more than a ‘randomised’ difference in the last bit if all else is equal. However it will depend on all the other details of the algorithms use. Devil in the details. BTW I’ve not knowingly used libsndfile before, so I’ll ask two questions. 1) Any documentation for command line use? 2) Is this GPL or similar? If so, should not the sources, etc, also come with a compiled version? That would help me although I’ve had a quick look on the web at some of the stuff on it. Jim |
Ronald May (387) 407 posts |
One thing I noted is that it looks for the .wav extension otherwise it wont open it. git clone git://github.com/erikd/libsndfile.git I needed the git version of libsndfile for the cross-compiler to produce a working RISC OS binary but on Linux you can probably use more conventional program installing methods. Using apt-cache search libsamplerate Possibly sudo apt-get install samplerate-programs would install all of the dependencies in one hit. |
Ronald May (387) 407 posts |
Chris, Yes there is some confusion regarding the source code that Steffen supplied a link to. It had been modified for the Norcroft compiler and I simply changed the small makefile to use with !GCC. This source did not work, so I downloaded the sourceforge source for the same project, and apart from adding the -static flag and adding an #include for string.h |
Ronald May (387) 407 posts |
The libsndfile source has a test suite suitable for cross-compiling output, and with a little fixing I got the test suite on the Iyonix. I changed the linux shell script to an Obey file and have got it running the tests. |
Pages: 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ... 52