From: "Brad Midgley" <bmidgley@gmail.com>
To: "BlueZ development" <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] [PATCH] Alsa plugin fix
Date: Sun, 7 Oct 2007 18:22:26 -0600 [thread overview]
Message-ID: <d89ddf300710071722k2ac2074dqe0dfc16ac960f982@mail.gmail.com> (raw)
In-Reply-To: <47092B7D.5000404@free.fr>
Fabien,
I noticed the same problem with xmms, but it works great now. I
committed your fix.
thanks
Brad
On 10/7/07, Fabien Chevalier <fabchevalier@free.fr> wrote:
> All,
>
> I've spent most of my afternoon fixing the support for my favorite media
> player, the descendant of XMMS : audacious. :-)
>
> Audacious was almost working except for a *very* annoying bug (in our
> side :-( ). It would
> eventually stop playing at the end of each song, which meant i would
> have to manually select the next song and hit play again... not very
> funny :-(
>
> Now it looks it works perfectly (didn't have time to check that in
> details, but that should be fixed as soon i tomorrow, after i would
> have spent the most part of the day listening to music with Audacious ;-)=
)
>
> The patch is fairly simple, it implements the delay() call to make sure
> we change the pcm state to the XRUN state whenever the hw_ptr moves
> on top of appl_ptr.
>
> Anybody to review it and commit to CVS ?
>
> Cheers,
>
> Fabien
>
> Index: pcm_bluetooth.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- pcm_bluetooth.c (r=E9vision 74)
> +++ pcm_bluetooth.c (copie de travail)
> @@ -764,6 +764,25 @@
> return ret;
> }
>
> +static int bluetooth_playback_delay(snd_pcm_ioplug_t *io,
> + snd_pcm_sframes_t *delayp)
> +{
> + DBG("");
> +
> + /* This updates io->hw_ptr value using pointer() function */
> + snd_pcm_hwsync(io->pcm);
> +
> + *delayp =3D io->appl_ptr - io->hw_ptr;
> + if ((io->state =3D=3D SND_PCM_STATE_RUNNING) && (*delayp < 0)) {
> + io->callback->stop(io);
> + io->state =3D SND_PCM_STATE_XRUN;
> + *delayp =3D 0;
> + }
> + /* This should never fail, ALSA API is really not
> + prepared to handle a non zero return value */
> + return 0;
> +}
> +
> static snd_pcm_ioplug_callback_t bluetooth_hsp_playback =3D {
> .start =3D bluetooth_playback_start,
> .stop =3D bluetooth_playback_stop,
> @@ -774,6 +793,7 @@
> .transfer =3D bluetooth_hsp_write,
> .poll_descriptors =3D bluetooth_playback_poll_descriptors,
> .poll_revents =3D bluetooth_playback_poll_revents,
> + .delay =3D bluetooth_playback_delay,
> };
>
> static snd_pcm_ioplug_callback_t bluetooth_hsp_capture =3D {
> @@ -798,6 +818,7 @@
> .transfer =3D bluetooth_a2dp_write,
> .poll_descriptors =3D bluetooth_playback_poll_descriptors,
> .poll_revents =3D bluetooth_playback_poll_revents,
> + .delay =3D bluetooth_playback_delay,
> };
>
> static snd_pcm_ioplug_callback_t bluetooth_a2dp_capture =3D {
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2007-10-08 0:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-07 18:54 [PATCH] Alsa plugin fix Fabien Chevalier
2007-10-08 0:22 ` Brad Midgley [this message]
2007-10-08 8:01 ` [Bluez-devel] " Fabien Chevalier
2007-10-08 13:40 ` Luiz Augusto von Dentz
2007-10-08 14:09 ` Fabien Chevalier
2007-10-08 16:53 ` Marcel Holtmann
2007-10-08 19:14 ` [Bluez-devel] Socket concurrency / first tests Olivier Le Pogam
2007-10-09 8:04 ` [Bluez-devel] [PATCH] Alsa plugin fix Fabien Chevalier
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=d89ddf300710071722k2ac2074dqe0dfc16ac960f982@mail.gmail.com \
--to=bmidgley@gmail.com \
--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