diff options
author | Torstein Hegge <hegge@resisty.net> | 2013-05-16 14:26:17 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-05-17 02:05:34 -0400 |
commit | e6135fe960bba1d1a3a6b6818839e6d8d3f21293 (patch) | |
tree | 332122e4ca8fb42f59db1cd44c869d920578649d /sound | |
parent | 436c4a0cfbc4c7a95c4ea37dbd9f697d5dfd553f (diff) |
ALSA: usb-audio: proc: use found syncmaxsize to determine feedback format
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@free.fr>
Signed-off-by: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/proc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sound/usb/proc.c b/sound/usb/proc.c index 135c76871063..5f761ab34c01 100644 --- a/sound/usb/proc.c +++ b/sound/usb/proc.c | |||
@@ -116,21 +116,22 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s | |||
116 | } | 116 | } |
117 | 117 | ||
118 | static void proc_dump_ep_status(struct snd_usb_substream *subs, | 118 | static void proc_dump_ep_status(struct snd_usb_substream *subs, |
119 | struct snd_usb_endpoint *ep, | 119 | struct snd_usb_endpoint *data_ep, |
120 | struct snd_usb_endpoint *sync_ep, | ||
120 | struct snd_info_buffer *buffer) | 121 | struct snd_info_buffer *buffer) |
121 | { | 122 | { |
122 | if (!ep) | 123 | if (!data_ep) |
123 | return; | 124 | return; |
124 | snd_iprintf(buffer, " Packet Size = %d\n", ep->curpacksize); | 125 | snd_iprintf(buffer, " Packet Size = %d\n", data_ep->curpacksize); |
125 | snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n", | 126 | snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n", |
126 | subs->speed == USB_SPEED_FULL | 127 | subs->speed == USB_SPEED_FULL |
127 | ? get_full_speed_hz(ep->freqm) | 128 | ? get_full_speed_hz(data_ep->freqm) |
128 | : get_high_speed_hz(ep->freqm), | 129 | : get_high_speed_hz(data_ep->freqm), |
129 | ep->freqm >> 16, ep->freqm & 0xffff); | 130 | data_ep->freqm >> 16, data_ep->freqm & 0xffff); |
130 | if (ep->freqshift != INT_MIN) { | 131 | if (sync_ep && data_ep->freqshift != INT_MIN) { |
131 | int res = 16 - ep->freqshift; | 132 | int res = 16 - data_ep->freqshift; |
132 | snd_iprintf(buffer, " Feedback Format = %d.%d\n", | 133 | snd_iprintf(buffer, " Feedback Format = %d.%d\n", |
133 | (ep->syncmaxsize > 3 ? 32 : 24) - res, res); | 134 | (sync_ep->syncmaxsize > 3 ? 32 : 24) - res, res); |
134 | } | 135 | } |
135 | } | 136 | } |
136 | 137 | ||
@@ -140,8 +141,7 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn | |||
140 | snd_iprintf(buffer, " Status: Running\n"); | 141 | snd_iprintf(buffer, " Status: Running\n"); |
141 | snd_iprintf(buffer, " Interface = %d\n", subs->interface); | 142 | snd_iprintf(buffer, " Interface = %d\n", subs->interface); |
142 | snd_iprintf(buffer, " Altset = %d\n", subs->altset_idx); | 143 | snd_iprintf(buffer, " Altset = %d\n", subs->altset_idx); |
143 | proc_dump_ep_status(subs, subs->data_endpoint, buffer); | 144 | proc_dump_ep_status(subs, subs->data_endpoint, subs->sync_endpoint, buffer); |
144 | proc_dump_ep_status(subs, subs->sync_endpoint, buffer); | ||
145 | } else { | 145 | } else { |
146 | snd_iprintf(buffer, " Status: Stop\n"); | 146 | snd_iprintf(buffer, " Status: Stop\n"); |
147 | } | 147 | } |