After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 304200 - Ability to choose ALSA device
Ability to choose ALSA device
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
0.8.8
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on: 329112
Blocks:
 
 
Reported: 2005-05-14 20:05 UTC by Alexander “weej” Jones
Modified: 2006-08-23 19:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander “weej” Jones 2005-05-14 20:05:23 UTC
Currently the only media players I can find that let me specifically select the
ALSA device I want to use are XMMS and Beep-Media-Player.

Rhythmbox should have an option that lets you set the ALSA device to use. Please
bear in mind that I have an Audiophile 2496 as my secondary sound card solely
for music and video, and it is a 24-bit interface so I have to use plug to
define a custom device name, "hifi". Beep-Media-Player uses a combo box to allow
you to select ALSA device but doesn't list custom ones. The important bit is
that it lets you type your own.

Many thanks.

Alex Jones
Comment 1 Sebastien Bacher 2005-05-14 21:02:11 UTC
rhythmbox uses the gstreamer configuration. You can use gstreamer-properties to
select alsa.
Comment 2 Alexander “weej” Jones 2005-05-23 19:59:08 UTC
No. I can choose a *DEFAULT* device through gstreamer-properties. You should be
able to either use the default device or a specific one *just for rhythmbox*.

I want to hear Rhythmbox out of my Hi-Fi, but this does not mean I want to hear
all of GNOME's bells and whistles out of my Hi-Fi!

Thanks
Comment 3 Alexander “weej” Jones 2005-05-23 20:05:16 UTC
/player/rb-player-gst.c:540

	/* Output sink */
	mp->priv->sink = gst_gconf_get_default_audio_sink ();

Some kind of config option to check whether to use the default audio sink or
not? Beep-Media-Player is really pissing me off!
Comment 4 Alexander “weej” Jones 2005-06-14 17:46:57 UTC
Is anyone hearing me on this? Even Microsoft Windows Media Player lets you
explicitly choose audio devices that override the system-wide defaults! It's a
useful feature, honest! :(
Comment 5 John Richard Moser 2005-12-29 03:32:34 UTC
gst_gconf_get_default_audio_sink (); // ask gstreamer to check the default audio sink for us so we can figure out where the noise is going.
Comment 6 Peteris Krisjanis 2006-04-16 14:15:00 UTC
(In reply to comment #4)
> Is anyone hearing me on this? Even Microsoft Windows Media Player lets you
> explicitly choose audio devices that override the system-wide defaults! It's a
> useful feature, honest! :(

As this bug still hangs open, I would note that lot of things has changed and now GNOME provides choosing sound card in it's Sound caplet in Control Center menu. Sure, it could be not good enough for people who would like to choose different DE, but it is still progress.

It is good enough to close this bug?
Comment 7 Alexander “weej” Jones 2006-04-16 14:52:10 UTC
Absolutely not I'm afraid. Like I said, I don't want to hear bells and whistles out of my hi-fi.

Secondly, the ability to simply "choose a card" is not enough - ALSA fails to open my card in ANY configuration without a plug. I think it has something to do with Endianness. Sucks.

I think what is needed is an extension to ESD/esdsink. ESD could have a mixer/routing interface that lets you control volume levels of each open channel independently, and also specify a hardware interface to use. This could even be built into the volume control applet. esdsink could pass an application name or ID to the daemon and this could be used in the mixer UI. This would be the absolute ideal situation.

Note that this is not dissimilar to how Mac OS does it, and some of Jimmac's mock-ups for NLD10 suggested the idea.

So, Is ESD something we want to be phasing out or would it be worth working on this? A lot of people have a very strong opposition to it. I think it has great potential to be a useful abstraction layer if the lag was sorted out.
Comment 8 Alexander “weej” Jones 2006-04-16 15:14:19 UTC
OK I drew this up on the back of an envelope, (my) Dia (ability) still sucks, so here it is in written form...

Assuming: one ESD has the ability to route audio to many devices.

Applications simply need to open an ESDsink with two parameters, an ID and a name. For Rhythmbox, that could be "Rhythmbox" and "org.rhythmbox".

ESDsink needs to open a connection to ESD and pass the two parameters.

ESD creates a channel for the audio and mixes it internally to a backend (ALSA/OSS), based on the routing settings and channel levels the user has set.

ALSA plays my tunes through my phat speakers.

Alex is a happy man.

Does this sound reasonable? I might try and take this up but I am bound to do a crappy job. Let me know ASAP if I am insane/disillusioned.
Comment 9 Jonathan Matthew 2006-04-17 08:01:58 UTC
I don't think doing this through ESD is a good idea.  Changing the ESD protocol sounds painful, and discussions on ESD are almost exclusively focused on getting rid of it.

Related:
https://wiki.ubuntu.com/GstreamerAudioBackend
http://live.gnome.org/GStreamer/esd

One possible approach would be to have RBPlayer emit a 'create-sink' signal, and if a handler returns a sink element, use that rather than creating a gconfaudiosink.  It would then be possible (more or less) to implement a plugin that created an alsasink element for a specific device in response to that signal.
Comment 10 James "Doc" Livingston 2006-04-17 08:21:25 UTC
Alex: What you're talking about sounds very much like what I think JACK (http://jackit.sourceforge.net/) is. I don't think GStreamer 0.10 has work JACK support yet though.
Comment 11 Alexander “weej” Jones 2006-06-04 23:14:48 UTC
What about Polypaudio?

Also, Bug 342950 might be of some interest to abstract the functionality. How's that for a design?
Comment 12 Bastien Nocera 2006-06-05 07:08:10 UTC
How about just following the GNOME setting in the control-center (in GNOME 2.15)
Comment 13 Alexander “weej” Jones 2006-06-05 07:34:23 UTC
Hi Bastien

Please see comment #7!
Comment 14 Bastien Nocera 2006-06-05 08:11:15 UTC
What about comment #7?
Nobody in their right mind would want to use esound for anything, frankly. Thecode to select the output sink should follow the preferences in the control-center.
Comment 15 Alexander “weej” Jones 2006-06-05 17:52:55 UTC
Hi Bastien

It, inherently, already does, but purely because the code in the Control Centre preferences modifies your ~/.asoundrc.asoundconf. As far as I can tell, it doesn't even bother GStreamer about it.

This, however, does not solve the problem! I have two sound cards that I happily use in Windows for different roles. I want Rhythmbox to come out of my hifi by some means or another, that's all! A short-term solution would be a preference that lets me select a partial pipeline. I could just bash in "alsasink device=hw:1" and it would be happy days.

Thanks
Comment 16 Bastien Nocera 2006-06-05 18:16:53 UTC
No, the code in the control-center will change the default audio sink (replacing gstreamer-properties) to the halsoundsink (or whatever it's called), and tell this sink which device to use. It doesn't use the alsa configuration at all (unlike the default soundcard setup in Fedora's system-config-soundcard).
Comment 17 Alexander “weej” Jones 2006-06-05 19:58:11 UTC
It appears to run asoundconf in Ubuntu. Indeed, this is the reason why it affects non-gstreamer apps, too.

I'll be honest with you and say that I actually have no idea what halsoundsink is or does!
Comment 18 Bastien Nocera 2006-06-05 20:06:14 UTC
Unless you have the a 2.15.x control-center, you're not using the sound capplet. See the linked bug.
Comment 19 Alexander “weej” Jones 2006-06-05 20:34:57 UTC
Thanks for the pointer to the other bug.

I really am running Ubuntu 6.06, though!
Comment 20 Alexander “weej” Jones 2006-08-23 19:54:41 UTC
Probably solved in Pulse Audio, so I'm gonna close this one.

You're freeeee my little bug friend, freeeeeeee!