SND_PCM_FORMAT_S24_LE with jack

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

SND_PCM_FORMAT_S24_LE with jack

Thorsten Edelhäußer
Hi!

I'm writing an alsa-driver for the Marian MARC8 soundcard. The problem
is, that this card only support the SND_PCM_FORMAT_S24_LE instead of
SND_PCM_FORMAT_S24_3LE which is used by jack. So my question is, why
jack don't support this format? Could it be implemented as well?

Greetings,
Thorsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SND_PCM_FORMAT_S24_LE with jack

Clemens Ladisch-2
Thorsten Edelhäußer wrote:
> I'm writing an alsa-driver for the Marian MARC8 soundcard. The problem
> is, that this card only support the SND_PCM_FORMAT_S24_LE

Are you sure that this card uses S24 (24 bits stored in the three least
significant bytes of a 32-bit word) and not S32 (24 bits stored in the
three most significant bytes of a 32-bit word)?

> instead of SND_PCM_FORMAT_S24_3LE which is used by jack. So my
> question is, why jack don't support this format?

Because so far there has been no sound card that actually supports
S24_LE.


Regards,
Clemens

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: SND_PCM_FORMAT_S24_LE with jack

Thorsten Edelhäußer
Am Donnerstag, den 13.03.2008, 11:50 +0100 schrieb Clemens Ladisch:
> Thorsten Edelhäußer wrote:
> > I'm writing an alsa-driver for the Marian MARC8 soundcard. The problem
> > is, that this card only support the SND_PCM_FORMAT_S24_LE
>
> Are you sure that this card uses S24 (24 bits stored in the three least
> significant bytes of a 32-bit word) and not S32 (24 bits stored in the
> three most significant bytes of a 32-bit word)?

I'm sure. The documentation says: "Only the Bits 0...23 of any 32 Bit
mono sample can be used for the audio data. (highest bit = D23)" The
card has its own samplebuffer and the memory is only 24 bit wide but 32
bit aligned.

>
> > instead of SND_PCM_FORMAT_S24_3LE which is used by jack. So my
> > question is, why jack don't support this format?
>
> Because so far there has been no sound card that actually supports
> S24_LE.

Regards,
Thorsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SND_PCM_FORMAT_S24_LE with jack

Paul Davis

On Thu, 2008-03-13 at 12:12 +0100, Thorsten Edelhäußer wrote:

> Am Donnerstag, den 13.03.2008, 11:50 +0100 schrieb Clemens Ladisch:
> > Thorsten Edelhäußer wrote:
> > > I'm writing an alsa-driver for the Marian MARC8 soundcard. The problem
> > > is, that this card only support the SND_PCM_FORMAT_S24_LE
> >
> > Are you sure that this card uses S24 (24 bits stored in the three least
> > significant bytes of a 32-bit word) and not S32 (24 bits stored in the
> > three most significant bytes of a 32-bit word)?
>
> I'm sure. The documentation says: "Only the Bits 0...23 of any 32 Bit
> mono sample can be used for the audio data.

this is the same for the RME hammerfall and hdsp series cards, but they
deliver 32 bits per sample. that line is actually suggesting the
opposite of what you claim.

> (highest bit = D23)" The
> card has its own samplebuffer and the memory is only 24 bit wide but 32
> bit aligned.

once again "24 bit wide but 32 bit aligned" suggests precisely the same
layout as on other cards: 32 bits per sample but only 24 bits contain
actual data.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: SND_PCM_FORMAT_S24_LE with jack

Clemens Ladisch-2
Paul Davis wrote:
> On Thu, 2008-03-13 at 12:12 +0100, Thorsten Edelhäußer wrote:
> > (highest bit = D23)" The
> > card has its own samplebuffer and the memory is only 24 bit wide but 32
> > bit aligned.
>
> once again "24 bit wide but 32 bit aligned" suggests precisely the same
> layout as on other cards: 32 bits per sample but only 24 bits contain
> actual data.

The question is how these 24 bits are aligned inside the 32-bit word.

Thorsten, how does a captures sample look like in memory?


Regards,
Clemens

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: SND_PCM_FORMAT_S24_LE with jack

Thorsten Edelhäußer
am Donnerstag, den 13.03.2008, 12:52 +0100 schrieb Clemens Ladisch:

> Paul Davis wrote:
> > On Thu, 2008-03-13 at 12:12 +0100, Thorsten Edelhäußer wrote:
> > > (highest bit = D23)" The
> > > card has its own samplebuffer and the memory is only 24 bit wide but 32
> > > bit aligned.
> >
> > once again "24 bit wide but 32 bit aligned" suggests precisely the same
> > layout as on other cards: 32 bits per sample but only 24 bits contain
> > actual data.
>
> The question is how these 24 bits are aligned inside the 32-bit word.
>
> Thorsten, how does a captures sample look like in memory?
If I read out 32 bit samples, the values will be like the following (On
a intel machine):
0x00fda300 0x002e79bd 0x0000e6a41

So I believe the highest byte which would contain the sign-bit in 32 bit
samples is not available here. So the sample would have to be shifted by
8 up (sample << 8) to correct this.

Regards,
Thorsten


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SND_PCM_FORMAT_S24_LE with jack

Clemens Ladisch-2
Thorsten Edelhäußer wrote:
> If I read out 32 bit samples, the values will be like the following (On
> a intel machine):
> 0x00fda300 0x002e79bd 0x0000e6a41

This is indeed S24_LE.

Adding support for this should be easy (add functions to memops.c
without all the ">> 8" and "<< 8").


BTW: Is there a reason why the 32-bit-samples functions in memops.c use
SAMPLE_MAX_24BIT and then shift by 8 bits, e.g.:

        y = (long long)(*src * SAMPLE_MAX_24BIT) << 8;

It would be simpler and faster to do

        y = (long long)(*src * SAMPLE_MAX_32BIT);


Regards,
Clemens

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel