All of lore.kernel.org
 help / color / mirror / Atom feed
* ALSA lib troubles with xine
@ 2007-09-03  6:53 Markus Korber
  2007-09-03  8:12 ` Clemens Ladisch
  2007-09-03  8:12 ` Markus Korber
  0 siblings, 2 replies; 11+ messages in thread
From: Markus Korber @ 2007-09-03  6:53 UTC (permalink / raw)
  To: alsa-devel

Hi,

I've got problems using ALSA (hg) and xine-lib (1.1.7).  I'm trying to
use fbxine for playback but ALSA debug logging gives me:

,----
| audio_alsa_out: Audio Device name = default
| audio_alsa_out: Number of channels = 2
| Buffer size range from 4096 to 0            <- !!!
| Period size range from 0 to 0               <- !!!
| Buffer time size 44100
| To choose buffer_size = 4096
| To choose period_size = 512
| was set period_size = 0
| was set buffer_size = 4096
| audio_alsa_out:open pause_resume=1
| ACCESS:  RW_INTERLEAVED
| FORMAT:  S16_LE
| SUBFORMAT:  STD
| SAMPLE_BITS: 16
| FRAME_BITS: 32
| CHANNELS: 2
| RATE: 44100
| PERIOD_TIME: (46439 46440)
| PERIOD_SIZE: 2048
| PERIOD_BYTES: 8192
| PERIODS: 2
| BUFFER_TIME: (92879 92880)
| BUFFER_SIZE: 4096
| BUFFER_BYTES: 16384
| TICK_TIME: 10000
| audio_alsa_out: Unable to set swparams: Invalid argument
`----

So buffer and period sizes seem to be wrong and therefore I get no
sound.  (audio_alsa_out logging from [1].)  Next I've tried to run
speaker-test and the ouptut look good:

,----
| [root@(none) ~]# speaker-test 
| 
| speaker-test 1.0.15rc1
| 
| Playback device is default
| Stream parameters are 48000Hz, S16_LE, 1 channels
| Using 16 octaves of pink noise
| Rate set to 48000Hz (requested 48000Hz)
| Buffer size range from 4096 to 4096
| Period size range from 2048 to 2048
| Using max buffer size 4096
| Periods = 4
| was set period_size = 2048
| was set buffer_size = 4096
|  0 - Front Left
`----

Both applications are linked against the same ALSA library (dynamic or
static linkage doesn't make a difference - speaker-test always works and
xine always fails).  And both applications use the same instructions
(snd_pcm_hw_params_get_period_size_min/max()) AFAICS.

Any ideas what I could try next?  Thanks.

Toolchain: buildroot based arm gcc 4.2.1 with uclibc 0.9.29.  However,
other applications (mplayer, aplay, alsaplayer) work as well, so I guess
it's not toolchain related.

[1] http://xine.cvs.sourceforge.net/xine/xine-lib/src/audio_out/audio_alsa_out.c

Regards,
Markus Korber

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  6:53 ALSA lib troubles with xine Markus Korber
@ 2007-09-03  8:12 ` Clemens Ladisch
  2007-09-03  9:07   ` Markus Korber
  2007-09-03  8:12 ` Markus Korber
  1 sibling, 1 reply; 11+ messages in thread
From: Clemens Ladisch @ 2007-09-03  8:12 UTC (permalink / raw)
  To: Markus Korber, alsa-devel

Markus Korber wrote:
> I've got problems using ALSA (hg) and xine-lib (1.1.7).  I'm trying to
> use fbxine for playback but ALSA debug logging gives me:
> 
> | Period size range from 0 to 0               <- !!!
> | To choose period_size = 512
> | was set period_size = 0
> | PERIOD_SIZE: 2048

A period size was set, but xine's code that tries to read the period
size apparently doesn't work.

Please check the return values of the *_get_period_size* calls.

> Toolchain: buildroot based arm gcc 4.2.1 with uclibc 0.9.29.

Is it possible that xine-lib and alsa-lib were compiled with different
compiler options, resulting in a different size of snd_pcm_uframes_t?


Regards,
Clemens

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  6:53 ALSA lib troubles with xine Markus Korber
  2007-09-03  8:12 ` Clemens Ladisch
