Re: [PATCH v4] alsa-sink/source, sink, source: Consider sample format for avoid-resampling/passthrough

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

 



2018년 11월 14일 (수) 오후 6:38, Tanu Kaskinen <tanuk@xxxxxx>님이 작성:
>
> > -    if (!supported) {
> > -        pa_log_info("Sink does not support sample rate of %d Hz", spec->rate);
> > -        return -1;
> > +    if (!format_supported) {
> > +        pa_log_info("Sink does not support sample format of %s, set it to default value",
> > +                    pa_sample_format_to_string(spec->format));
> > +        pa_sink_set_sample_format(u->sink, u->core->default_sample_spec.format);
>
> This is still not right. We can't assume that u->core-
> >default_sample_spec.format is supported by the hardware.
>
> When the sink is created, it opens the device for the first time, using
> the default format. If that format isn't supported, some other format
> is selected instead (or otherwise the whole sink initialization fails).
> I think this format should be used as the default here, because it's
> known to work.

I got your point. I'll correct it with keeping the 'verified' sample
spec and setting it here.

> >
> >      /* Passthrough status change is handled during unsuspend */
> >
> > -    return -1;
> > +    return 0;
>
> The function now reports success always. This made me have a look at
> the places that check for errors from reconfigure(). There are just two
> places that currently care about the reconfigure() return values:
> pa_sink_reconfigure(), when it reconfigures a monitor sink, and
> pa_source_reconfigure(), when it reconfigures a monitored sink. To me
> it looks like those can be safely changed to just assume that the
> reconfiguration always succeeds. We should change the reconfigure()
> callback return types to void.

I agree with that, it'll be revised also. I appreciate your comment.

Regards,
Sangchul
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux