Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Issue 7473021: PulseAudio Sound Playback on Linux (Closed)

Created:
9 years, 5 months ago by slock
Modified:
9 years, 4 months ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, acolwell+watch_chromium.org, annacc+watch_chromium.org, ajwong+watch_chromium.org
Visibility:
Public.

Description

PulseAudio Sound Playback on Linux This is the preliminary implementation of a PulseAudio sound backend for Chrome on Linux. At first, PulseAudio's mainloop, mainloop_api, and context constructs will be used instead of the message loop system used in alsa_output. This will be stereo only at first. Also, at first, PulseAudio will be dynamically linked in media.gyp as opposed to the final solution which will dynamically link PulseAudio in runtime if it is available. BUG=32757 TEST=

Patch Set 1 #

Total comments: 19

Patch Set 2 : Opening a stream now works. #

Patch Set 3 : "The disgusting hack I mentioned to prove audio output stream with a crude sine wave" #

Patch Set 4 : "New helper methods" #

Patch Set 5 : "Audio playback works, not quite synchronized" #

Patch Set 6 : "Synchronized and clear audio to go with video." #

Patch Set 7 : "Gyp and command line flag added, pausing/stopping/restarting works" #

Total comments: 82

Patch Set 8 : "Comment response etc." #

Total comments: 2

Patch Set 9 : "media.gyp fix" #

Total comments: 4

Patch Set 10 : "Preprocessor define added #

Total comments: 22

Patch Set 11 : "Uncommented thing I forgot to uncomment" #

Total comments: 20

Patch Set 12 : "Nits and more" #

Patch Set 13 : "Added a MessageLoop so playback doesn't block the audio thread" #

Patch Set 14 : "Volume adjustment works now" #

Total comments: 56

Patch Set 15 : "Comment response vrk" #

Total comments: 24

Patch Set 16 : "New buffering scheme, per offline with vrk" #

Total comments: 4

Patch Set 17 : "New runflow per offline with vrk" #

Total comments: 10

Patch Set 18 : "vrk comments response" #

Total comments: 16

Patch Set 19 : "Comment response vrk" #

Total comments: 2

Patch Set 20 : "Final nit" #

Patch Set 21 : "alsa_output_unittest fix" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+533 lines, -15 lines) Patch
M media/audio/linux/alsa_output_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -1 line 0 comments Download
M media/audio/linux/audio_manager_linux.h View 1 2 3 4 5 6 7 3 chunks +2 lines, -3 lines 0 comments Download
M media/audio/linux/audio_manager_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +20 lines, -9 lines 0 comments Download
A media/audio/linux/pulse_output.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +130 lines, -0 lines 0 comments Download
A media/audio/linux/pulse_output.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +349 lines, -0 lines 0 comments Download
M media/base/media_switches.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 4 chunks +27 lines, -2 lines 0 comments Download

Messages

Total messages: 41 (0 generated)
slock
Just the bottom of the foundation. I'm hoping to flesh out this class and work ...
9 years, 5 months ago (2011-07-21 01:29:47 UTC) #1
sjl
Driveby style nits. http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc#newcode1 media/audio/linux/pulse_output.cc:1: #include "media/audio/linux/pulse_output.h" Copyright header needed. http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc#newcode25 ...
9 years, 5 months ago (2011-07-21 04:58:32 UTC) #2
Ami GONE FROM CHROMIUM
Drive-by. http://codereview.chromium.org/7473021/diff/1/media/media.gyp File media/media.gyp (right): http://codereview.chromium.org/7473021/diff/1/media/media.gyp#newcode231 media/media.gyp:231: '-lpulse', Pretty sure this will break on cros/arm ...
9 years, 5 months ago (2011-07-21 16:59:03 UTC) #3
slock
Thanks! http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc#newcode1 media/audio/linux/pulse_output.cc:1: #include "media/audio/linux/pulse_output.h" I was going to copy-paste that ...
9 years, 5 months ago (2011-07-21 17:10:57 UTC) #4
scherkus (not reviewing)
http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/1/media/audio/linux/pulse_output.cc#newcode29 media/audio/linux/pulse_output.cc:29: // TODO you know what's even better than TODO... ...
9 years, 5 months ago (2011-07-21 21:36:32 UTC) #5
slock
This code successfully opens a "default" stream. It does play sound too. To make sure ...
9 years, 5 months ago (2011-07-26 00:05:35 UTC) #6
awong
FYI, I'm not going to be able to look at this code soon. I can ...
9 years, 5 months ago (2011-07-26 01:23:17 UTC) #7
vrk (LEFT CHROMIUM)
On 2011/07/26 01:23:17, awong wrote: > FYI, I'm not going to be able to look ...
9 years, 5 months ago (2011-07-26 18:08:17 UTC) #8
vrk (LEFT CHROMIUM)
CL looking good so far! I will refrain from line-by-line review until you have something ...
9 years, 5 months ago (2011-07-26 18:26:34 UTC) #9
slock
On 2011/07/26 18:26:34, Victoria Kirst wrote: > CL looking good so far! > > I ...
9 years, 5 months ago (2011-07-26 18:30:36 UTC) #10
slock
This plays sound from videos now. AudioManagerLinux is hardcoded to use my new PulseAudio path, ...
9 years, 4 months ago (2011-07-29 23:03:27 UTC) #11
slock
Audio output is clear and in sync the accompanying video now. This involved a little ...
9 years, 4 months ago (2011-08-02 23:59:22 UTC) #12
vrk (LEFT CHROMIUM)
Exciting progress so far!! One general question: How is seeking supposed to work with AudioOutputStream? ...
9 years, 4 months ago (2011-08-05 15:02:26 UTC) #13
slock
A lot of smaller problems I have marked as 'Done.' were in fact washed away ...
9 years, 4 months ago (2011-08-08 20:30:15 UTC) #14
Paweł Hajdan Jr.
http://codereview.chromium.org/7473021/diff/34002/media/media.gyp File media/media.gyp (right): http://codereview.chromium.org/7473021/diff/34002/media/media.gyp#newcode242 media/media.gyp:242: ['use_pulse_audio == 1', { Have you tested this on ...
9 years, 4 months ago (2011-08-08 20:43:40 UTC) #15
slock
http://codereview.chromium.org/7473021/diff/34002/media/media.gyp File media/media.gyp (right): http://codereview.chromium.org/7473021/diff/34002/media/media.gyp#newcode242 media/media.gyp:242: ['use_pulse_audio == 1', { On 2011/08/08 20:43:40, Paweł Hajdan ...
9 years, 4 months ago (2011-08-08 22:08:48 UTC) #16
Paweł Hajdan Jr.
I think it's still broken with systems that don't have PA installed. http://codereview.chromium.org/7473021/diff/38001/media/audio/linux/audio_manager_linux.cc File media/audio/linux/audio_manager_linux.cc ...
9 years, 4 months ago (2011-08-09 16:32:50 UTC) #17
slock
http://codereview.chromium.org/7473021/diff/38001/media/audio/linux/audio_manager_linux.cc File media/audio/linux/audio_manager_linux.cc (right): http://codereview.chromium.org/7473021/diff/38001/media/audio/linux/audio_manager_linux.cc#newcode19 media/audio/linux/audio_manager_linux.cc:19: #include "media/audio/linux/pulse_output.h" On 2011/08/09 16:32:51, Paweł Hajdan Jr. wrote: ...
9 years, 4 months ago (2011-08-09 18:13:54 UTC) #18
slock
Just noticed that I forgot to uncomment something three patches ago and fixed it. Also, ...
9 years, 4 months ago (2011-08-09 23:36:38 UTC) #19
vrk (LEFT CHROMIUM)
Getting there! There's still the problem the Start() until OnMoreData() returns 0, and thus subsequent ...
9 years, 4 months ago (2011-08-10 16:34:50 UTC) #20
Sergey Ulanov
drive-by, mostly style nits. http://codereview.chromium.org/7473021/diff/44001/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/44001/media/audio/linux/pulse_output.cc#newcode46 media/audio/linux/pulse_output.cc:46: switch(state) { nit: space after ...
9 years, 4 months ago (2011-08-10 17:36:32 UTC) #21
scherkus (not reviewing)
driveby nits http://codereview.chromium.org/7473021/diff/44001/media/audio/linux/audio_manager_linux.cc File media/audio/linux/audio_manager_linux.cc (right): http://codereview.chromium.org/7473021/diff/44001/media/audio/linux/audio_manager_linux.cc#newcode114 media/audio/linux/audio_manager_linux.cc:114: switches::kAlsaOutputDevice)) { nit: this should get indented ...
9 years, 4 months ago (2011-08-10 19:55:30 UTC) #22
vrk (LEFT CHROMIUM)
For people in the audience: Talked to some of you offline and slock will update ...
9 years, 4 months ago (2011-08-10 22:33:12 UTC) #23
slock
The blocking-Start() fix Victoria mentioned will be the next patch, wanted to get all the ...
9 years, 4 months ago (2011-08-10 22:41:03 UTC) #24
Paweł Hajdan Jr.
Code I commented earlier LGTM, thank you.
9 years, 4 months ago (2011-08-10 23:18:31 UTC) #25
slock
This is a code review ping. I'd love to get this checked in soon (today?) ...
9 years, 4 months ago (2011-08-11 17:06:17 UTC) #26
slock
Sorry about that general ping, what I should have done is ask ask ajwong and ...
9 years, 4 months ago (2011-08-11 17:47:52 UTC) #27
awong
deferring to vrk. On Thu, Aug 11, 2011 at 10:47 AM, <slock@chromium.org> wrote: > Sorry ...
9 years, 4 months ago (2011-08-11 17:49:27 UTC) #28
vrk (LEFT CHROMIUM)
Very close now... these comments are mostly nits but enough to make me withhold the ...
9 years, 4 months ago (2011-08-12 23:16:51 UTC) #29
slock
http://codereview.chromium.org/7473021/diff/53009/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/53009/media/audio/linux/pulse_output.cc#newcode43 media/audio/linux/pulse_output.cc:43: void PulseAudioOutputStream::MainloopIterateTask() { On 2011/08/12 23:16:51, Victoria Kirst wrote: ...
9 years, 4 months ago (2011-08-15 20:35:06 UTC) #30
vrk (LEFT CHROMIUM)
Buffering is looking better! As in our offline conversation, next is to make sure the ...
9 years, 4 months ago (2011-08-16 18:19:24 UTC) #31
slock
This a major organizational change, but it should fix the blocking issue by using the ...
9 years, 4 months ago (2011-08-16 23:18:58 UTC) #32
vrk (LEFT CHROMIUM)
A few more comments... Also, it looks like you didn't address my comments from the ...
9 years, 4 months ago (2011-08-17 18:59:23 UTC) #33
slock
PTYAL. http://codereview.chromium.org/7473021/diff/57002/media/audio/linux/audio_manager_linux.cc File media/audio/linux/audio_manager_linux.cc (right): http://codereview.chromium.org/7473021/diff/57002/media/audio/linux/audio_manager_linux.cc#newcode24 media/audio/linux/audio_manager_linux.cc:24: On 2011/08/16 18:19:24, Victoria Kirst wrote: > delete ...
9 years, 4 months ago (2011-08-17 21:43:13 UTC) #34
vrk (LEFT CHROMIUM)
just about all nits this round! http://codereview.chromium.org/7473021/diff/71003/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/71003/media/audio/linux/pulse_output.cc#newcode9 media/audio/linux/pulse_output.cc:9: #include "media/audio/audio_parameters.h" nit: ...
9 years, 4 months ago (2011-08-18 18:22:22 UTC) #35
slock
Iterate! Iterate! Iterate! http://codereview.chromium.org/7473021/diff/71003/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/71003/media/audio/linux/pulse_output.cc#newcode9 media/audio/linux/pulse_output.cc:9: #include "media/audio/audio_parameters.h" On 2011/08/18 18:22:22, Victoria ...
9 years, 4 months ago (2011-08-18 18:54:16 UTC) #36
vrk (LEFT CHROMIUM)
LGTM!!! with one nit :) http://codereview.chromium.org/7473021/diff/75009/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/75009/media/audio/linux/pulse_output.cc#newcode209 media/audio/linux/pulse_output.cc:209: if (!write_callback_handled_ && !stream_stopped_) ...
9 years, 4 months ago (2011-08-18 20:00:47 UTC) #37
slock
Committing now, thanks everyone! http://codereview.chromium.org/7473021/diff/75009/media/audio/linux/pulse_output.cc File media/audio/linux/pulse_output.cc (right): http://codereview.chromium.org/7473021/diff/75009/media/audio/linux/pulse_output.cc#newcode209 media/audio/linux/pulse_output.cc:209: if (!write_callback_handled_ && !stream_stopped_) { ...
9 years, 4 months ago (2011-08-18 20:12:01 UTC) #38
slock
This broke a unittest, lets try again.
9 years, 4 months ago (2011-08-18 22:06:45 UTC) #39
vrk (LEFT CHROMIUM)
Fix LGTM; try again!
9 years, 4 months ago (2011-08-18 22:27:32 UTC) #40
commit-bot: I haz the power
9 years, 4 months ago (2011-08-19 01:47:21 UTC) #41
Commit queue had an internal error.
Something went really wrong, probably a crash, a hickup or
simply the monkeys went out for diner.
The relevant dude was pinged already.

Powered by Google App Engine
This is Rietveld 408576698