@ 2007-09-03  8:12 ` Markus Korber
  2007-09-03  8:19   ` Clemens Ladisch
  2007-09-03  8:24   ` Jaroslav Kysela
  1 sibling, 2 replies; 11+ messages in thread
From: Markus Korber @ 2007-09-03  8:12 UTC (permalink / raw)
  To: alsa-devel

Thus spake Markus Korber:

> I've got problems using ALSA (hg) and xine-lib (1.1.7).  I'm trying to
> use fbxine for playback but ALSA debug logging gives me:
> [...]
> So buffer and period sizes seem to be wrong and therefore I get no
> sound.  (audio_alsa_out logging from [1].)  Next I've tried to run
> speaker-test and the ouptut look good:

Sorry for the wrong information (Must have taken an older version of
libasound).  I've recompiled alsa-lib 1.0.15rc1 and alsa-utils 1.0.15rc1
and now speaker-test also fails:

,----
| [root@(none) ~]# speaker-test 
| 
| speaker-test 1.0.15rc1
| 
| Playback device is default
| Stream parameters are 48000Hz, S16_LE, 1 channels
| Using 16 octaves of pink noise
| Rate set to 48000Hz (requested 48000Hz)
| Buffer size range from 4096 to 1073748296
| Period size range from 0 to 0
| Using max buffer size 1073748296
| Periods = 4
| was set period_size = 0
| was set buffer_size = 4096
| Unable to set sw params for playback: Invalid argument
| Setting of swparams failed: Invalid argument
`----

Next I'll try to compile alsa-lib with '-O1' instead of '-Os' and then
I'll revert back to 1.0.14a and give that version a try.

lg,
Markus Korber

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  8:12 ` Markus Korber
@ 2007-09-03  8:19   ` Clemens Ladisch
  2007-09-03  8:24   ` Jaroslav Kysela
  1 sibling, 0 replies; 11+ messages in thread
From: Clemens Ladisch @ 2007-09-03  8:19 UTC (permalink / raw)
  To: Markus Korber, alsa-devel

Markus Korber wrote:
> | Buffer size range from 4096 to 1073748296

The second value is completely wrong.

Apparently, the kernel and the alsa-lib have been compiled with
different sizes for the "long" data type.


HTH
Clemens

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  8:12 ` Markus Korber
  2007-09-03  8:19   ` Clemens Ladisch
@ 2007-09-03  8:24   ` Jaroslav Kysela
  2007-09-03  9:24     ` Markus Korber
  1 sibling, 1 reply; 11+ messages in thread
From: Jaroslav Kysela @ 2007-09-03  8:24 UTC (permalink / raw)
  To: Markus Korber; +Cc: alsa-devel

On Mon, 3 Sep 2007, Markus Korber wrote:

> Thus spake Markus Korber:
> 
> > I've got problems using ALSA (hg) and xine-lib (1.1.7).  I'm trying to
> > use fbxine for playback but ALSA debug logging gives me:
> > [...]
> > So buffer and period sizes seem to be wrong and therefore I get no
> > sound.  (audio_alsa_out logging from [1].)  Next I've tried to run
> > speaker-test and the ouptut look good:
> 
> Sorry for the wrong information (Must have taken an older version of
> libasound).  I've recompiled alsa-lib 1.0.15rc1 and alsa-utils 1.0.15rc1
> and now speaker-test also fails:

Try compile alsa-lib with '--with-versioned=no' and recompile 
(relink) speaker-test and other apps against this library.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  8:12 ` Clemens Ladisch
@ 2007-09-03  9:07   ` Markus Korber
  0 siblings, 0 replies; 11+ messages in thread
From: Markus Korber @ 2007-09-03  9:07 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Thus spake Clemens Ladisch:

> Markus Korber wrote:
>> I've got problems using ALSA (hg) and xine-lib (1.1.7).  I'm trying to
>> use fbxine for playback but ALSA debug logging gives me:
>
>> | Period size range from 0 to 0               <- !!!
>> | To choose period_size = 512
>> | was set period_size = 0
>> | PERIOD_SIZE: 2048
>
> A period size was set, but xine's code that tries to read the period
> size apparently doesn't work.
>
> Please check the return values of the *_get_period_size* calls.

All calls succeeded.

Regards,
Markus Korber

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  8:24   ` Jaroslav Kysela
@ 2007-09-03  9:24     ` Markus Korber
  2007-09-03 13:04       ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Korber @ 2007-09-03  9:24 UTC (permalink / raw)
  To: Jaroslav Kysela, Clemens Ladisch; +Cc: alsa-devel

Thus spake Jaroslav Kysela:

> On Mon, 3 Sep 2007, Markus Korber wrote:
>
>> Thus spake Markus Korber:
>
>>> I've got problems using ALSA (hg) and xine-lib (1.1.7).  I'm trying to
>>> use fbxine for playback but ALSA debug logging gives me:
>>> [...]
>>> So buffer and period sizes seem to be wrong and therefore I get no
>>> sound.  (audio_alsa_out logging from [1].)  Next I've tried to run
>>> speaker-test and the ouptut look good:
>
>> Sorry for the wrong information (Must have taken an older version of
>> libasound).  I've recompiled alsa-lib 1.0.15rc1 and alsa-utils 1.0.15rc1
>> and now speaker-test also fails:
>
> Try compile alsa-lib with '--with-versioned=no' and recompile
> (relink) speaker-test and other apps against this library.

Ok, speaker-test works again:

,----
| [root@(none) ~]# speaker-test 
| 
| speaker-test 1.0.15rc1
| 
| Playback device is default
| Stream parameters are 48000Hz, S16_LE, 1 channels
| Using 16 octaves of pink noise
| Rate set to 48000Hz (requested 48000Hz)
| Buffer size range from 4096 to 4096
| Period size range from 2048 to 2048
| Using max buffer size 4096
| Periods = 4
| was set period_size = 2048
| was set buffer_size = 4096
|  0 - Front Left
`----

