summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* properly account for seeks in the requested_bytes counterLennart Poettering2009-04-0111-50/+55
|
* use machine id instead of hostname to identify local connectionsLennart Poettering2009-04-013-17/+23
|
* load bt discover module only when installedLennart Poettering2009-04-011-2/+2
|
* pass destination source/sink when moving streams so that we can access themLennart Poettering2009-04-015-20/+24
|
* don't access i->sink if it is not setLennart Poettering2009-04-012-6/+10
|
* increase timing update interval exponentiallyLennart Poettering2009-04-012-4/+14
|
* in verbose mode log buffer attr changesLennart Poettering2009-04-011-0/+8
|
* add buffer_attr callback stuff to exported symbol listLennart Poettering2009-04-011-0/+1
|
* fix buffer defaultsLennart Poettering2009-03-311-3/+3
|
* be a bit more verbose about max_request changesLennart Poettering2009-03-311-5/+14
|
* Log underrunsLennart Poettering2009-03-311-1/+1
|
* handle buffer_attr changed messages properlyLennart Poettering2009-03-311-1/+49
|
* update command name tableLennart Poettering2009-03-311-1/+14
|
* fix an error where a signal was accidently freed when it is tried to ↵Lennart Poettering2009-03-311-3/+2
| | | | register it twice
* revive solaris moduleFinn Thain2009-03-312-54/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 > >
* Specifying ALSA mixer controlKyle Cronan2009-03-316-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | On Fri, Mar 27, 2009 at 7:21 AM, Lennart Poettering <lennart@poettering.net> wrote: >> I tried installing the latest git sources on my Ubuntu Jaunty box but >> it just broke sound in all my applications.  For my own purposes, I'm >> going to need to start with the Ubuntu-patched 0.9.14.  However, if >> you are willing to accept this patch I will forward port it so that it >> applies to the latest sources.  It's a completely harmless change, so >> why not apply it? > > Yes, I am happy to apply it. Could you please update it for current git? > Great. An updated patch is attached. For symmetry, I added this option to the alsa source module as well. The Ubuntu folks have customized pulse so much that it is difficult for me to get this version working on my system. For this patch I have only made sure that it compiles. But it does pretty much the same thing as the one for 0.9.14, which is working great for me. Thanks, Kyle
* fix some typos in doxygen commentsMaarten Bosmans2009-03-311-7/+7
| | | | | | these bugged me for a while now. Maarten
* handle failure to parse proplist in cli-command gracefullyMaarten Bosmans2009-03-311-4/+16
|
* explain ff7033c11d9248fe837204b03c8397231dc511feLennart Poettering2009-03-311-0/+3
|
* Revert "make sure we always read in all properties"Lennart Poettering2009-03-311-9/+0
| | | | | | | This reverts commit 1c8f968282208be391f062c1656d85e2ba5078ac. Turns out doing this is racy. The appropriate fix seems to be 38825d79123678bf0c5d156aaea4bedb888a7fcd
* allow nofail mode only when no server string was specifiedLennart Poettering2009-03-302-4/+6
|
* minor cleanupsLennart Poettering2009-03-301-4/+8
|
* take org.pulseaudio.Server instead of org.pulseaudio to match the interface ↵Lennart Poettering2009-03-302-5/+5
| | | | name already used in the HAL module
* fix compiler warningLennart Poettering2009-03-301-1/+1
|
* make sure we never access an invalid pa_bluetooth_device objectLennart Poettering2009-03-301-17/+19
|
* make sure we always read in all propertiesLennart Poettering2009-03-301-0/+9
|
* get rid of old 'Connected' property parsing and make sure we don't execute ↵Lennart Poettering2009-03-301-11/+0
| | | | two case branches
* introduce typedef for pa_bt_audio_state and use it everywhereLennart Poettering2009-03-302-11/+10
|
* Merge commit 'elmarco/bluetooth-fixes'Lennart Poettering2009-03-308-131/+275
|\
| * bluetooth: use new audio State propertiesMarc-André Lureau2009-03-274-49/+112
| |
| * bluetooth: GetProperties after profile UUID show upMarc-André Lureau2009-03-272-0/+26
| |
| * bluetooth: remove racy GetProperties to check profileMarc-André Lureau2009-03-271-6/+0
| |
| * bluetooth: don't access outside array rangeMarc-André Lureau2009-03-271-2/+4
| |
| * bluetooth: fail when switching on non-connected profileMarc-André Lureau2009-03-271-3/+12
| |
| * bluetooth: connected can be -1, check > 0Marc-André Lureau2009-03-271-1/+1
| |
| * Do not reconfigure capabilities.Luiz Augusto von Dentz2009-03-261-0/+3
| |
| * Query and make use of the current configuration.Luiz Augusto von Dentz2009-03-261-4/+16
| |
| * Update ipc to match new message headers introduced on BlueZ 4.34.Luiz Augusto von Dentz2009-03-263-36/+84
| |
| * Fix misuse of 'frame.joint' when estimating the frame length.Luiz Augusto von Dentz2009-03-261-17/+12
| | | | | | | | | | 'frame.joint' is not the flag for joint stereo mode, it is a set of bits which show for which subbands channels joining was actually used.
| * Maintain the original code style for sbc.Luiz Augusto von Dentz2009-03-262-16/+8
| |
* | Merge commit 'elmarco/dbus'Lennart Poettering2009-03-3019-130/+379
|\ \
| * | gtk-test: updated to use PA_CONTEXT_NOAUTOSPAWN|PA_CONTEXT_NOFAILMarc-André Lureau2009-03-301-10/+31
| | |
| * | pulse: client connect to dbusMarc-André Lureau2009-03-304-6/+90
| | |
| * | daemon: take org.pulseaudioMarc-André Lureau2009-03-301-0/+32
| | |
| * | dbus: split dbus-util into dbus-sharedMarc-André Lureau2009-03-3013-114/+226
| |/ | | | | | | | | 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 'coling/master'Lennart Poettering2009-03-301-1/+10
|\ \
| * | raop: Add call to pa_sink_set_max_request()Colin Guthrie2009-03-251-1/+10
| | | | | | | | | | | | This is just a copy from the ESD version which is a little crude, but will do for now.
* | | 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.