summaryrefslogtreecommitdiffstats
path: root/src/modules/module-solaris.c
Commit message (Collapse)AuthorAgeFilesLines
* perl -p -i -e 's/pa_rtclock_usec/pa_rtclock_now/g' `find . -name '*.[ch]'`Marc-André Lureau2009-06-191-1/+1
|
* modules: add {sink|source|card}_properties argument to all modulesLennart Poettering2009-05-281-2/+18
|
* solaris: 0.9.15 solaris module build failureFinn Thain2009-04-181-1/+1
| | | | | | | | | | | | | | | | Lennart wrote, > > Hmm, yes. As it seems I broke the build for non-dbus builds. Well, you also broke the solaris module between 0.9.15-test8 and 0.9.15. Have you considered release candidates? Patch follows. It would be nice if API changes could be made without breaking things when the effort to avoid that is trivial. Finn
* revive solaris moduleFinn Thain2009-03-311-44/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 > >
* set request/rewind sizes only via accessor functionsLennart Poettering2009-03-241-2/+2
|
* pa_xnew cannot fail -- that's what the x is in the nameLennart Poettering2009-03-041-3/+1
|
* revive solaris moduleFinn Thain2009-03-031-333/+624
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use LGPL 2.1 on all files previously using LGPL 2Colin Guthrie2009-03-031-1/+1
|
* get rid of svn $ keywordsLennart Poettering2008-06-181-2/+0
|
* we don't want to include assert.h anymoreLennart Poettering2007-10-291-1/+0
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1986 fefdeb5f-60dc-0310-8127-8f9354f1896f
* merge 'lennart' branch back into trunk.Lennart Poettering2007-10-281-301/+389
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1971 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Add copyright notices to all relevant files. (based on svn log)Pierre Ossman2007-02-131-0/+3
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1426 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Huge trailing whitespace cleanup. Let's keep the tree pure from here on,Pierre Ossman2007-01-041-18/+18
| | | | | | | mmmkay? git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Make the recording a bit more chunky so that we can fit in the pool and havePierre Ossman2006-08-231-1/+13
| | | | | | | efficient blocks. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1327 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Remove silence generation in solaris module.Pierre Ossman2006-08-221-29/+26
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1326 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Fix missing header for timeval helpers.Pierre Ossman2006-08-221-0/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1311 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Fix calls to pa_memblock_new().Pierre Ossman2006-08-221-2/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1310 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Add header for pa_cstrerror().Pierre Ossman2006-08-221-0/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1309 fefdeb5f-60dc-0310-8127-8f9354f1896f
* remove all occurences of Lennart Poettering2006-08-181-18/+18
| | | | | | | | | | | | pa_logXXX(__FILE__": and replace them by pa_logXXX(" git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1272 fefdeb5f-60dc-0310-8127-8f9354f1896f
* make use of pa_sink_used_by()/pa_source_used_by() wherever applicableLennart Poettering2006-08-121-3/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1227 fefdeb5f-60dc-0310-8127-8f9354f1896f
* don't set the sink/source descriptions manually, use the new functions ↵Lennart Poettering2006-08-111-2/+5
| | | | | | pa_{sink,source}_set_description() instead git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1205 fefdeb5f-60dc-0310-8127-8f9354f1896f
* set is_hardware flag for a few hw pluginsLennart Poettering2006-07-161-0/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1092 fefdeb5f-60dc-0310-8127-8f9354f1896f
* big s/polyp/pulse/gLennart Poettering2006-06-191-16/+16
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1033 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Wrap strerror() in a function that makes it thread safe and converts thePierre Ossman2006-05-221-7/+8
| | | | | | | output to UTF-8. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@945 fefdeb5f-60dc-0310-8127-8f9354f1896f
* split polypcore/util.[ch] into polypcore/core-util.[ch] and polyp/util.[ch]Lennart Poettering2006-05-171-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@917 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Move xmalloc to the public side (libpolyp).Pierre Ossman2006-05-171-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@908 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Use default channel map for Solaris module. There doesn't seem to be a standardPierre Ossman2006-05-171-1/+1
| | | | | | | for > 2 channels, so we'll have to rely on the user. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@889 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Channel map argument support for solaris.Pierre Ossman2006-04-271-4/+15
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@815 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Tweaks for the solaris module. The sound system requires complete framesPierre Ossman2006-04-191-11/+20
| | | | | | | | to be written. Also, the sample counter can magically go backwards sometimes, causing havoc with our buffer handling. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@762 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Sun's documentation about SIGPOLL on EOF:s is wrong, so use a timer basedPierre Ossman2006-04-191-17/+31
| | | | | | | solution instead. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@761 fefdeb5f-60dc-0310-8127-8f9354f1896f
* We have both sink and source in this module.Pierre Ossman2006-02-271-8/+23
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@613 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Catch volume update events.Pierre Ossman2006-02-271-1/+13
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@612 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Call correct function.Pierre Ossman2006-02-241-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@595 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Make local function static.Pierre Ossman2006-02-241-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@594 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Hardware sink mute support.Pierre Ossman2006-02-241-1/+34
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@593 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Hardware source volume support.Pierre Ossman2006-02-231-0/+38
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@584 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Wrong function name.Pierre Ossman2006-02-231-1/+1
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@580 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Make sure hardware volume gets a correct initial value.Pierre Ossman2006-02-231-0/+4
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@579 fefdeb5f-60dc-0310-8127-8f9354f1896f
* change pa_log() and friends to not require a trailing \n on all logged stringsLennart Poettering2006-02-231-15/+15
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@574 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Hardware volume support for Solaris.Pierre Ossman2006-02-201-0/+36
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@524 fefdeb5f-60dc-0310-8127-8f9354f1896f
* Reorganised the source tree. We now have src/ with a couple of subdirs:Pierre Ossman2006-02-161-0/+488
* daemon/ - Contains the files specific to the polypaudio daemon. * modules/ - All loadable modules. * polyp/ - Files that are part of the public, application interface or are only used in libpolyp. * polypcore/ - All other shared files. * tests/ - Test programs. * utils/ - Utility programs. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@487 fefdeb5f-60dc-0310-8127-8f9354f1896f