Opened 16 years ago

Closed 14 years ago

Last modified 14 years ago

#5342 closed patch (fixed)

AudioOutputAlsa is only able to open the mixer of card 0

Reported by: stuartm Owned by: JYA
Priority: minor Milestone: unknown
Component: MythTV - Audio Output Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

While trying to get MythTV to use the mixer of card 1 in a new frontend I found the following note in AudioOutputAlsa?: TODO: This is opening card 0. Fix for case of multiple soundcards

I'd like to get this fixed ASAP, but if someone with a better knowledge of the ALSA api wants to help I'd appreciate it.

Attachments (2)

alsa_mixer_fix_5342_v1-trunk18117.patch (3.8 KB) - added by Alan Calvert <cal@…> 16 years ago.
alt_alsamixercontrol-v1.patch (15.6 KB) - added by Alan Calvert <cal@…> 16 years ago.
@18258

Download all attachments as: .zip

Change History (11)

comment:1 Changed 16 years ago by Alan Calvert <cal@…>

I believe the only error here lies with the TODO comment. In the alsa source, the \brief comment against snd_mixer_open() reads "Opens an empty mixer". The open function doesn't associate with any card whatsoever, it just yields a mixer handle which is subsequently bound to the nominated device via snd_mixer_attach().

comment:2 Changed 16 years ago by stuartm

The TODO comment is indeed out of date, it applied to an older version of the ALSA api where the second argument of snd_mixer_open did specify the device number.

However the problem still stands, or certainly did on the two occasions I've tried it - you can't change volume etc if using anything except the first device on the system.

Changed 16 years ago by Alan Calvert <cal@…>

comment:3 Changed 16 years ago by Alan Calvert <cal@…>

maybe baby ... patch attached.

comment:4 Changed 16 years ago by Alan Calvert <cal@…>

Having demonstrated (yet again) what a stupid old man I can be, I'll complete the exercise. With an sblive as card 0, an hda intel as card 1, and myth set to the hda it works fine. Swapping the arrangement over, hda as 0, sblive as 1, and myth on the sblive, it also works fine. When I initially plugged the second card in, it didn't work. I can only put that down to operator error(s) during the process of adjusting asound.conf to the altered arrangements (which always takes several attempts).

Changed 16 years ago by Alan Calvert <cal@…>

@18258

comment:5 Changed 15 years ago by danielk

Milestone: 0.21.1unknown
Priority: criticalminor
Severity: highlow
Type: defectpatch

comment:6 Changed 14 years ago by stuartm

Component: mythtvMythTV - Audio Output

comment:7 Changed 14 years ago by stuartm

Owner: changed from Isaac Richards to JYA
Status: newassigned

comment:8 Changed 14 years ago by JYA

Resolution: fixed
Status: assignedclosed

Revision r24864.

Rewrite entirely ALSA audio mixer controller. Use as basis code provided by Alan Calvert. This now opens the mixer associated to the output device. Fix ticket #5342.

comment:9 Changed 14 years ago by anonymous

Are you sure this hasn't broken things? Sound was working before, but with this commit I get the following errors in the log (and no sound). If I back out this one commit, sounds works again.

2010-05-28 19:49:33.973 ALSA, Error: snd_pcm_info_get_card: Operation not permitted 2010-05-28 19:49:33.973 Opening ALSA audio device 'default'. 2010-05-28 19:49:33.978 AudioOutput? Warning: mmap not available, attempting to fall back to slow writes 2010-05-28 19:49:34.225 ALSA, Error: no playback control PCM found on mixer device default 2010-05-28 19:49:34.227 AudioOutput? Error: Aborting reconfigure 2010-05-28 19:49:34.227 NVP(0): Disabling Audio, reason is: Aborting reconfigure

Note: See TracTickets for help on using tickets.