-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sndio #647
Conversation
e0e0c44
to
04df09a
Compare
@Ianodan: Please clarify: are you saying that you have not made the changes requested at Assembla? |
We merged a PR last week, Add Sun/NetBSD hostapi #645 Is there any overlap between these two implementations? Do we need both? |
I cannot see the comments that were made on Assembla for the PR done some years ago by someone else, so no.
There is no relation between Sun/NetBSD audio and sndio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for resurrecting this code. I have not given a it a full review. But I did notice some stylistic issues.
We are interested in this contribution, but we will not accept it as-is. Our basic formatting conventions need to be adhered to (e.g. use spaces not tabs, formatting of function declarations) see: https://github.com/PortAudio/portaudio/wiki/ImplementationStyleGuidelines . Beyond this, I think the review comments to-date are reasonable, but perhaps there is some room for compromise in the style of variable names ( |
Please let us know if you are interested in updating the code style. Also please let us know if you are willing to be an "owner" of this code and make bug fixes if needed. |
God is good,
Hope that covers things and did not forget anything. |
@lanodan - Please let us know if you would like to keep working on this. Please see comments above. |
Yes, I do want to keep working on it. AFAIK I just addressed all the comments above.
I am willing to maintain this code as I need it to work and would gladly welcome co-owners, specially ones which are from non-Linux to cover more systems (as I've yet to get actually working audio in QEMU). As for the code style, I pushed a |
f8a10b5
to
840a4fc
Compare
It's looking much more consistent with our other code. Could you please also make a global find and replace of |
src/hostapi/sndio/pa_sndio.c
Outdated
par->bps = 3; /* paInt24 is packed format */ | ||
break; | ||
case paInt16: | ||
case paFloat32: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this is a bug, but ideally float32 should be mapped to 24 or 32 bit IO (assuming that sndio doesn't support float IO natively).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please leave a comment explaining why it works even though it may look odd. That will save you from having people ask questions about the code in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this was a bug I inherited, it doesn't looks like sndio supports floats so I removed the case paFloat32:
line for now, will try to fix it properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapped it to 32bit IO, not entirely sure what would be the best way to test or be sure which to pick.
This is based on current modifications to portaudio done in OpenBSD. Closes: PortAudio#220
PaSndioHostApiRepresentation *sndioHostApi; | ||
PaDeviceInfo *info; | ||
struct sio_hdl *hdl; | ||
char *audiodevices; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be audioDevices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #878
typedef struct PaSndioStream | ||
{ | ||
PaUtilStreamRepresentation base; | ||
PaUtilBufferProcessor bufproc; /* format conversion */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to bufferProcessor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #878
@@ -0,0 +1,10 @@ | |||
AlignTrailingComments: 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking very good.
This file can lead to unexpected reformatting.
Can you please move this .clang-format file into the /sndio/ folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #878
struct sio_par par; | ||
unsigned mode; | ||
int inputChannelCount, outputChannelCount; | ||
PaSampleFormat ifmt, ofmt, siofmt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use more clear names like "inputFormat".
have_sndio=no | ||
if test "x$with_sndio" != "xno"; then | ||
AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no) | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use PKG_CHECK_MODULES(SNDIO, sndio, have_sndio=yes, have_sndio=no)
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #878
@@ -382,6 +390,13 @@ case "${host_os}" in | |||
AC_DEFINE(PA_USE_AUDIOIO,1) | |||
fi | |||
|
|||
if [[ "$have_sndio" = "yes" -a "$with_sndio" != "no" ]] ; then | |||
DLL_LIBS="$DLL_LIBS -lsndio" | |||
LIBS="$LIBS -lsndio" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use
DLL_LIBS="$DLL_LIBS $SNDIO_LIBS"
LIBS="$LIBS $SNDIO_LIBS"
CFLAGS="$CFLAGS $SNDIO_CFLAGS"
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #878
BTW, I came across this ticket as I am an OpenBSD developer and was going to consider another push of a sndio backend, but came across this PR before doing so. |
Any chance of this getting merged before we die of old age? |
Is anyone interested in moving this forward? |
We have had a PA backend in our tree for 15 years. I would very much like to see something moving forward. Even if it's not perceived to be 100% perfect. You have to start somewhere.
@lanodan seems to have disappeared. |
> It needs to be rebased and there are unresolved issues.
@lanodan seems to have disappeared.
Sorry for the silence, I ended up switching to pipewire for unrelated reasons to this PR (as I had it applied on my systems), feel free to take over.
|
New attempt to get sndio into portaudio, sadly I couldn't get the comments to the diff on Assembla for some reason.
Closes: #220