bugLINGOT Is Not a Guitar-Only Tuner - Bugs: bug #38157, Wrong measurements from PulseAudio...

 
 

bug #38157: Wrong measurements from PulseAudio monitor interface.

Submitted by:  Ibán Cereijo <ibancereijo>
Submitted on:  Wed 23 Jan 2013 10:21:13 PM UTC  
 
Category: NoneSeverity: 5 - Blocker
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned to: Ibán Cereijo <ibancereijo>
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 08 Feb 2013 03:23:32 PM UTC, comment #6:

Using PulseAudio Manager, 'Devices' tab, the sink works usually ('Properties' button) with sample spec 's16le 2ch 48000Hz' (then Lingot fails), and sometimes with 's16le 2ch 44100Hz', and the related monitor source works always with 's16le 2ch 44100Hz'.

Then, when the sink works at 48kHz and the related monitor source at 44.1kHz, the delivered sample rate is always 48/44.1 times the requested one.

I cannot predict when the sink will change the rate, but sometimes it is set to 44.1kHz with no process sending data, and changes to 48kHz when we reproduce some music for example.

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.
Fri 08 Feb 2013 09:13:34 AM UTC, comment #5:

From grachi:

There seems to be a log somewhere with this kind of information:

May 28 17:02:11 chainsaw pulseaudio[13095]: [pulseaudio] sink.c: Cannot update rate, monitor source is RUNNING

http://ubuntuforums.org/archive/index.php/t-1980855.html

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.
Tue 05 Feb 2013 07:46:45 PM UTC, comment #4:

Sampling at the 'natural' device rate doesn't fix the problem: it looks like if PA were sampling always at a higher frequency (x48000/44100) than what we tell it to do.

I wrote a sample rate estimator based upon the number of delivered samples and the elapsed time between calls, ans the physical sample rate is estimated higher:

~52200 when 48000 is requested
~48000 when 44100 is requested
~24000 when 22050 is requested
...

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.
Tue 05 Feb 2013 04:07:59 PM UTC, comment #3:

We should make a difference between a normal source and a monitor, which seems to be working always at the same rate. We can introduce the following lines in lingot-audio-pulseaudio.c:333 to dump dome information when discovering the devices:

printf("%s <%s>\n", i->description, i->name);
printf("\tmonitor of: %s\n", i->monitor_of_sink_name);
printf("\t%i channels, rate %i, format %i\n", i->sample_spec.channels, i->sample_spec.rate, i->sample_spec.format);
printf("\tlags %i\n", i->flags);

Turns out that the sample_spec in a normal source has a rate of 48KHz, and 44.1KHz for a monitor source (default configuration I guess). We need to:

1. Check whether this is actually the root of the problem.
2. If it is, detect the actual sample rate.
3. Tell the user the real sample rate afterwards, or avoid him/her choosing wrong rates beforehand.

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.
Mon 04 Feb 2013 12:52:32 AM UTC, comment #2:

Looks like PA is sampling with another rate:

44100/48000 = 0.91875

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.
Mon 04 Feb 2013 12:09:25 AM UTC, comment #1:

The frequencies are always about 0.918 the real ones:

110.0 Hz (A2) -> 101.00 Hz
329.62 Hz (E4) -> 302.77 Hz

Although, this is not always happening: sometimes it is possible to launch Lingot with the monitor source already selected and get it to work.

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.
Wed 23 Jan 2013 10:21:13 PM UTC, original submission:

The frequencies are different.

Ibán Cereijo <ibancereijo>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ibancereijo
  • -unavailable- added by ibancereijo (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 Feb 2013 02:05:27 PM UTCibancereijoCarbon-Copy-=>Added grachi
    Wed 06 Feb 2013 02:05:07 PM UTCibancereijoCarbon-CopyRemoved -unavailable-=>-
    Wed 06 Feb 2013 02:03:46 PM UTCibancereijoCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1