After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347554 - Alsasink not properly working with uClibc
Alsasink not properly working with uClibc
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.9
Other All
: Normal critical
: 0.10.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-14 21:07 UTC by jean-marie verdun
Modified: 2006-12-17 18:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jean-marie verdun 2006-07-14 21:07:46 UTC
Please describe the problem:
Hi, 

Alsasink is producing really poor sound with uClibc, I am tracking this issue and believe that it is standing into the C library, but need some help to confirm it. Basically, the test gst-launch audiotestsrc ! aslsasink produce cranky sound. I have a really really stranfe work around which is to add some printf into the gst_alsasink_write function.

  cptr = length / alsa->bytes_per_sample;
  ptr = data;
  printf("alsa rate %d\n",alsa->rate);
  printf("alsa channel %d\n",alsa->channels);
  printf("alsa byte %d\n",alsa->bytes_per_sample);
  printf("alsa time %d\n",alsa->buffer_time);
  printf("alsa period %d\n",alsa->period_time);
  printf("alsa siz %d\n",alsa->buffer_size);
  printf("alsa per siz %d\n",alsa->period_size);
  GST_ALSA_LOCK (asink);
  while (cptr > 0) {
    err = snd_pcm_writei (alsa->handle, ptr, cptr);
In that case redirecting the output of the command to /dev/null produce good sound. I believe that the printf is inserting some synchronisation stuff, but I have some issue to find out why and what could be involved into the program.

Jm

Steps to reproduce:
1. You need a uClibc environment
2. install gstreamer-0.10.9 and gst-plugins-base-0.10.9
3. run gst-launch audiotestsrc ! alsasink


Actual results:
Sound is strating to play for less than a second and get really bad

Expected results:


Does this happen every time?
yes

Other information:
I am running with an ATI based system, with kernel 2.6.16.23 and it's included kernel.
If needed I can provide a bootable CD with the uClibc environment, or a way to build it.
Comment 1 jean-marie verdun 2006-07-16 19:49:50 UTC
Hi,

I have fixed the problem, the behavior of
Hi,

I have fixed the issue, by modifying the gstalsasink.c file, this is done through:
  /* now get the configured values */
  alsa->buffer_size=snd_pcm_hw_params_get_buffer_size (params, &alsa->buffer_size);
//  CHECK (snd_pcm_hw_params_get_buffer_size (params, &alsa->buffer_size),
//      buffer_size);
  alsa->period_size=snd_pcm_hw_params_get_period_size (params, &size, &dir);
//  CHECK (snd_pcm_hw_params_get_period_size (params, &alsa->period_size, &dir),
//      period_size);

The snd_pcm_hw_params_get_buffer_size function doesn't set properly the value on uClibc, this need more investigation. I will post a message on ALSA mailing list.

Jean-Marie



(In reply to comment #0)
> Please describe the problem:
> Hi, 
> 
> Alsasink is producing really poor sound with uClibc, I am tracking this issue
> and believe that it is standing into the C library, but need some help to
> confirm it. Basically, the test gst-launch audiotestsrc ! aslsasink produce
> cranky sound. I have a really really stranfe work around which is to add some
> printf into the gst_alsasink_write function.
> 
>   cptr = length / alsa->bytes_per_sample;
>   ptr = data;
>   printf("alsa rate %d\n",alsa->rate);
>   printf("alsa channel %d\n",alsa->channels);
>   printf("alsa byte %d\n",alsa->bytes_per_sample);
>   printf("alsa time %d\n",alsa->buffer_time);
>   printf("alsa period %d\n",alsa->period_time);
>   printf("alsa siz %d\n",alsa->buffer_size);
>   printf("alsa per siz %d\n",alsa->period_size);
>   GST_ALSA_LOCK (asink);
>   while (cptr > 0) {
>     err = snd_pcm_writei (alsa->handle, ptr, cptr);
> In that case redirecting the output of the command to /dev/null produce good
> sound. I believe that the printf is inserting some synchronisation stuff, but I
> have some issue to find out why and what could be involved into the program.
> 
> Jm
> 
> Steps to reproduce:
> 1. You need a uClibc environment
> 2. install gstreamer-0.10.9 and gst-plugins-base-0.10.9
> 3. run gst-launch audiotestsrc ! alsasink
> 
> 
> Actual results:
> Sound is strating to play for less than a second and get really bad
> 
> Expected results:
> 
> 
> Does this happen every time?
> yes
> 
> Other information:
> I am running with an ATI based system, with kernel 2.6.16.23 and it's included
> kernel.
> If needed I can provide a bootable CD with the uClibc environment, or a way to
> build it.
>