summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
Commit message (Collapse)AuthorAgeFilesLines
* Log underrunsLennart Poettering2009-03-311-1/+1
|
* update command name tableLennart Poettering2009-03-311-1/+14
|
* revive solaris moduleFinn Thain2009-03-311-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Wed, 4 Mar 2009, Lennart Poettering wrote: [snip] > > This patch disables link map/library versioning unless ld is GNU ld. > > Another approach for solaris would be to use that linker's -M option, > > but I couldn't make that work (due to undefined mainloop, browse and > > simple symbols when linking pacat. I can post the errors if anyone is > > intested.) > > The linking in PA is a bit weird since we have a cyclic dependency > between libpulse and libpulsecommon which however is not explicit. Could that affect the pacat link somehow? What are the implications for client apps that link with the non-versioned libraries I've been building on solaris? [snip] > > struct userdata { > > pa_core *core; > > @@ -87,15 +92,24 @@ struct userdata { > > > > pa_memchunk memchunk; > > > > - unsigned int page_size; > > - > > uint32_t frame_size; > > - uint32_t buffer_size; > > - unsigned int written_bytes, read_bytes; > > + int32_t buffer_size; > > + volatile uint64_t written_bytes, read_bytes; > > + pa_mutex *written_bytes_lock; > > Hmm, we generally try do do things without locking in PA. This smells as > if it was solvable using atomic ints as well. > > Actually, looking at this again I get the impression these mutex are > completely unnecessary here. All functions that lock these mutexes are > called from the IO thread so no locking should be nessary. > > Please don't use volatile here. I am pretty sure it is a misuse. Also > see http://kernel.org/doc/Documentation/volatile-considered-harmful.txt > which applies here too I think. OK, I've removed the locks. For some reason I thought that the get_latency function was called from two different threads. > > +static void sink_set_volume(pa_sink *s) { > > + struct userdata *u; > > + audio_info_t info; > > + > > + pa_assert_se(u = s->userdata); > > + > > + if (u->fd >= 0) { > > + AUDIO_INITINFO(&info); > > + > > + info.play.gain = pa_cvolume_avg(&s->virtual_volume) * AUDIO_MAX_GAIN / PA_VOLUME_NORM; > > + assert(info.play.gain <= AUDIO_MAX_GAIN); > > I'd prefer if you'd use pa_cvolume_max here instead of pa_cvolume_avg() > because this makes the volume independant of the balance. > > > - info.play.error = 0; > > + info.play.gain = pa_cvolume_avg(&s->virtual_volume) * AUDIO_MAX_GAIN / PA_VOLUME_NORM; > > + assert(info.play.gain <= AUDIO_MAX_GAIN); > > Same here. (i.e. for the source) Done and done. > > + if (u->sink->thread_info.rewind_requested) > > + pa_sink_process_rewind(u->sink, 0); > > This is correct. > > > > > err = ioctl(u->fd, AUDIO_GETINFO, &info); > > pa_assert(err >= 0); > > Hmm, if at all this should be pa_assert_se(), not pa_assert() (so that > it is not defined away by -DNDEBUG). However I'd prefer if the error > would be could correctly. (I see that this code is not yours, but > still...) Done. > > + case EINTR: > > + break; > > I think you should simply try again in this case... Done. > > + case EAGAIN: > > + u->buffer_size = u->buffer_size * 18 / 25; > > + u->buffer_size -= u->buffer_size % u->frame_size; > > + u->buffer_size = PA_MAX(u->buffer_size, (int32_t)MIN_BUFFER_SIZE); > > + pa_sink_set_max_request(u->sink, u->buffer_size); > > + pa_log("EAGAIN. Buffer size is now %u bytes (%llu buffered)", u->buffer_size, buffered_bytes); > > + break; > > Hmm, care to explain this? EAGAIN happens when the user requests a buffer size that is too large for the STREAMS layer to accept. We end up looping with EAGAIN every time we try to write out the rest of the buffer, which burns enough CPU time to trip the CPU limit. So, I reduce the buffer size with each EAGAIN. This gets us reasonably close to the largest usable buffer size. (Perhaps there's a better way to determine what that limit is, but I don't know how.) > > + > > + pa_rtpoll_set_timer_absolute(u->rtpoll, xtime0 + pa_bytes_to_usec(buffered_bytes / 2, &u->sink->sample_spec)); > > + } else { > > + pa_rtpoll_set_timer_disabled(u->rtpoll); > > } > > Hmm, you schedule audio via timers? Is that a good idea? Perhaps not. I won't know until I test on more hardware. But, given that we have rt priority and high resolution timers on solaris, I think it is OK in theory... The reason I used a timer was to minimise CPU usage and avoid the CPU limit. Recall that getting woken up by poll is not an option for playback unfortunately. We can arrange for a signal when the FD becomes writable, but that throws out the whole buffer size concept, which acts to reduce latency. > That really only makes sense if you have to deal with large buffers and > support rewinding. I've implemented rewind support, but I'm still not sure that I have understood the concept; I take it that we "rewind" (from the point-of-view of the renderer, not the sink) so that some rendered but as yet unplayed portion of the memblock/buffers can then be rendered again? > Please keep in mind that the system clock and the sound card clock > deviate. If you use the system timers to do PCM scheduling ou might need > a pa_smoother object that is able to estimate the deviation for you. Actually, in an earlier version I did use a smoother (after reading about that in the wiki). But because of the non-monotonic sample counter (bug?) I decided that it probably wasn't worth the added complexity so I removed it. I'll put the smoother back if I can figure out the problem with the sample counter. > > > + u->frame_size = pa_frame_size(&ss); > > > > - if ((fd = open(p = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), mode | O_NONBLOCK)) < 0) > > + u->buffer_size = 16384; > > It would appear more appropriate to me if the buffer size is adjusted by > the sample spec used. Done. > One last thing: it would probably be a good idea to allocate a pa_card > object and attach the sink and the source to it. It is possible to open /dev/audio twice by loading the solaris module twice -- once for the sink (passing record=0) and once for source (passing playback=0), thus giving seperate threads/LWPs for source and sink. It might be misleading to allocate two cards in that situation? > Right now pa_cards are mostly useful for switching profiles but even if > you do not allow switching profiles on-the-fly it is of some value to > find out via the cards object which source belongs to which sink. > > Otherwise I am happy! > > Thanks for your patch! I'd be thankful if you could fix the issues > pointed out and prepare another patch on top of current git! No problem. Patch follows. It also includes a portability fix for pa_realpath and a fix for a bug in the pa_signal_new() error path that causes signal data be freed if you attempt to register the same signal twice. > I hope I answered all your questions, Your answers were very helpful, thanks. Finn > > Lennart > >
* handle failure to parse proplist in cli-command gracefullyMaarten Bosmans2009-03-311-4/+16
|
* Merge commit 'elmarco/dbus'Lennart Poettering2009-03-304-0/+613
|\
| * dbus: split dbus-util into dbus-sharedMarc-André Lureau2009-03-304-0/+613
| | | | | | | | | | modules: fix dbus-util include pulse: get dbus at context connection
* | Use pa_source_set_max_rewind_within_thread() for updating the monitor ↵Lennart Poettering2009-03-301-1/+1
| | | | | | | | source's max_rewind
* | Merge commit 'origin/master'Lennart Poettering2009-03-302-2/+2
|\ \
| * | Small fix for MacOSX compatLennart Poettering2009-03-271-1/+1
| | | | | | | | | | | | Issue originally pointed out by Igor Zubkov.
| * | fix typoLennart Poettering2009-03-271-1/+1
| |/
* | notify clients about tlength changesLennart Poettering2009-03-302-203/+209
| |
* | add pa_memblockq_apply_attr()/pa_memblockq_get_attr()Lennart Poettering2009-03-302-1/+24
| |
* | document more often the context certain functions are called inLennart Poettering2009-03-301-1/+22
| |
* | simplify latency config functions a bit and make them callable in more contextsLennart Poettering2009-03-302-60/+50
| |
* | Trigger move callback a little bit earlier so that no IO thread is runningLennart Poettering2009-03-305-17/+17
|/
* add missing initializationLennart Poettering2009-03-251-0/+1
|
* on monitor source be fine with any latency range set by the sinkLennart Poettering2009-03-251-1/+2
|
* add missing whitespaceLennart Poettering2009-03-251-1/+1
|
* copy latency flags from sink to monitor sourceLennart Poettering2009-03-251-1/+7
|
* fix misplace _ref() calls that should have been _assert_ref()Lennart Poettering2009-03-251-3/+4
|
* optionally skip initial frames in backtraceLennart Poettering2009-03-252-7/+23
|
* don't show full so path in backtraceLennart Poettering2009-03-251-3/+7
|
* add simple ref counting debugging frameworkLennart Poettering2009-03-252-6/+81
|
* trivial simplificationLennart Poettering2009-03-251-2/+1
|
* simplify things and make sure timing setters can be called in most contextsLennart Poettering2009-03-252-34/+38
|
* introduce new flag that marks sinks/sources which can adjust the latency ↵Lennart Poettering2009-03-253-15/+48
| | | | dynamically
* make pa_source_set_max_rewind() work similar to pa_sink_set_max_rewind()Lennart Poettering2009-03-252-2/+20
|
* get rid of 'default' min/max latencies, simplify things by just having ↵Lennart Poettering2009-03-253-23/+9
| | | | absolute boundaries
* Allow calling pa_{sink|source}_update_proplist() without an actual proprlistLennart Poettering2009-03-242-5/+4
|
* set request/rewind sizes only via accessor functionsLennart Poettering2009-03-242-4/+38
|
* simplify latency range by not allowing stored 'wildcard' ranges anymoreLennart Poettering2009-03-244-21/+36
|
* only decrease timer slack, never increaseLennart Poettering2009-03-241-6/+10
|
* add pa_assert_cc() for compile time assertionsLennart Poettering2009-03-231-0/+14
|
* only store card profile if flagged for thatLennart Poettering2009-03-234-6/+14
|
* add functions that modules can call whenever they now the volume changedLennart Poettering2009-03-214-1/+56
|
* add pa_hook_is_firingLennart Poettering2009-03-212-0/+8
|
* introduce pa_sink_input_get_relative_volume()Lennart Poettering2009-03-202-0/+23
|
* introduce pa_assert_fp() for fast path assertionsLennart Poettering2009-03-201-4/+16
|
* fix a commentLennart Poettering2009-03-191-1/+1
|
* deduce a proper icon for TV setsLennart Poettering2009-03-191-0/+2
|
* try more things to get a proper icon for sinks/sourcesLennart Poettering2009-03-041-1/+14
|
* print error code when suspend/resume failsLennart Poettering2009-03-041-11/+14
|
* fix handling of _suspend_all(), return first failure error codeLennart Poettering2009-03-042-4/+15
|
* make suspend state of monitor source follow the suspend state of the sink it ↵Lennart Poettering2009-03-043-0/+23
| | | | belongs to
* Don't allow suspending of monitor sources.Lennart Poettering2009-03-041-0/+3
| | | | Closes #499
* Fix a NULL pointer access when sutting down esound/simple connectionsLennart Poettering2009-03-042-0/+6
| | | | | | | If a connection is unlinked make sure the process_msg function doesn't crash when a message is received afterwards. Closes #463.
* document more closely from which context certain functions may be calledLennart Poettering2009-03-041-3/+5
|
* revive solaris moduleFinn Thain2009-03-032-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Hi All, This patch fixes the solaris audio device source and sink, and fixes some portability issues that break the build on solaris. Questions and comments welcomed. I've tested this patch only with OpenSolaris Express snv 103. Eventually I hope to be able to test a few older releases and older hardware (though it is hard to say whether there is much interest in those). This is my first brush with pulseaudio and so I read the wiki docs and some of the source code but I'm still unsure of a few things. In particular I'm wondering about rewind processing, corking and what (if anything) the module needs for those. I'm also unclear on the implications of thread_info.buffer_size, .fragment_size and .max_request, and whether my code is correct or not. This patch disables link map/library versioning unless ld is GNU ld. Another approach for solaris would be to use that linker's -M option, but I couldn't make that work (due to undefined mainloop, browse and simple symbols when linking pacat. I can post the errors if anyone is intested.) Thanks, Finn Thain
* Merge commit 'coling/lgpl21'Lennart Poettering2009-03-03134-134/+134
|\
| * Use LGPL 2.1 on all files previously using LGPL 2Colin Guthrie2009-03-03134-134/+134
| |