And also fbxine now (kind of) works:

,----
| audio_alsa_out: Audio Device name = default
| audio_alsa_out: Number of channels = 2
| Buffer size range from 4096 to 4096
| Period size range from 2048 to 2048
| Buffer time size 44100
| To choose buffer_size = 4096
| To choose period_size = 512
| was set period_size = 2048
| was set buffer_size = 4096
| ACCESS:  RW_INTERLEAVED
| FORMAT:  S16_LE
| SUBFORMAT:  STD
| SAMPLE_BITS: 16
| FRAME_BITS: 32
| CHANNELS: 2
| RATE: 44100
| PERIOD_TIME: (46439 46440)
| PERIOD_SIZE: 2048
| PERIOD_BYTES: 8192
| PERIODS: 2
| BUFFER_TIME: (92879 92880)
| BUFFER_SIZE: 4096
| BUFFER_BYTES: 16384
| TICK_TIME: 10000
|   stream       : PLAYBACK
|   access       : RW_INTERLEAVED
|   format       : S16_LE
|   subformat    : STD
|   channels     : 2
|   rate         : 44100
|   exact rate   : 44100 (44100/1)
|   msbits       : 16
|   buffer_size  : 4096
|   period_size  : 2048
|   period_time  : 46439
|   tick_time    : 10000
|   tstamp_mode  : NONE
|   period_step  : 1
|   sleep_min    : 0
|   avail_min    : 2048
|   xfer_align   : 1
|   start_threshold  : 2048
|   stop_threshold   : 4096
|   silence_threshold: 0
|   silence_size : 0
|   boundary     : 1073741824
| start_mode: DATA
| xrun_mode: STOP
| tstamp_mode: NONE
| period_step: 1
| sleep_min: 0
| avail_min: 2048
| xfer_align: 1
| silence_threshold: 0
| silence_size: 0
| boundary: 1073741824
| output sample rate 44100
| xine_play
`----

However, the sound is stuttering a lot (I guess this is a xine-lib
issue).

Nevertheless thanks Jaroslav and Clemens for your help!

Regards,
Markus Korber

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03  9:24     ` Markus Korber
@ 2007-09-03 13:04       ` Takashi Iwai
  2007-09-03 14:52         ` Markus Korber
  0 siblings, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2007-09-03 13:04 UTC (permalink / raw)
  To: Markus Korber; +Cc: alsa-devel, Jaroslav Kysela

At Mon, 03 Sep 2007 11:24:02 +0200,
Markus Korber wrote:
> 
> However, the sound is stuttering a lot (I guess this is a xine-lib
> issue).

