anand2532 opened a new pull request, #21633:
URL: https://github.com/apache/nuttx/pull/21633

   ## Summary
   
   `nxplayer` aborts on `sim:alsa` when the host ALSA mixer has no Master 
element. `sim_mixer_open()` leaves `priv->volume` NULL and still returns 
success. Setting the playback volume then calls 
`snd_mixer_selem_set_playback_volume_all()` with that NULL pointer, and ALSA 
asserts in `snd_mixer_selem_has_playback_channel`.
   
   Skip the volume and input-gain mixer get/set calls when `priv->volume` is 
NULL so PCM playback continues. Hosts that do have a volume element keep the 
existing mixer behavior. The second commit only corrects the nxstyle 
indentation already present in `sim_alsa.c`.
   
   Fixes #19413
   
   ## Impact
   
   This affects `sim:alsa` playback on a host whose mixer has no volume 
element. No board, build, API, or configuration change.
   
   ## Testing
   
   Host: Linux, no sound card, default PCM pointed at the ALSA file plugin.
   Config: `sim:alsa`.
   
   Before: `nxplayer` `play /data/center.wav` aborted with 
`snd_mixer_selem_has_playback_channel: Assertion 'elem' failed`.
   
   After: the same 1-second stereo WAV plays to completion. The captured file 
is 176400 bytes. `q` returns to NSH, and `poweroff` exits the simulator. No 
ALSA assertion.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to