Re: [PATCH] ALSA: usb-audio: proc: use found syncmaxsize to determine feedback format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tested the patch in my system. Here is the cat
/proc/asound/card0/stream0 output

root@OpenWrt:/proc/asound/card0# cat stream0
Audio-gd Audio-gd at usb-0000:00:0f.5-2, high speed : USB Audio

Playback:
  Status: Running
    Interface = 1
    Altset = 1
    Packet Size = 772
    Momentary freq = 44110 Hz (0x5.8383)
    Feedback Format = 16.16
  Interface 1
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 4 OUT (ASYNC)
    Rates: 44100, 88200, 48000, 96000, 176400, 192000
    Data packet interval: 1000 us
  Interface 1
    Altset 2
    Format: S24_3LE
    Channels: 2
    Endpoint: 4 OUT (ASYNC)
    Rates: 44100, 88200, 48000, 96000, 176400, 192000
    Data packet interval: 500 us
  Interface 1
    Altset 3
    Format: S32_LE
    Channels: 2
    Endpoint: 4 OUT (ASYNC)
    Rates: 44100, 88200, 48000, 96000, 176400, 192000
    Data packet interval: 500 us


Seems O.K. now.
Thank you again Torstein!

Davor.

On 05/16/2013 08:26 PM, Torstein Hegge wrote:
> freqshift is only set for the data endpoint and syncmaxsize is only set
> for the sync endpoint. This results in a syncmaxsize of zero used in the
> proc output feedback format calculation, which gives a feedback format
> incorrectly shown as 8.16 for UAC2 devices.
>
> As neither the data nor the sync endpoint gives all the relevant
> content, output the two combined.
>
> Also remove the sync_endpoint "packet size" which is always zero
> and the sync_endpoint "momentary freq" which is constant.
>
> Tested with UAC2 async and UAC1 adaptive, not tested with UAC1 async.
>
> Reported-by: B. Zhang <bb.zhang@xxxxxxx>
> Signed-off-by: Torstein Hegge <hegge@xxxxxxxxxxx>
> ---
> Cc: Takashi Iwai <tiwai@xxxxxxx>
> Cc: Daniel Mack <zonque@xxxxxxxxx>
> Cc: Clemens Ladisch <clemens@xxxxxxxxxx>
> Cc: Davor Herga <davor.herga@xxxxxxxxxxxxxx>
>
>  sound/usb/proc.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/sound/usb/proc.c b/sound/usb/proc.c
> index d218f76..462a5ed 100644
> --- a/sound/usb/proc.c
> +++ b/sound/usb/proc.c
> @@ -117,21 +117,22 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
>  }
>  
>  static void proc_dump_ep_status(struct snd_usb_substream *subs,
> -				struct snd_usb_endpoint *ep,
> +				struct snd_usb_endpoint *data_ep,
> +				struct snd_usb_endpoint *sync_ep,
>  				struct snd_info_buffer *buffer)
>  {
> -	if (!ep)
> +	if (!data_ep)
>  		return;
> -	snd_iprintf(buffer, "    Packet Size = %d\n", ep->curpacksize);
> +	snd_iprintf(buffer, "    Packet Size = %d\n", data_ep->curpacksize);
>  	snd_iprintf(buffer, "    Momentary freq = %u Hz (%#x.%04x)\n",
>  		    subs->speed == USB_SPEED_FULL
> -		    ? get_full_speed_hz(ep->freqm)
> -		    : get_high_speed_hz(ep->freqm),
> -		    ep->freqm >> 16, ep->freqm & 0xffff);
> -	if (ep->freqshift != INT_MIN) {
> -		int res = 16 - ep->freqshift;
> +		    ? get_full_speed_hz(data_ep->freqm)
> +		    : get_high_speed_hz(data_ep->freqm),
> +		    data_ep->freqm >> 16, data_ep->freqm & 0xffff);
> +	if (sync_ep && data_ep->freqshift != INT_MIN) {
> +		int res = 16 - data_ep->freqshift;
>  		snd_iprintf(buffer, "    Feedback Format = %d.%d\n",
> -			    (ep->syncmaxsize > 3 ? 32 : 24) - res, res);
> +			    (sync_ep->syncmaxsize > 3 ? 32 : 24) - res, res);
>  	}
>  }
>  
> @@ -141,8 +142,7 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn
>  		snd_iprintf(buffer, "  Status: Running\n");
>  		snd_iprintf(buffer, "    Interface = %d\n", subs->interface);
>  		snd_iprintf(buffer, "    Altset = %d\n", subs->altset_idx);
> -		proc_dump_ep_status(subs, subs->data_endpoint, buffer);
> -		proc_dump_ep_status(subs, subs->sync_endpoint, buffer);
> +		proc_dump_ep_status(subs, subs->data_endpoint, subs->sync_endpoint, buffer);
>  	} else {
>  		snd_iprintf(buffer, "  Status: Stop\n");
>  	}


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user




[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux