Commit graph

2987 commits

Author SHA1 Message Date
Colin Guthrie
ded09d1f9b Implement hardware volume control.
This allows near instant change of volume when controlling the hardware but the stream volume still suffers from a sizable delay.
2008-10-08 20:36:24 +01:00
Colin Guthrie
e543e04ca7 Implement a set volume function to expose this capability to higher layers 2008-10-08 20:36:24 +01:00
Colin Guthrie
36f2aad5f0 Use the new pa_namereg_make_valid_name() function. 2008-10-08 20:36:24 +01:00
Colin Guthrie
0ff75aea05 Add Lennart back in to Copyright as I copied these files from his originals and was a bit overzealous in changing things ;)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2520 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:35:47 +01:00
Colin Guthrie
729bbaf884 Automatic discovery of airtunes devices via Bonjour/Avahi.
This also does some minor reordering in the Makefile.am
Refs #69

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2519 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:35:47 +01:00
Colin Guthrie
d997420791 Minor correction of help text
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2518 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:33:48 +01:00
Colin Guthrie
15e8420a25 Still send silence when we are not doing anything else, but also flush the buffers correctly upon recovery from suspension.
Close the RTP socket correctly after passing messages about.
When not sending silence, the RTSP socket will be closed after some period of inactivity. I'm not sure why this is.
Sending silence keeps things working and with the flushes after suspension we now get a better latency. As this relies on the auto-suspend feature, it's not exactly ideal.
Typical latencies are currently about 3s which makes it more or less usuable for listening to music.
If the connection is disconnected, it will reconnect but I've found that the second connection is silent. Hopefully the silence will prevent the first connection dropping.
Refs #69

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2504 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
c49be7891f Add some new public API functions to connect and flush.
This allows us to reconnect upon disconnection but this has thus far proved unreliable.
We no longer close the socket. We leave this to the module thread to do the closing.
We can also flush the remote buffer now.
Refs #69

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2503 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
d86fc75e0c Change the API of the RTSP client a bit.
* Store the mainloop, hostname and port internally on construction
* This should allow use to easily reconnect if disconnected although this has thus far proved unreliable.
The changes look like more than they are due to moving a function around.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2502 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
19dcb529ad Remove unneeded headers accidentially added in r2500.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2501 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
5f527dc479 Add seq and rtptime params to record/flush with a view to using these for timing and device suspension
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2500 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
651da7d095 Minor update to copywrite (I still plan to replace this completely but in the mean time....)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2499 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
7f0cf0c9ad Fix up a couple of values related to encoding overhead.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2497 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
13bc075875 A few related changes:
* Change the encode_sample routine to simply return normal memchunks allocated from the mempool.
* unref the memchunks returned from encode_sample when we are done with them.
* Create an encoded 'silence' sample and play this at all times to prevent hangup and to 'hog' the airtunes device

This now works and can be used as a regular sink albeit with a constant latency of about 8 seconds :s

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2485 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:09 +01:00
Colin Guthrie
b93e9e80ec Keep track of the memblock pointer internally and do not rely on subsequent calls to pass it back in for unref'ing
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2484 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
8108121fa7 Set forgotten keyword property
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2483 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
6dc5e07977 Set the send buffer size to prevent rendering silence in amongst our good data (this should be more sophisticated but that can wait for a glitch-free port)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2482 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
6c1dd6e54b Move the encoding loop around a bit such that it does not grab the data and keep it for the next loop iteration.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2481 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
3767cdb6d1 Do tidy up on disconnection.
Only clear IO related stuff if this free() was triggered deliberatly (i.e. not by server side disconnect)

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2411 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
9216684691 Do not prefix internal function rtsp_exec.
Change port to be 16 bits
Do not free stuff on closure as this happens further up the stack.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2410 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
eca94fee59 Don't try to free stack variables.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2409 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
be73d378f5 unref the raw data memblock before requesting more data.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2408 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
cb8c5a925f Some misc fixes. consts, base64 optimisation (not that it will be with us long anyway), and c comments
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2407 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
4b7b7b15d7 Fix up IPv6 address format to enclose it in []
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2406 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
d195d06da7 Change suggested by Lennart. Do not return a memchunk, instead pass in the pointer.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2405 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
e00127fe24 Various changes suggested by Lennart.
Store the core* rather than just the mainloop as we can reuse the mempool without passing it in as an argument.
const'ify and deconst'ify some vars

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2404 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
ec9a618768 Listen to the on_close callback. This still causes asserts in the mainloop, so this is not a complete solution
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2403 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
899492c315 Add a new callback structure to propigate when the RTSP connection dies
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2402 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:08 +01:00
Colin Guthrie
5eecfa2e3f Move the ownership of the encoded data memchunk into the raop_client.
This does not seem to fix the pool full messages so I'll have to try and suss that out.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2400 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
4dd318519f Do not assert on NULL values of s. This means the connection was closed. This change somehow kills the mainloop with an assert, so I need to sort that out.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2399 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
d51f5944b7 A very rough first version of the sink.
I can actually play music to my airport now (woot).
Still very rough round the edges and I need to handle disconnects etc. but it's all good progress :)

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2398 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
264a1c2ffc Add more libraries to librtp now that it's doing a lot more.
This currently hacks in -lssl rather than writing a configure hook to detect it as I want to replace this with nss before official release.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2397 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
f97c5debcc Properly duplicate the hostname passed in on connect.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2396 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
1fb046536a Combine pa_raop_client_new and pa_raop_client_connect (no point in having them separate)
Convert the iochannel to an fd and do not call a pa_iochannel_cb_t callback but rather trigger the callback on connection and pass the fd.
Change pa_raop_client_send_sample to pa_raop_client_encode_sample and work with memchunks.
Fix a subtle size bug in the bit writer that techincally isn't triggered in normal operation.
Clean up the _free function to actually free stuff.
Do the actual ALAC encoding.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2394 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
41e31ab204 Rename rtsp.{c,h} to rtsp_client.{c,h}.
Renate pa_rtsp_context to pa_rtsp_client.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2376 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
e596f42f39 Wrap the io_callback to ensure that all data is written before asking for more.
Fix the length type for send_sample (restrict to 16bit value)

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2374 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
6510d97315 Use a more stateful response parser.
This makes things fully asyncronous.
Some of the continuation headerlist stuff could be moved to headerlist for neatness, but this is OK for now.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2373 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
22e299ad3e Add a pa_iochannel callback for when the RAOP connection connects.
Properly handle the sequence of events that establish a connection.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2369 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
8fb58e3a90 Add a function for packing bits into a byte buffer. This will be needed when encoding the audio data in ALAC format.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2368 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
66cf1d1f66 Some minor tidyup to remove code now in raop client. Still nowhere near functional.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2367 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:07 +01:00
Colin Guthrie
20478a4544 Add a skeleton raop client which builds on the rtsp client.
It still requires a socket client and callback system to be added before it will be functional.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2366 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
d423605bd9 Move closer to an asynchronous structure (still some parsing code to be converted).
Move type definition into .c file to keep it private
Add more utility functions to add/remove headers and return the serverport now the structure is private.
This commit will break the test application but I will fix that in due course

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2365 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
a0d3582fb1 Trivial change to allocate memory using pulse methods.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2364 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
a08d733fd1 Fix svn properties and some minor indentation
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2363 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
27ed970adf Convert the return values to fit with the rest of pulse 0 == success, < 0 == failure
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2362 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
405cf720dc Convert to using pa_socket_client rather than using blocking IO.
This change requires a reference to the mainloop api be passed during initial connection.
In addition, the passing in of the session id during connect has been deprecated. A new function pa_rtsp_set_url has been added to allow the URL to be set by external code. The concept of sid is something specific to raop, not to the rtsp client.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2360 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
ce9a41ef06 Use _free rather than _destroy so as not to mix naming conventions.
Convert C++ comments to C.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2349 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
91edf9eaca Use pa_sprintf_malloc to do simple concatenation rather than using the higher overhead of pa_strbuf
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2348 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
6570620cc3 Start the raop sink. It's based on pipe sink and isn't anywhere near finished. It does however compile.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2335 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00
Colin Guthrie
fef102e35a Add a simple base64 library that will be used by the sink
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2334 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-10-08 20:32:06 +01:00