mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luca Weiss" <luca.weiss@fairphone.com>
To: "Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Srinivas Kandagatla" <srini@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Wesley Cheng" <quic_wcheng@quicinc.com>,
	"Stephan Gerhold" <stephan.gerhold@linaro.org>
Cc: <~postmarketos/upstreaming@lists.sr.ht>,
	<phone-devel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-sound@vger.kernel.org>
Subject: Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
Date: Mon, 28 Apr 2025 09:41:10 +0200	[thread overview]
Message-ID: <D9I3OWQF8T3Y.1Q5U9E2RI5YZX@fairphone.com> (raw)
In-Reply-To: <5c4ed073-45fe-4938-b25b-8979d96b456d@oss.qualcomm.com>

On Fri Apr 25, 2025 at 11:06 PM CEST, Konrad Dybcio wrote:
> On 4/25/25 12:44 PM, Luca Weiss wrote:
>> Enable USB audio offloading which allows to play audio via a USB-C
>> headset with lower power consumption and enabling some other features.
>> 
>> This can be used like the following:
>> 
>>   $ amixer -c0 cset name='USB_RX Audio Mixer MultiMedia1' On
>>   $ aplay --device=plughw:0,0 test.wav
>> 
>> Compared to regular playback to the USB sound card no interrupts should
>> appear on the xhci-hcd interrupts during playback, instead the ADSP will
>> be handling the playback.
>
> "should" isn't very optimistic - I assume this works for you? > 

Yes it does!

With 'should' I meant to describe the expected behavior from using this
since most people are probably not familiar with how this works.

>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
> [...]
>
>> +&sound {
>> +	compatible = "fairphone,fp4-sndcard";
>> +	model = "Fairphone 4";
>> +
>> +	mm1-dai-link {
>> +		link-name = "MultiMedia1";
>> +
>> +		cpu {
>> +			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
>> +		};
>> +	};
>> +
>> +	usb-dai-link {
>> +		link-name = "USB Playback";
>> +
>> +		cpu {
>> +			sound-dai = <&q6afedai USB_RX>;
>> +		};
>> +
>> +		codec {
>> +			sound-dai = <&q6usbdai USB_RX>;
>> +		};
>
> 'co'dec < 'cp'u> +

Aah, I thought I checked for that already. Will fix.

>> +		platform {
>> +			sound-dai = <&q6routing>;
>> +		};
>> +	};
>> +};
>> +
>>  &tlmm {
>>  	gpio-reserved-ranges = <13 4>, <56 2>;
>>  
>> @@ -1178,6 +1214,7 @@ &usb_1 {
>>  &usb_1_dwc3 {
>>  	maximum-speed = "super-speed";
>>  	dr_mode = "otg";
>> +	num-hc-interrupters = /bits/ 16 <3>;
> Where does this number come from?

I'm honestly not 100% sure. As far as I understand it, with
'qcom,usb-audio-intr-idx = /bits/ 16 <2>;' in the qcom,q6usb node (which
I've checked against downstream) we declare which "XHCI interrupter
number to use". Without the num-hc-interrupters property we get an error
that not enough interrupters are available (I assume only 1 is then), so
this value practically needs to be higher than the <2> from earlier.

Why it's this value and not a higher value e.g. 4 I'm not really sure.
Downstream code looks somewhat different and "max_interrupters" in
drivers/usb/ doesn't come from a dt property. I'd need to check more in
details what this code does - or maybe Wesley can help.

Regards
Luca

>
> Konrad


  reply	other threads:[~2025-04-28  7:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
2025-04-25 10:44 ` [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property Luca Weiss
2025-04-25 21:39   ` Wesley Cheng
2025-04-28  7:34     ` Luca Weiss
2025-04-25 10:44 ` [PATCH 2/6] ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode Luca Weiss
2025-04-25 10:44 ` [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card Luca Weiss
2025-04-28  8:31   ` Krzysztof Kozlowski
2025-04-25 10:44 ` [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible Luca Weiss
2025-04-25 19:02   ` Dmitry Baryshkov
2025-04-25 10:44 ` [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node Luca Weiss
2025-04-25 19:03   ` Dmitry Baryshkov
2025-04-25 10:44 ` [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support Luca Weiss
2025-04-25 19:04   ` Dmitry Baryshkov
2025-04-25 21:06   ` Konrad Dybcio
2025-04-28  7:41     ` Luca Weiss [this message]
2025-04-28 21:20       ` Konrad Dybcio
2025-04-28 21:43       ` Konrad Dybcio
2025-04-29  8:55         ` Luca Weiss
2025-04-29  9:00           ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D9I3OWQF8T3Y.1Q5U9E2RI5YZX@fairphone.com \
    --to=luca.weiss@fairphone.com \
    --cc=andersson@kernel.org \
    --cc=balbi@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=phone-devel@vger.kernel.org \
    --cc=quic_wcheng@quicinc.com \
    --cc=robh@kernel.org \
    --cc=srini@kernel.org \
    --cc=stephan.gerhold@linaro.org \
    --cc=tiwai@suse.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®