Edirol UA-25 24-bit recording

Hello

I’m new on this list. I’m working on a radio orienteering project for a
university course and we are using gnuradio for signal analysis.

I’m trying to get the Edirol UA-25 (USB sound card) to work with
gnuradio. My test program currently looks like this:

—snip—

UA-25 as audio source

src0 = audio.source (96000, “hw:1,0”);

laptop on-board sound card as destination

dst = audio.sink (44100, “hw:0,0”)

connect them

fg.connect ((src0, 0), (dst, 0))
—snap—

This works just fine when using 16-bit and a sampling rate of 44.1kHz on
the UA-25, but I will need 24 bits (with 96kHz). Those settings produce
the following error however (verbose output):

—snip—
PCM name: hw:1,0
Access types:
MMAP_INTERLEAVED YES
MMAP_NONINTERLEAVED NO
MMAP_COMPLEX NO
RW_INTERLEAVED YES
RW_NONINTERLEAVED NO
Formats:
S24_3LE YES
Number of channels
min channels: 2
max channels: 2
2 channels YES
Sample Rates:
min rate: 96000 (dir = 0)
max rate: 96000 (dir = 0)
8000 NO
16000 NO
22050 NO
32000 NO
44100 NO
48000 NO
96000 YES
192000 NO
audio_alsa_source[hw:1,0]: failed to find acceptable format
Traceback (most recent call last):
File “./ardf.py”, line 37, in ?
fg = build_graph ()
File “./ardf.py”, line 19, in build_graph
src0 = audio.source (96000, “hw:1,0”);
File “/usr/local/lib/python2.4/site-packages/gnuradio/audio_alsa.py”,
line 219, in source
return _audio_alsa.source(*args)
RuntimeError: audio_alsa_source
—snap—

I tried understanding what the problem was, but wasn’t able to figure it
out. audio_source_alsa seems to not be able to set the sample format
(S24_3LE?) and it seems that audio_source_alsa.cc specifies only S16 and
S32 as acceptable sample formats.
I’m guessing that audio_source_alsa supports 24-bit samples, so does
anybody have an idea what I’m doing wrong?

I should mention that I’m running the latest gnuradio development code
from subversion (updated last night) on Debian Sid.

Best regards,
Matt

On Mon, Feb 25, 2008 at 12:00:22PM +0000, Mathis Richter wrote:

src0 = audio.source (96000, “hw:1,0”);
—snip—
min channels: 2
48000 NO
RuntimeError: audio_alsa_source
—snap—

I tried understanding what the problem was, but wasn’t able to figure it
out. audio_source_alsa seems to not be able to set the sample format
(S24_3LE?) and it seems that audio_source_alsa.cc specifies only S16 and
S32 as acceptable sample formats.
I’m guessing that audio_source_alsa supports 24-bit samples, so does
anybody have an idea what I’m doing wrong?

The code doesn’t support S24_3LE because when we wrote it, we didn’t
have any cards that used that format, and it wasn’t obvious (to me)
exactly how the format was represented. It would be great if you
could sort this out and submit a patch with the fix.

http://gnuradio.org/trac/wiki/PatchSubmissionGuidelines

Let me know if you need more of a clue, and I’ll take a look at the
code.

Thanks,
Eric

On Tue, Feb 26, 2008 at 01:07:14AM +0000, Mathis Richter wrote:

into a different format, but no luck there either.

Let me know if you need more of a clue, and I’ll take a look at the
code.

Any help would be greatly appreciated! I will be working on this during
the next couple of days.

Thanks,
Matt

Hi Matt,

The code that needs to be modified is in
gr-audio-alsa/src/audio_alsa_sink.cc and audio_alsa_source.cc

If you look at either piece of code, you’ll see that there’s a
work_s16, work_s32, work_s16_1x2, work_s32_1x2. What you’d need to
provide is the corresponding work_s24 and work_s24_1x2. The *_1x2
versions are used to force mono data into stereo format to account for
cards that only handle two channels. I think if you look at the code,
you’ll find that it shouldn’t be too tricky… and you’ve got a sound
card which you can test it on!

Please give it a try!

Eric

On 2008-02-29 00:21, Mathis Richter wrote:

Alright, I sort of got it to work, I’m at least pretty sure about the
format of S24_3LE.

Okay, let me try this again. Maybe someone has an idea.

I’ve written code for audio-alsa-source that supports the S24_3LE
format. This is working perfectly at a sample rate of 44.1kHz, but it
seems to be too slow for 48 and 96kHz - I get loads of buffer overruns.

How do I make gnuradio read data from the buffer more frequently, so
that it keeps up with the amount of data that comes in?

Best regards,
Matt


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio