Discussion:
[emms-help] Multiple sound cards / volume change
Bob Newell
2017-10-07 01:14:21 UTC
Permalink
Aloha,

When I got an Asus laptop I ran into trouble with volume changes from
the keyboard. To make a long story short it seems emms-volume-amixer.el
assumes the card for Master volume is 0. But it turned out to be 1 on
this laptop. At least, the call-process to "amixer" doesn't include the
"-c" option which will default the card to 0.

I have fixed this with a rewrite of emms-volume-amixer.el, which I've
attached. I apologize that this is a quick and dirty solution, but I've
not seen this problem mentioned anywhere, and maybe it can get properly
fixed in a future release.

Mahalo,
--
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *
Bob Newell
2017-10-07 01:15:02 UTC
Permalink
Aloha,

When I got an Asus laptop I ran into trouble with volume changes from
the keyboard. To make a long story short it seems emms-volume-amixer.el
assumes the card for Master volume is 0. But it turned out to be 1 on
this laptop. At least, the call-process to "amixer" doesn't include the
"-c" option which will default the card to 0.

I have fixed this with a rewrite of emms-volume-amixer.el, which I've
attached. I apologize that this is a quick and dirty solution, but I've
not seen this problem mentioned anywhere, and maybe it can get properly
fixed in a future release.

Mahalo,
--
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *
Yoni Rabkin
2017-10-07 23:40:17 UTC
Permalink
Post by Bob Newell
Aloha,
When I got an Asus laptop I ran into trouble with volume changes from
the keyboard. To make a long story short it seems emms-volume-amixer.el
assumes the card for Master volume is 0. But it turned out to be 1 on
this laptop. At least, the call-process to "amixer" doesn't include the
"-c" option which will default the card to 0.
I have fixed this with a rewrite of emms-volume-amixer.el
I'm not sure why the rewrite. Why not add a configurable -c option to
the `call-process' in `emms-volume-amixer-change'?
--
"Cut your own wood and it will warm you twice"
Bob Newell
2017-10-08 00:24:19 UTC
Permalink
Post by Yoni Rabkin
I'm not sure why the rewrite. Why not add a configurable -c option to
the `call-process' in `emms-volume-amixer-change'?
The issue for me was at least at first not knowing the number of the
Master card. So I added code to auto-detect this. A configurable -c
option would require, I think, advance knowledge of which card is
active, and would assume that the number never changes (hard to see why
it would without a hardware change, though).

Of course, a full rewrite isn't necessary, as you point out. I just
wanted to get it to work :)
--
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *
Yoni Rabkin
2017-10-08 13:26:43 UTC
Permalink
Post by Bob Newell
Post by Yoni Rabkin
I'm not sure why the rewrite. Why not add a configurable -c option to
the `call-process' in `emms-volume-amixer-change'?
The issue for me was at least at first not knowing the number of the
Master card. So I added code to auto-detect this. A configurable -c
option would require, I think, advance knowledge of which card is
active, and would assume that the number never changes (hard to see why
it would without a hardware change, though).
This approach wouldn't cover multiple active cards; just the first
active card (not relevant in multi-card setups like mine for instance.)
Post by Bob Newell
Of course, a full rewrite isn't necessary, as you point out. I just
wanted to get it to work :)
Yes, the rewrite isn't needed.

We should, however, definitely add the choice-of-card option to the
customization options. Do you feel like writing that patch? No problem
if you don't, just say so and I'll do it.

In any case, thank you for bringing up this issue.
--
"Cut your own wood and it will warm you twice"
Yoni Rabkin
2017-10-11 19:01:19 UTC
Permalink
Post by Yoni Rabkin
We should, however, definitely add the choice-of-card option to the
customization options. Do you feel like writing that patch? No problem
if you don't, just say so and I'll do it.
I would rather let you do it, not because I don't want to, but because
my, um, "coding style" is not the best.
You're right that in doing auto-detection I would only find the first
active sound card. I am not sure how that could be handled, if indeed it
should be handled. That said, I found auto-detection valuable because I
would have had to guess until I got it right (though that wouldn't have
taken long).
However, since this issue hasn't been brought up before, over a span of at
least 10 years, it likely doesn't affect a lot of users.
Thank you for listening and for your attention to this issue.
I checked on my machine and I have cards with ids: 0, 1, and 29 (go
figure).

I've just pushed out to the git repo a patch which adds a customization
option so that the card id number can be chosen.
--
"Cut your own wood and it will warm you twice"
Petteri Hintsanen
2017-11-07 20:56:49 UTC
Permalink
Post by Bob Newell
When I got an Asus laptop I ran into trouble with volume changes from
the keyboard. To make a long story short it seems emms-volume-amixer.el
assumes the card for Master volume is 0. But it turned out to be 1 on
this laptop. At least, the call-process to "amixer" doesn't include the
"-c" option which will default the card to 0.
It sounds somewhat peculiar to me that you have to configure a separate
card for amixer but not for the player. Which EMMS player are you
using? Do you have PulseAudio or some other sound server running?

(I don't object using the -c parameter with amixer: if it works for you
then it's fine, of course. But I would like to understand what is
causing the issue.)

thanks,
Petteri
Bob Newell
2017-11-08 01:40:10 UTC
Permalink
Post by Petteri Hintsanen
It sounds somewhat peculiar to me that you have to configure a separate
card for amixer but not for the player. Which EMMS player are you
using? Do you have PulseAudio or some other sound server running?
If it sounds peculiar to you think how I felt when I found this out!
It is strange. I am using VLC and PulseAudio. At the time, I got a new
Asus Zenbook and just transferred over my old Emacs stuff. Playing
music with EMMS was fine but the volume control didn't work and I had
to externally (outside Emacs) change volume. Then I traced through and
found that my master card was 1, not 0.
Post by Petteri Hintsanen
(I don't object using the -c parameter with amixer: if it works for you
then it's fine, of course. But I would like to understand what is
causing the issue.)
Fair enough, and of course you don't have to use -c if card 0 is your master.
--
Bob Newell
Honolulu, Hawai`i

Sent via Linux Mint 17.
Loading...