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

 
 

bug #38157: Wrong measurements from PulseAudio monitor interface.

Submitter:  Ibán Cereijo <ibancereijo>
Submitted:  Wed 23 Jan 2013 10:21:13 PM UTC
 
Category:  None Severity:  5 - Blocker
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  ibancereijo
Open/Closed:  Open
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

( 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 Administrator
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 Administrator
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 Administrator
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 Administrator
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 Administrator
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 Administrator
Wed 23 Jan 2013 10:21:13 PM UTC, original submission:  

The frequencies are different.

Ibán Cereijo <ibancereijo>
Project Administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-02-06 ibancereijo Carbon-Copy- Added grachi
    2013-02-06 ibancereijo Carbon-CopyRemoved -email is unavailable- -
    2013-02-06 ibancereijo Carbon-Copy- Added -email is unavailable-

    Back to the top


    Powered by Savane 3.9