Can you install older versions of ALSA-lib *manually* and check in
which version the bug doesn't appear?  Then we can pin-point the
change.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03 13:04       ` Takashi Iwai
@ 2007-09-03 14:52         ` Markus Korber
  2007-09-03 14:57           ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Markus Korber @ 2007-09-03 14:52 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Jaroslav Kysela

Thus spake Takashi Iwai:

> At Mon, 03 Sep 2007 11:24:02 +0200,
> Markus Korber wrote:
>
>> However, the sound is stuttering a lot (I guess this is a xine-lib
>> issue).
>
> Can you install older versions of ALSA-lib *manually* and check in
> which version the bug doesn't appear?  Then we can pin-point the
> change.

Ok, so I compiled alsa-lib, installed libasound.so, and recompiled the
xine alsa output module against the appropriate alsa-lib:

1.0.13    : failed
1.0.14a   : failed
1.0.15rc1 : failed

Any ideas?  

Perhaps xine-lib doesn't work well if buffer_size = 2*period_size?

Regards,
Markus Korber

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03 14:52         ` Markus Korber
@ 2007-09-03 14:57           ` Takashi Iwai
  2007-09-03 15:38             ` Markus Korber
  0 siblings, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2007-09-03 14:57 UTC (permalink / raw)
  To: Markus Korber; +Cc: alsa-devel, Jaroslav Kysela

At Mon, 03 Sep 2007 16:52:03 +0200,
Markus Korber wrote:
> 
> Thus spake Takashi Iwai:
> 
> > At Mon, 03 Sep 2007 11:24:02 +0200,
> > Markus Korber wrote:
> >
> >> However, the sound is stuttering a lot (I guess this is a xine-lib
> >> issue).
> >
> > Can you install older versions of ALSA-lib *manually* and check in
> > which version the bug doesn't appear?  Then we can pin-point the
> > change.
> 
> Ok, so I compiled alsa-lib, installed libasound.so, and recompiled the
> xine alsa output module against the appropriate alsa-lib:
> 
> 1.0.13    : failed
> 1.0.14a   : failed
> 1.0.15rc1 : failed
> 
> Any ideas?  
> 
> Perhaps xine-lib doesn't work well if buffer_size = 2*period_size?

It depends on the setting.
Did it ever work with any version?


Takashi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ALSA lib troubles with xine
  2007-09-03 14:57           ` Takashi Iwai
@ 2007-09-03 15:38             ` Markus Korber
  0 siblings, 0 replies; 11+ messages in thread
From: Markus Korber @ 2007-09-03 15:38 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Jaroslav Kysela

Takashi Iwai wrote:

> At Mon, 03 Sep 2007 16:52:03 +0200,
> Markus Korber wrote:
>> Thus spake Takashi Iwai:
>>
>>> At Mon, 03 Sep 2007 11:24:02 +0200,
>>> Markus Korber wrote:
>>>
>>>> However, the sound is stuttering a lot (I guess this is a xine-lib
>>>> issue).
>>> Can you install older versions of ALSA-lib *manually* and check in
>>> which version the bug doesn't appear?  Then we can pin-point the
>>> change.
>> Ok, so I compiled alsa-lib, installed libasound.so, and recompiled the
>> xine alsa output module against the appropriate alsa-lib:
>>
>> 1.0.13    : failed
>> 1.0.14a   : failed
>> 1.0.15rc1 : failed
>>
>> Any ideas?  
>>
>> Perhaps xine-lib doesn't work well if buffer_size = 2*period_size?
> 
> It depends on the setting.
> Did it ever work with any version?

No.  However, other applications work perfectly (mplayer, alsaplayer, 
aplay).

Regards,
Markus Korber

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-09-03 15:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-03  6:53 ALSA lib troubles with xine Markus Korber
2007-09-03  8:12 ` Clemens Ladisch
2007-09-03  9:07   ` Markus Korber
2007-09-03  8:12 ` Markus Korber
2007-09-03  8:19   ` Clemens Ladisch
2007-09-03  8:24   ` Jaroslav Kysela
2007-09-03  9:24     ` Markus Korber
2007-09-03 13:04       ` Takashi Iwai
2007-09-03 14:52         ` Markus Korber
2007-09-03 14:57           ` Takashi Iwai
2007-09-03 15:38             ` Markus Korber

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.