-
Notifications
You must be signed in to change notification settings - Fork 3
Add Hostapi Pulseaudio to Portaudio #1
base: master
Are you sure you want to change the base?
Conversation
…ce and Blocking implementation. * Pulseaudio (http://www.freedesktop.org/wiki/Software/PulseAudio/) * Official Portaudio (http://www.portaudio.com/)
…rtaudio coding convention
I have failed to build this. What is the receipt? I have tried to call but its has an error and a lot of warnings: configure.ac:38: error: required file '../../ltmain.sh' not found I am on Ubuntu Trusty |
I use aclocal libtoolize -f autoconf -f automake -f but you can also use (if above doesn't work) aclocal -f libtoolize -f -c autoconf -f automake -f -a I should check the CMake version because it's should be less pain |
I have still no luck: automake -f |
Oh there should be './configure' now? Just run it and it compiles. It's very frustrating that autotools configuration is messing up. |
Ah thanks, I did not expect that this worked after previous error. |
Marvellous @daschuer. I'll update 'Makefile.am' and 'README.md'. After 15 years of maintaining autotools in several projects I've have love and hate relationship with it. Glad you made it work! |
What will be the best way to handle installations without Pulse? |
/* PaPulseaudioHostApiRepresentation - host api datastructure specific to this implementation */ | ||
|
||
#define PULSEAUDIO_TIME_EVENT_USEC 50000 | ||
#define PULSEAUDIO_BUFFER_SIZE (88100 * 4 * 2) |
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.
Comments why you pick these values above would be helpful
…g writing but provides 'pa_stream_writable_size' for quering how much can we write. So with turning OFF PulseAudio write-callback and just looping until we have written everything emulates block writing very well.
Now there is some callback clicks to investigate (which are caused same that caused the blocking playback clicks) and stopping and starting input stream but otherwise this start to be in very good shape.. Hopefully I didn't mugged up Terminate with last fix 👊 |
Hm. My program did have a click in callback mode, which I managed to fix by changing my callback to zero the entire buffer -- before that if I didn't have a full buffer's worth of samples I only filled in part of the buffer. Don't know if that helps. There's a few more problems I'd like to investigate, how would you prefer to manage them? I can make a PR for each, or open an issue, or just make a list here? |
PR is most convenient I think. List what is wrong could be also good so I can fix some of them also. |
Actually the only definite problem I'm currenty aware of is that the left/right channel balance is off when the program opens a stream in mono mode (eg. patest_mono). It should be centered but it is heavily skewed towards one of the channels. (the other things on my list I need to investigate to see if there is actually a problem before bothering you) |
1. Change PulseAudioConvertPortaudioFormatToPulseAudio to return paSampleFormatNotSupported on failure instead of paNotInitialized. 2. Fix OpenStream to check the return value from: * PulseAudioConvertPortaudioFormatToPulseAudio * PulseAudioBlockingInitRingBuffer 3. Fix OpenStream to return the actual PaError on failure, instead of always returning paNotInitialized. 4. Fix OpenStream to not free the host api representation on error (which resulted in an assertion failure later in Terminate).
Ok I thought portaudio's buffer processor took care of this kind of channel adaption, but it turns out that's host api specific. eg. alsa has So maybe there's nothing to do there, except document the current behaviour (or run it by the main portaudio devs). |
Add support for non-interleaved audio
So they do it 'hard way' I try to find time to implement it. It's not a big thing but import for many cases. |
Ah I found another issue - |
Yes output ring buffer should be removed altogether.. probably same goes with input ringbuffer (requires some work). Can you provide some example how it's inaccurate or how to test it? I try to fix mono thing and this before eastern. |
Well right now it always returns zero, but that's also because it is calling I think the input ring buffer is still used in blocking mode at the moment? The recording side of things may need more testing in general, I know I haven't looked at it. |
I ran into this:
Caused by:
Obviously this order of operations will never work so I don't consider this a serious problem, just wanted to document it. In an ideal world it would return |
Hmm.. above should be tracked as Issue? Seems to be some kind of blocker. |
Huh long time no pushed this but now Mono should be converted to Stereo correctly. Does this fix your problem @sqweek? I'll try to fix some input issues that I have found next and that close one too. |
I'm trying to get this in officialy.. pull request to new shiny Portaudio GIT repo https://app.assembla.com/spaces/portaudio/git/merge_requests/3719213 |
Awesome. Between this and the library GUI redesign, Mixxx could replace Amarok as my casual music player :) |
Nice work Tuukka! 👍 |
It is really bad that this is still not merged for long. Can you update this with the latest changes on assembla. I am considering to add this to a Launchpad PPA. |
I've been toying around to rewrite this. I'll find time to update this |
Please refer to: https://github.com/illuusio/assembla-mirror-portaudio-pulseaudio as upstream for ths |
This Pull Request adds Pulseaudio Hostapi to Portaudio