* [Bluez-devel] SBC Decoder with /dev/dsp
@ 2005-05-01 12:43 Mayank Batra
2005-05-01 12:57 ` Marcel Holtmann
2005-05-01 15:21 ` Henryk Plötz
0 siblings, 2 replies; 16+ messages in thread
From: Mayank Batra @ 2005-05-01 12:43 UTC (permalink / raw)
To: BLUEZ DEVELOPERS LIST
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
Marcel,
This is the improved version for the sbcdec.c file
which you asked for.
It uses /dev/dsp to play the decoded samples.
The output is pretty well if we incorporate the proper
endian type.
I suggest that you keep it as a separate file incase
someone wants to use the AO Libraries.
Thanks and Regards,
Mayank.
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
[-- Attachment #2: 1799107703-sbcdec.c --]
[-- Type: application/octet-stream, Size: 4450 bytes --]
/*
*
* Bluetooth low-complexity, subband codec (SBC) decoder
*
* Copyright (C) 2004 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2005 Mayank Batra <mayankbatra@yahoo.co.in>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <sys/stat.h>
#include <sys/soundcard.h>
#include "sbc.h"
#define BUF_SIZE 4096
static void decode(char *filename)
{
unsigned char *stream;
struct stat st;
off_t filesize;
sbc_t sbc;
int fd, id, pos, streamlen, framelen;
int format=AFMT_S16_LE;
int audio_fd;
unsigned char audio_buffer[BUF_SIZE];
int count=0;
if (stat(filename, &st) < 0) {
fprintf(stderr, "Can't get size of file %s: %s\n",
filename, strerror(errno));
return;
}
filesize = st.st_size;
stream = malloc(st.st_size);
if (!stream) {
fprintf(stderr, "Can't allocate memory for %s: %s\n",
filename, strerror(errno));
return;
}
fd = open(filename, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "Can't open file %s: %s\n",
filename, strerror(errno));
goto free;
}
if (read(fd, stream, st.st_size) != st.st_size) {
fprintf(stderr, "Can't read content of %s: %s\n",
filename, strerror(errno));
close(fd);
goto free;
}
close(fd);
pos = 0;
streamlen = st.st_size;
sbc_init(&sbc, SBC_NULL);
framelen = sbc_decode(&sbc, stream, streamlen);
printf("%d Hz, %d channels\n", sbc.rate, sbc.channels);
/* Open the audio device */
if((audio_fd=open("/dev/dsp",O_WRONLY,0))==-1) {
printf("\nCan't open the audio device\n");
exit(1);
}
/* Set the Format to be used */
if(ioctl(audio_fd,SNDCTL_DSP_SETFMT,&format)==-1) {
perror("\nSNDCTL_DSP_SETFMT\n");
exit(1);
}
/* Set the number of channels */
if(ioctl(audio_fd,SNDCTL_DSP_CHANNELS,&sbc.channels)==-1) {
perror("\nSNDCTL_DSP_CHANNELS\n");
exit(1);
}
/* Set the speed */
if(ioctl(audio_fd,SNDCTL_DSP_SPEED,&sbc.rate)==-1) {
perror("\nSNDCTL_DSP_SPEED\n");
exit(1);
}
while (framelen > 0) {
/* Do not straight away write sbc.data to device,
instead, wait for a sufficient number of samples */
memcpy(audio_buffer+count, sbc.data, sbc.len);
count += sbc.len;
if(count == 4096) {
/* Now write to the device */
write(audio_fd, audio_buffer, BUF_SIZE);
count = 0;
}
pos += framelen;
framelen = sbc_decode(&sbc, stream + pos, streamlen - pos);
}
/* Decoding over, close the audio device */
if(close(audio_fd)<0) {
perror("\nUnable to close the audio device");
exit(1);
}
sbc_finish(&sbc);
free:
free(stream);
}
static void usage(void)
{
printf("SBC decoder utility ver %s\n", VERSION);
printf("Copyright (c) 2004 Marcel Holtmann\n\n");
printf("Copyright (c) 2005 Mayank Batra\n\n");
printf("Usage:\n"
"\tsbcdec [options] file(s)\n"
"\n");
printf("Options:\n"
"\t-h, --help Display help\n"
"\t-v, --verbose Verbose mode\n"
"\n");
}
static struct option main_options[] = {
{ "help", 0, 0, 'h' },
{ "verbose", 0, 0, 'v' },
{ 0, 0, 0, 0 }
};
int main(int argc, char *argv[])
{
int i, opt, verbose = 0;
while ((opt = getopt_long(argc, argv, "+hv", main_options, NULL)) != -1) {
switch(opt) {
case 'h':
usage();
exit(0);
case 'v':
verbose = 1;
break;
default:
exit(1);
}
}
argc -= optind;
argv += optind;
optind = 0;
if (argc < 1) {
usage();
exit(1);
}
for (i = 0; i < argc; i++)
decode(argv[i]);
return 0;
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-01 12:43 [Bluez-devel] SBC Decoder with /dev/dsp Mayank Batra
@ 2005-05-01 12:57 ` Marcel Holtmann
2005-05-01 16:40 ` Marcel Holtmann
2005-05-01 15:21 ` Henryk Plötz
1 sibling, 1 reply; 16+ messages in thread
From: Marcel Holtmann @ 2005-05-01 12:57 UTC (permalink / raw)
To: bluez-devel
Hi Mayank,
> This is the improved version for the sbcdec.c file
> which you asked for.
>
> It uses /dev/dsp to play the decoded samples.
>
> The output is pretty well if we incorporate the proper
> endian type.
>
> I suggest that you keep it as a separate file incase
> someone wants to use the AO Libraries.
I will move the version using AO to sbcdec_ao and use your version
instead. However first I must cleanup your coding style a litte bit.
And we should also change sbcdec to accept inputs from standard input
instead of files only.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-01 12:43 [Bluez-devel] SBC Decoder with /dev/dsp Mayank Batra
2005-05-01 12:57 ` Marcel Holtmann
@ 2005-05-01 15:21 ` Henryk Plötz
2005-05-03 13:20 ` Mayank Batra
1 sibling, 1 reply; 16+ messages in thread
From: Henryk Plötz @ 2005-05-01 15:21 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 592 bytes --]
Moin,
Am Sun, 1 May 2005 13:43:48 +0100 (BST) schrieb Mayank Batra:
> The output is pretty well if we incorporate the proper
> endian type.
Ahh, so it works for you now? (I was not able to test it yet ...)
I hadn't thought of endianess all the way long. I was using big endian
for the .au file input (don't remember why) in the encoder and then
mostly consequently everywhere from there on.
--
Henryk Plötz
Grüße aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-01 12:57 ` Marcel Holtmann
@ 2005-05-01 16:40 ` Marcel Holtmann
2005-05-02 6:43 ` Brad Midgley
0 siblings, 1 reply; 16+ messages in thread
From: Marcel Holtmann @ 2005-05-01 16:40 UTC (permalink / raw)
To: bluez-devel
Hi Mayank,
> > This is the improved version for the sbcdec.c file
> > which you asked for.
> >
> > It uses /dev/dsp to play the decoded samples.
> >
> > The output is pretty well if we incorporate the proper
> > endian type.
> >
> > I suggest that you keep it as a separate file incase
> > someone wants to use the AO Libraries.
>
> I will move the version using AO to sbcdec_ao and use your version
> instead. However first I must cleanup your coding style a litte bit.
I had to change a lot more and so I started over. Please take a look at
the end result in the CVS.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-01 16:40 ` Marcel Holtmann
@ 2005-05-02 6:43 ` Brad Midgley
2005-05-02 9:56 ` Marcel Holtmann
0 siblings, 1 reply; 16+ messages in thread
From: Brad Midgley @ 2005-05-02 6:43 UTC (permalink / raw)
To: bluez-devel
Marcel,
Thanks for also cleaning up the stuff I did to make libao optional.
Is a2snk working now then? Can I factor out the common stuff in
a2snk/a2play without messing up changes anyone is holding onto?
Any suggestions for the name of the new header file that a2snk/a2play
will include? avdtp.h seems like a poor choice...
Brad
Marcel Holtmann wrote:
> Hi Mayank,
>
>
>>>This is the improved version for the sbcdec.c file
>>>which you asked for.
>>>
>>>It uses /dev/dsp to play the decoded samples.
>>>
>>>The output is pretty well if we incorporate the proper
>>>endian type.
>>>
>>>I suggest that you keep it as a separate file incase
>>>someone wants to use the AO Libraries.
>>
>>I will move the version using AO to sbcdec_ao and use your version
>>instead. However first I must cleanup your coding style a litte bit.
>
>
> I had to change a lot more and so I started over. Please take a look at
> the end result in the CVS.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4 great events, 4
> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-02 6:43 ` Brad Midgley
@ 2005-05-02 9:56 ` Marcel Holtmann
2005-05-02 15:26 ` Brad Midgley
0 siblings, 1 reply; 16+ messages in thread
From: Marcel Holtmann @ 2005-05-02 9:56 UTC (permalink / raw)
To: bluez-devel
Hi Brad,
> Thanks for also cleaning up the stuff I did to make libao optional.
you are welcome.
> Is a2snk working now then? Can I factor out the common stuff in
> a2snk/a2play without messing up changes anyone is holding onto?
The sbcdec does not accept input from standard input at the moment and I
think we should implement the soundcard access over /dev/dsp directly
into a2snk. And for a2play we may wanna add support to read its input
from the soundcard.
And btw we should rename a2snk to a2recv.
> Any suggestions for the name of the new header file that a2snk/a2play
> will include? avdtp.h seems like a poor choice...
Simply name the common code a2dp.c and a2dp.h.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-02 9:56 ` Marcel Holtmann
@ 2005-05-02 15:26 ` Brad Midgley
2005-05-02 18:42 ` Marcel Holtmann
0 siblings, 1 reply; 16+ messages in thread
From: Brad Midgley @ 2005-05-02 15:26 UTC (permalink / raw)
To: bluez-devel
Guys,
FYI, I factored out a2dp.h and renamed a2snk to a2recv. I'm going to
wait to create an a2dp.c with common code since there isn't much currently.
Brad
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-02 15:26 ` Brad Midgley
@ 2005-05-02 18:42 ` Marcel Holtmann
2005-05-03 1:58 ` Brad Midgley
0 siblings, 1 reply; 16+ messages in thread
From: Marcel Holtmann @ 2005-05-02 18:42 UTC (permalink / raw)
To: bluez-devel
Hi Brad,
> FYI, I factored out a2dp.h and renamed a2snk to a2recv. I'm going to
> wait to create an a2dp.c with common code since there isn't much currently.
I think that we should move the complete AVDTP handling into a2dp.c and
make a2play and a2recv only contain the soundcard/file setup and the
main event loop.
This sounds a little sketchy, but the current problem with a2play is
that it is not fully event driven. It is more a sequential approach and
we should really change it.
First question is if we ever wanna allow a2play and a2recv to output SBC
files or should it always be a soundcard or a PCM file? If we skip that
SBC part, we can integrate the SBC processing directly into the a2dp.c
file and hide it. This will makes things a lot easier.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-02 18:42 ` Marcel Holtmann
@ 2005-05-03 1:58 ` Brad Midgley
2005-05-03 15:46 ` Marcel Holtmann
0 siblings, 1 reply; 16+ messages in thread
From: Brad Midgley @ 2005-05-03 1:58 UTC (permalink / raw)
To: bluez-devel
Marcel
> I think that we should move the complete AVDTP handling into a2dp.c and
> make a2play and a2recv only contain the soundcard/file setup and the
> main event loop.
agreed. The alsa-lib driver will be event-driven from the start, so I
will probably want to work on the alsa-lib driver next and once that's
done, I will have a better idea of how to implement the new model for
a2dp.c.
my headsets are "in the mail" so I'll be back on it soon. You had done
some avdtp alsa-lib work I think and if that's a good starting point, I
would like to work from that. If it's not fleshed out enough, I'll just
start from your rfcomm alsa-lib code.
> First question is if we ever wanna allow a2play and a2recv to output SBC
> files or should it always be a soundcard or a PCM file? If we skip that
> SBC part, we can integrate the SBC processing directly into the a2dp.c
> file and hide it. This will makes things a lot easier.
I don't think we will need the sbc streams. I don't think I'd use them
even for debugging. We will want a way to have the use of /dev/dsp be
optional (ie optionally read and write audio files) but that shouldn't
complicate things much.
Brad
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
@ 2005-05-03 13:03 Mayank Batra
0 siblings, 0 replies; 16+ messages in thread
From: Mayank Batra @ 2005-05-03 13:03 UTC (permalink / raw)
To: bluez-devel
Brad,
> Is a2snk working now then? Can I factor out the
> common stuff in
> a2snk/a2play without messing up changes anyone is
> holding onto?
Thanks for creating a2dp.h file
And yes, now it is final that a2snk (now a2recv) is
functioning.
I have tested it by using a2play as well as BlueSoleil
as the source. And it is working perfectly alright.
But the problem is again the sequential nature of
a2recv as Marcel pointed out.
But one thing:
a2recv functions in the following scenario:
1) I use a PCM file (.snd), encoded in little-endian
format.
2) I use a2play, which encodes it into sbc.
3) I decode the sbc stream with a2recv, open my
soundcard in little-endian format (My soundcard does
not support big-endian format). But for this I have to
patch the sbc.c to produce output in little endian
format.
After the above steps output is crystal clear.
And when I say clear, it means absolutely clear.
> Any suggestions for the name of the new header file
> that a2snk/a2play
> will include? avdtp.h seems like a poor choice...
a2dp.h is great.
Mayank
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
@ 2005-05-03 13:12 Mayank Batra
2005-05-03 15:36 ` Marcel Holtmann
0 siblings, 1 reply; 16+ messages in thread
From: Mayank Batra @ 2005-05-03 13:12 UTC (permalink / raw)
To: bluez-devel
Marcel,
> I had to change a lot more and so I started over.
> Please take a look at
> the end result in the CVS.
I saw the end result, it is ok, just i was missing my
name somewhere. :-)
Regards,
Mayank
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-01 15:21 ` Henryk Plötz
@ 2005-05-03 13:20 ` Mayank Batra
2005-05-03 17:32 ` Henryk Plötz
0 siblings, 1 reply; 16+ messages in thread
From: Mayank Batra @ 2005-05-03 13:20 UTC (permalink / raw)
To: bluez-devel
Henryk,
>
> > The output is pretty well if we incorporate the
> proper
> > endian type.
>
> Ahh, so it works for you now? (I was not able to
> test it yet ...)
It is working PERFECTLY alright. There is absolutely
no difference b/w .snd file and .sbc file qualities.
> I hadn't thought of endianess all the way long. I
> was using big endian
> for the .au file input (don't remember why) in the
> encoder and then
> mostly consequently everywhere from there on.
OK, now one question to u and Marcel,
If the source is sending me sbc file encoded from pcm
file that was in big endian format, and i have an
audio device that supports only little-endian format,
then don't u think that i need to patch the sbc.c file
when the data field is being filled ?????
Mayank
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-03 13:12 Mayank Batra
@ 2005-05-03 15:36 ` Marcel Holtmann
0 siblings, 0 replies; 16+ messages in thread
From: Marcel Holtmann @ 2005-05-03 15:36 UTC (permalink / raw)
To: bluez-devel
Hi Mayank,
> > I had to change a lot more and so I started over.
> > Please take a look at
> > the end result in the CVS.
>
> I saw the end result, it is ok, just i was missing my
> name somewhere. :-)
that is because I don't copied your file. Instead I changed all the
parts by hand and missed your changes for adding your name. Sorry for
that. Better send diffs next time.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-03 1:58 ` Brad Midgley
@ 2005-05-03 15:46 ` Marcel Holtmann
0 siblings, 0 replies; 16+ messages in thread
From: Marcel Holtmann @ 2005-05-03 15:46 UTC (permalink / raw)
To: bluez-devel
Hi Brad,
> > I think that we should move the complete AVDTP handling into a2dp.c and
> > make a2play and a2recv only contain the soundcard/file setup and the
> > main event loop.
>
> agreed. The alsa-lib driver will be event-driven from the start, so I
> will probably want to work on the alsa-lib driver next and once that's
> done, I will have a better idea of how to implement the new model for
> a2dp.c.
maybe I can come up with something. I will see how much free time I get
for working on A2DP.
> my headsets are "in the mail" so I'll be back on it soon. You had done
> some avdtp alsa-lib work I think and if that's a good starting point, I
> would like to work from that. If it's not fleshed out enough, I'll just
> start from your rfcomm alsa-lib code.
A big thing is to get the timing (delays) right and so far I haven't
managed to find a good timing source. The gettimeofday() and RTC is not
really working inside the ALSA plugin. And the ALSA guys are a little
bit silent at the moment :(
> > First question is if we ever wanna allow a2play and a2recv to output SBC
> > files or should it always be a soundcard or a PCM file? If we skip that
> > SBC part, we can integrate the SBC processing directly into the a2dp.c
> > file and hide it. This will makes things a lot easier.
>
> I don't think we will need the sbc streams. I don't think I'd use them
> even for debugging. We will want a way to have the use of /dev/dsp be
> optional (ie optionally read and write audio files) but that shouldn't
> complicate things much.
Fine with me, too.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
2005-05-03 13:20 ` Mayank Batra
@ 2005-05-03 17:32 ` Henryk Plötz
0 siblings, 0 replies; 16+ messages in thread
From: Henryk Plötz @ 2005-05-03 17:32 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]
Moin,
Am Tue, 3 May 2005 14:20:23 +0100 (BST) schrieb Mayank Batra:
> If the source is sending me sbc file encoded from pcm
> file that was in big endian format, and i have an
> audio device that supports only little-endian format,
> then don't u think that i need to patch the sbc.c file
> when the data field is being filled ?????
No. Inside the SBC stream the endianess is clearly defined (as much
endianess as is left) and as long as the encoder got it right on the
encoding side you will be fine. The endianess that comes out of the
decoder has mostly nothing to do with SBC but only with what the
programmer wants.
So yes, we'd either have to define the interface so that our
decoder/encoder only generates/accepts big or little endian data and it
is up to the application to convert as necessary, or that choice must be
made a runtime configurable parameter of the functions.
--
Henryk Plötz
Grüße aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Bluez-devel] SBC Decoder with /dev/dsp
@ 2005-05-08 13:17 Mayank Batra
0 siblings, 0 replies; 16+ messages in thread
From: Mayank Batra @ 2005-05-08 13:17 UTC (permalink / raw)
To: bluez-devel
Marcel,
> > > I had to change a lot more and so I started
> over.
> > > Please take a look at
> > > the end result in the CVS.
> >
> > I saw the end result, it is ok, just i was missing
> my
> > name somewhere. :-)
>
> that is because I don't copied your file. Instead I
> changed all the
> parts by hand and missed your changes for adding
> your name. Sorry for
> that. Better send diffs next time.
I'll do that in the future.
Is it possible to make the change now?
Sorry for bothering you, I know you are a busy man.
:-)
Mayank
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2005-05-08 13:17 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-01 12:43 [Bluez-devel] SBC Decoder with /dev/dsp Mayank Batra
2005-05-01 12:57 ` Marcel Holtmann
2005-05-01 16:40 ` Marcel Holtmann
2005-05-02 6:43 ` Brad Midgley
2005-05-02 9:56 ` Marcel Holtmann
2005-05-02 15:26 ` Brad Midgley
2005-05-02 18:42 ` Marcel Holtmann
2005-05-03 1:58 ` Brad Midgley
2005-05-03 15:46 ` Marcel Holtmann
2005-05-01 15:21 ` Henryk Plötz
2005-05-03 13:20 ` Mayank Batra
2005-05-03 17:32 ` Henryk Plötz
-- strict thread matches above, loose matches on Subject: below --
2005-05-03 13:03 Mayank Batra
2005-05-03 13:12 Mayank Batra
2005-05-03 15:36 ` Marcel Holtmann
2005-05-08 13:17 Mayank Batra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.