From: Mayank Batra <mayankbatra@yahoo.co.in>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] A2DP sink code finally
Date: Tue, 26 Apr 2005 13:23:16 +0100 (BST) [thread overview]
Message-ID: <20050426122316.47651.qmail@web8310.mail.in.yahoo.com> (raw)
In-Reply-To: <426C62D4.80009@xmission.com>
Brad,
> Thanks for the submission. I corrected some
> warnings, disabled unused
> functions, and added it to Makefile.am.
Great!
> We definitely need to do a lot of cleanup (eg now
> that a2play and a2snk
> have so much duplication), but first off we need to
> see why audio is
> being distorted...
Exactly. Once the audio part is ok then we can take
care of the duplication part.
Mayank
> Mayank Batra wrote:
> > Hi Brad,
> >
> > This is the code for the A2DP sink application.
> >
> > Compilation:
> >
> > gcc -o a2snk a2snk.c -lbluetooth
> >
> > Running the application:
> >
> > ./a2snk
> >
> > Right now the following bugs exist:
> >
> > 1) Poor sound quality.
> >
> > 2) Unclean disconnection.
> >
> > Help me improve the above areas.
> >
> > Please add this code to the CVS.
> >
> > Thanks and Regards,
> >
> > Mayank
> >
> >
>
________________________________________________________________________
> > Yahoo! India Matrimony: Find your life partner
> online
> > Go to: http://yahoo.shaadi.com/india-matrimony
> >
> >
> >
>
------------------------------------------------------------------------
> >
> > /*
> > * a2snk.c
> > * This program functions as an A2DP sink
> > * (Emulation of an A2DP headset)
> > * Mayank Batra <mayankbatra@yahoo.co.in>
> > * Abhinav Mathur <abhinavpmathur@yahoo.com>
> > *
> > * 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 <getopt.h>
> > #include <signal.h>
> > #include <string.h>
> > #include <sys/socket.h>
> > #include <sys/stat.h>
> > #include <sys/soundcard.h> //To play the sound on
> the sound card
> >
> > #include "sbc/sbc.h"
> >
> > #include <bluetooth/bluetooth.h>
> > #include <bluetooth/hci.h>
> > #include <bluetooth/hci_lib.h>
> > #include <bluetooth/l2cap.h>
> > #include <bluetooth/sdp.h>
> > #include <bluetooth/sdp_lib.h>
> >
> > #include <netinet/in.h>
> >
> > /* AVDTP structures */
> >
> > /* packet components */
> >
> > struct avdtp_header {
> > //uint8_t packet_type:2;
> > uint8_t message_type:2;
> > uint8_t packet_type:2;
> > uint8_t transaction_label:4;
> > uint8_t signal_id:6;
> > uint8_t rfa0:2;
> > } __attribute__ ((packed));
> >
> > struct acp_seid_info {
> > uint8_t rfa0:1;
> > uint8_t inuse0:1;
> > uint8_t acp_seid:6;
> > uint8_t rfa2:3;
> > uint8_t tsep:1;
> > uint8_t media_type:4;
> > } __attribute__ ((packed));
> >
> > struct sbc_codec_specific_elements {
> > // a2dp p. 20
> > uint8_t channel_mode:4;
> > uint8_t frequency:4;
> > uint8_t allocation_method:2;
> > uint8_t subbands:2;
> > uint8_t block_length:4;
> > uint8_t min_bitpool;
> > uint8_t max_bitpool;
> > } __attribute__ ((packed));
> >
> > #define MAX_ADDITIONAL_CODEC 0 //Right now only
> SBC is supported
> > #define MAX_ADDITIONAL_CODEC_OCTETS
> (MAX_ADDITIONAL_CODEC*sizeof(struct acp_seid_info))
> >
> > /* packets */
> >
> > struct sepd_req {
> > struct avdtp_header header;
> > } __attribute__ ((packed));
> >
> > struct sepd_resp {
> > struct avdtp_header header;
> > struct acp_seid_info infos[1 +
> MAX_ADDITIONAL_CODEC];
> > } __attribute__ ((packed));
> >
> > struct getcap_req {
> > struct avdtp_header header;
> > uint8_t rfa1:2;
> > uint8_t acp_seid:6;
> > } __attribute__ ((packed));
> >
> > struct getcap_resp {
> > struct avdtp_header header;
> >
> > uint8_t serv_cap;
> > uint8_t serv_cap_len;
> >
> > uint8_t cap_type;
> > uint8_t length;
> > uint8_t media_type;
> > uint8_t media_codec_type;
> >
> > struct sbc_codec_specific_elements sbc_elements;
> >
> > } __attribute__ ((packed));
> >
> > struct set_config {
> > struct avdtp_header header;
> >
> > uint8_t rfa0:2;
> > uint8_t acp_seid:6;
> > uint8_t rfa1:2;
> > uint8_t int_seid:6;
> >
> > uint8_t serv_cap;
> > uint8_t serv_cap_len;
> >
> > uint8_t cap_type;
> > uint8_t length;
> > uint8_t media_type;
> > uint8_t media_codec_type;
> >
> > struct sbc_codec_specific_elements sbc_elements;
> >
> > } __attribute__ ((packed));
>
=== message truncated ===
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2005-04-26 12:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-24 15:09 [Bluez-devel] A2DP sink code finally Mayank Batra
2005-04-25 3:24 ` Brad Midgley
2005-04-25 3:58 ` Brad Midgley
2005-04-25 6:08 ` Henryk Plötz
2005-04-25 14:40 ` Brad Midgley
2005-04-26 12:23 ` Mayank Batra [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-04-26 12:29 Mayank Batra
2005-04-26 12:34 Mayank Batra
2005-04-27 16:27 ` Brad Midgley
2005-05-01 15:16 ` Henryk Plötz
2005-05-03 13:23 ` Mayank Batra
2005-04-26 12:35 Mayank Batra
2005-04-26 13:10 ` Brad Midgley
2005-04-26 15:50 ` Marcel Holtmann
2005-04-27 19:08 ` Brad Midgley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050426122316.47651.qmail@web8310.mail.in.yahoo.com \
--to=mayankbatra@yahoo.co.in \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox