*973Opinion
BEDSWORTH, Acting P. J.Appellant Juan Roldan was sentenced to life in prison without parole for carrying out a pair of shootings against rival gang members. He contends he was denied a fair trial because the victim of one of the shootings was deported after the preliminary hearing and he did not have the opportunity to confront him at trial. We agree this amounted to a violation of Roldan’s rights. Accordingly, we reverse the convictions stemming from that particular shooting. We also modify the judgment to properly reflect the trial court’s sentencing decision and to award Roldan one additional day of presentence custody credit. In all other respects, we affirm.
FACTS
On December 28, 2006, Sabas Barrera was shot during an encounter that occurred in an area of Santa Ana claimed by the Lyon Street gang. By the time of trial, Barrera had been deported to Mexico, but the trial court allowed the prosecution to introduce his preliminary hearing testimony into evidence.
At that hearing, Barrera testified he was a member of Lyon Street at the time of the shooting. He said he and a friend were waiting in the heart of territory his gang claimed when a white car pulled up to them. His friend walked toward the car and began speaking with the driver, while Barrera stayed on the sidewalk. Then the front passenger stepped out of the car and came toward Barrera. Barrera recognized the man as appellant Juan Roldan because he had done time with him at a youth correctional camp. At the camp, Barrera did not get along with Roldan because Roldan belonged to the Walnut Street gang, a rival of Lyon Street.
Upon alighting from the car, Roldan asked Barrera “where he was from,” which forced Barrera to either admit or deny his gang membership. Barrera chose the former option, telling Roldan he belonged to Lyon Street. In response, Roldan pulled out a gun and shot him three times. Barrera blacked out and did not regain consciousness until three weeks later. His injuries required multiple surgeries, and he was not released from the hospital until the spring of 2007.
In July 2008, Barrera was arrested on a probation violation for associating with members of Lyon Street. He was only expected to serve five months in jail for the violation. However, when his sentence ended in December 2008, he was kept in the Orange County jail on a federal immigration hold for nine months, until after the preliminary hearing in this case, in September 2009. Following his testimony at the preliminary hearing, Barrera was turned over to federal authorities and deported to Mexico.
*974The second shooting at issue here occurred on December 17, 2006, 11 days before Barrera was shot. That day, Fernando Garcia, Angel Secundino, Gabriel Perez and Vanessa Diaz were walking in an alley claimed by their gang, the Topers. As they exited the alley, a car with five or six people inside pulled up to them. The people in the car yelled out, “Fucking Lops,” and Garcia’s group responded by making the letter “L” with their hands. Then the front passenger and at least one of the rear passengers got out of the car and walked toward Garcia’s group. Garcia asked them where they were from, and they said “Walnut.” Garcia responded, “This is Topers,” thinking there was going to be a fight. Instead, someone in the car bellowed, “Shoot them already,” and several shots rang out in rapid succession.
Secundino and Perez were shot in the head and died on the scene, but Garcia survived a gunshot to the stomach. While he was lying on the ground after the shooting, police officers asked him if he knew who shot him. Although Garcia was badly wounded, he responded, “Juan Roldan.” When asked if he knew where Roldan was from, he made a “W” with his fingers and said “Walnut.”
The police investigation revealed a semiautomatic pistol and a .38-caliber revolver were both fired at the scene. The revolver was found during a search of Roldan’s house, and the pistol was found on Walnut Street member Norberto Hernandez when he was arrested.
Garcia was hospitalized for months following the shooting. Following his release, investigators interviewed him at his home on March 1, 2007. They showed him a series of photographic lineups, and Garcia identified Roldan’s codefendant Oiram Ayala as the person who shot him and Roldan as someone who was in or near the car at the time of the shooting. Garcia also said Walnut Street members Norberto Hernandez and Angel Garcia were present during in the shooting.
Gang detective and expert witness Matthew McLeod testified Roldan is a “shot caller” in Walnut Street, and higher up in the gang than Ayala. McLeod said that could explain why Garcia changed his story and implicated Ayala as the shooter after initially identifying Roldan at the scene. McLeod said that in his experience, it is not uncommon for witnesses to gang crimes to change their stories out of fear of retaliation.
Speaking to the culture of criminal street gangs, McLeod testified, “respect is the be all and end all of their existence.” He said gangs and their individual members earn respect by committing violent acts and instilling fear in others. Gang members are also expected to back each other up when committing crimes. In the case of Walnut Street, its crimes range from vandalism and car *975theft all the way up to murder. In fact, from 2005 to 2010, the gang was involved in no fewer than four murders McLeod was aware of. McLeod also said guns are often passed around freely in gangs and as high-ranking members of Walnut Street, Roldan and Hernandez would be expected to be armed on most occasions. As for the shootings at issue in this case, McLeod opined they would benefit Walnut Street, both by demonstrating how ruthless the gang is and by diminishing the ranks of its rivals.
The defense presented evidence from Vanessa Diaz, who, as noted above, was with the victims at the time of the Lopers shooting. According to Diaz, two bandana-wearing gunmen got out of the car when it approached her group. She recognized Angel Garcia, also known as Mono, one of the men. No words were exchanged, but Secundino did lift up his shirt, revealing a Lopers tattoo to the gunmen. After that, Mono shot both Secundino and Perez.
Roldan and Ayala were jointly charged with murdering Secundino and Perez in the first degree and attempting to murder Garcia. Gang, firearm and special circumstances allegations were also alleged against them. In addition, Roldan was separately charged with attempted murder, aggravated assault and street terrorism in connection with the Barrera shooting. Following a joint trial, Roldan was convicted of the counts involving Barrera, but the jury deadlocked on the counts arising from the Lopers shooting.1 Roldan and Ayala were then retried on the deadlocked counts, and the jury found them guilty as charged. Thereupon, the court sentenced them to multiple life sentences. Roldan not only received 40 years to life for attempting to murder Barrera with a firearm, he also received life without parole on each of the murder counts. Having already affirmed the judgment as to Ayala {People v. Ayala (Jan. 30, 2012, G044395) [nonpub. opn.]), we now turn our attention to Roldan’s appeal.
I
Roldan’s primary argument relates to the court’s decision to admit Barrera’s preliminary hearing testimony into evidence. He contends this violated his confrontation rights because the prosecution failed to show Barrera was unavailable at the time of trial, and he did not have an adequate opportunity to cross-examine Barrera at the preliminary hearing. We agree the prosecution did not meet its burden of showing Barrera was unavailable to testify at trial. Therefore, we must reverse the counts pertaining to Barrera on that basis.
*976As set forth above, Barrera was shot on December 28, 2006. In July 2008, he was arrested on a probation violation and served a five-month sentence for that transgression. However, when his sentence ended in December 2008, he was not released. Instead, he remained in the Orange County jail on a federal immigration hold for nine more months, until the preliminary hearing, which was held on September 17, 2009. After the hearing, Barrera was promptly released to federal authorities and deported to Mexico.
Roldan’s trial began on February 4, 2010. At that time, the prosecution sought to admit Barrera’s preliminary hearing testimony into evidence on the basis he had been deported and could not be located to testify at trial. The prosecutor stated, “We were holding [Barrera] at the preliminary hearing because we knew he was subject to deportation. The People would be requesting to read his testimony from the preliminary hearing when we get to that part of the case.”
Defense counsel objected to the request. He argued, “The issue here [is that the] People had control of this witness, and I think he was subject to a 1332 hold, if I’m not mistaken, for nine or ten months pending his testimony at the preliminary hearing. The government had control over him and let him go. So, in a sense, they created their own unavailability.”2 Defense counsel also alleged he was not made aware of Barrera’s deportation until the prosecutor informed him of it that very morning, which was the first day of trial. The prosecutor did not dispute this allegation.
At defense counsel’s request, the court held a hearing on the issue of Barrera’s purported unavailability. Kevin Ruiz, an investigator with the Orange County District Attorney’s Office, was the sole witness at the hearing. He testified he spoke to Barrera after Barrera testified at the preliminary hearing. At that time, Barrera was already in the process of being deported by the federal government. Barrera told Ruiz he had a sister in Santa Ana and some relatives in the Lake Elsinore area, but he did not know their addresses or phone numbers. He also said that once he was deported, he would probably go to Tijuana to look for relatives he could stay with. However, he did not provide any specific information about his relatives or where he expected to be living. He did tell Ruiz he would be willing to come back and testify at Roldan’s trial, though.
Ruiz further testified that, following Barrera’s deportation, he tried to contact Barrera’s relatives to find out where he was living. However, because *977the contact information Barrera provided was so “generic,” he was unsuccessful. Despite checking various leads and databases, Ruiz was unable to obtain any information regarding Barrera’s whereabouts.
Asked about Barrera’s status prior to the preliminary hearing, Ruiz said he was in custody on suspicion of being an illegal alien. Since there were no state charges pending against him, the immigration hold was the sole basis for his incarceration. And even though he was being housed in the Orange County jail, he was in the legal custody of the federal government. Ruiz said the federal government was willing to hold off deporting Barrera until after the preliminary hearing, in order to assist the state in prosecuting Roldan. But it was not willing to keep Barrera in custody beyond that time.
Ruiz testified this was consistent with his experience in other, cases he had worked on. He said there used to be a “protocol” in place under which illegal aliens facing deportation could be kept in custody longer if they were witnesses to state crimes. However, “because of a change over in the federal government because of cost, they decided basically that they weren’t going to” do that anymore. Now, apparently, the standard practice is to keep illegal alien witnesses in custody until the time of the preliminary hearing in the state proceedings, but not beyond then.
Knowing Barrera was subject to deportation, Ruiz had communicated with a United States Immigration and Customs Enforcement (ICE) official in an attempt “to find some type of remedy to keep [Barrera] here.” Ruiz could not recall who he contacted or when the contact occurred; he only said the contact occurred “during [the] time frame” of the preliminary hearing, perhaps on that very day. In any event, the official told Ruiz—in so many words—that Barrera was going to be deported, and there was nothing he could do about it.
Following Ruiz’s testimony, defense counsel represented to the court that he had labored under the mistaken belief Barrera was subject to a section 1332 material witness hold at the time of the preliminary hearing. However, as the trial court correctly noted, there is nothing in the record to suggest material witness proceedings were ever instituted.
According to the prosecutor, she did not seek to have Barrera held as a material witness, but she did not want him to be deported before trial either. The prosecutor represented that she and Ruiz “had both been in contact with I.C.E. officials attempting to keep Mr. Barrera here. He was being held in custody on this matter so that he could testify. I.C.E. refused to hold him in custody any longer after the [preliminary hearing], even though we wrote emails, letters, et cetera, attempting to get him to stay here. As was *978mentioned, he was not a reluctant witness, although he was being held in custody because I.C.E. would not release him to us. We attempted to get him released to our custody, even, and they wouldn’t release him to us either. [][] I don’t recall the issue of a hold ever coming up, . . . and I certainly would not have asked that it be removed. I was trying to keep [Barrera] here.”
After taking the matter under submission, the court determined the prosecution had used good faith and due diligence in attempting to secure Barrera’s presence for trial. It therefore allowed his preliminary hearing testimony to be read to the jury.
Roldan argues the prosecution should have done more in terms of attempting to make Barrera available for trial. Roldan does not fault the prosecution for failing to locate Barrera after he was deported, nor does he dispute the federal government has plenary power over the states on issues relating to immigration. Nonetheless, Roldan maintains the prosecution should have sought to have Barrera detained as a material witness or allowed him to be conditionally examined on videotape, so the jury would have had the opportunity to observe his demeanor under questioning. Roldan also claims that since the prosecution knew Barrera was going to be deported after the preliminary hearing, it should have impressed on him the need to stay in touch with investigators or at least informed defense counsel of his impending deportation. We agree with Roldan that the prosecution failed to use due diligence in attempting to secure Barrera’s attendance at trial.
“A criminal defendant has the right, guaranteed by the confrontation clauses of both the federal and state Constitutions, to confront the prosecution’s witnesses. [Citations.] The right of confrontation ‘seeks “to ensure that the defendant is able to conduct a ‘personal examination and cross-examination of the witness, in which [the defendant] has an opportunity, not only of testing the recollection and sifting the conscience of the witness, but of compelling him to stand face to face with the jury in order that they may look at him, and judge by his demeanor upon the stand and the manner in which he gives his testimony whether he is worthy of belief.’ ” [Citation.] To deny or significantly diminish this right deprives a defendant of the essential means of testing the credibility of the prosecution’s witnesses, thus calling “into question the ultimate ‘ “integrity of the fact-finding process.” ’ ” [Citation.]’ [Citation.]
“Although important, the constitutional right of confrontation is not absolute. [Citations.] ‘Traditionally, there has been “an exception to the confrontation requirement where a witness is unavailable and has given testimony at previous judicial proceedings against the same defendant [and] which was subject to cross-examination . . . .” [Citation.]’ [Citation.] Pursuant *979to this exception, the preliminary hearing testimony of an unavailable witness may be admitted at trial without violating a defendant’s confrontation right. [Citation.]
“This traditional exception is codified in the California Evidence Code. [Citation.] Section 1291, subdivision (a)(2), provides that ‘former testimony,’ such as preliminary hearing testimony, is not made inadmissible by the hearsay rule if ‘the declarant is unavailable as a witness,’ and ‘[t]he party against whom the former testimony is offered was a party to the action or proceeding in which the testimony was given and had the right and opportunity to cross-examine the declarant with an interest and motive similar to that which he has at the hearing.’ Thus, when the requirements of section 1291 are met, the admission of former testimony in evidence does not violate a defendant’s constitutional right of confrontation. [Citation.]” (People v. Herrera (2010) 49 Cal.4th 613, 620-621 [110 Cal.Rptr.3d 729, 232 P.3d 710], fns. omitted.)
However, “[a] witness who is absent from a trial is not ‘unavailable’ in the constitutional sense unless the prosecution has made a ‘good faith effort’ to obtain the witness’s presence at the trial. [Citation.] The United States Supreme Court has described the good faith requirement this way: ‘The law does not require the doing of a futile act. Thus, if no possibility of procuring the witness exists (as, for example, the witness’ intervening death), “good faith” demands nothing of the prosecution. But if there is a possibility, albeit remote, that affirmative measures might produce the declarant, the obligation of good faith may demand their effectuation.” The lengths to which the prosecution must go to produce a witness ... is a question of reasonableness. [”] [Citation.] The ultimate question is whether the witness is unavailable despite good-faith efforts undertaken prior to trial to locate and present that witness.’ [Citation.]
“Our Evidence Code features a similar requirement for establishing a witness’s unavailability. Under section 240, subdivision (a)(5) . . . , a witness is unavailable when he or she is ‘[a]bsent from the hearing and the proponent of his or her statement has exercised reasonable diligence but has been unable to procure his or her attendance by the court’s process.’ . . . The term ‘[Reasonable diligence, often called “due diligence” in case law, “ ‘connotes persevering application, untiring efforts in good earnest, efforts of a substantial character.’ ” ’ [Citation.] Considerations relevant to the due diligence inquiry ‘include the timeliness of the search, the importance of the proffered testimony, and whether leads of the witness’s possible location were competently explored.’ [Citation.] In this regard, ‘California law and federal constitutional requirements are the same ....’ [Citation.]” (People v. Herrera, supra, 49 Cal.4th at p. 622, italics omitted.)
*980Ultimately, the burden is on the government to prove it has exercised good faith and due diligence in attempting to secure a witness’s attendance for trial. (Ohio v. Roberts (1980) 448 U.S. 56, 74 [65 L.Ed.2d 597, 100 S.Ct. 2531], overruled on other grounds in Crawford v. Washington (2004) 541 U.S. 36 [158 L.Ed.2d 177, 124 S.Ct. 1354].) On review of this issue, we must defer to the trial court’s factual findings that are supported by substantial evidence, but we “independently review whether the facts demonstrate prosecutorial good faith and due diligence.” (People v. Herrera, supra, 49 Cal.4th at p. 623.)
While Roldan concedes the prosecution used good faith and due diligence in attempting to locate Barrera following his deportation, the question remains whether the state did enough to secure his attendance at trial. In mating this determination, we must keep in mind that Barrera was a key witness for the prosecution; other than his preliminary hearing testimony, there was no direct evidence implicating Roldan as the person who shot him.3
We must also remember that the requirement of due diligence is not limited to situations in which the prosecution is trying to find a witness who has gone missing. “[N]o less important ‘is the duty to use reasonable means to prevent a present witness from becoming absent.’ [Citation.] If the prosecution fails in this latter duty, it does not satisfy the requirement of due diligence. [Citation.]” (People v. Louis (1986) 42 Cal.3d 969, 991 [232 Cal.Rptr. 110, 728 P.2d 180], italics added; accord, U.S. v. Tirado-Tirado (5th Cir. 2009) 563 F.3d 117, 124 [“ ‘the government’s good faith efforts to assure (a witness’s[]) availability at trial should include efforts aimed at keeping the witness[] in the United States’ ”].)
Moreover, even when a witness’s deportation prior to trial cannot reasonably be avoided, the government must still undertake reasonable and good faith efforts to procure his attendance at trial. (U.S. v. Tirado-Tirado, supra, 563 F.3d at pp. 123-126; U.S. v. Wilson (N.D.Cal. 1999) 36 F.Supp.2d 1177, 1180-1182.) In other words, the government cannot simply throw up its hands and do nothing when faced with the prospect of one of its witnesses being deported or leaving the country on his own accord. Instead, it must undertake reasonable efforts to preserve the defendant’s constitutional right to be confronted with the witnesses against him. (U.S. v. Tirado-Tirado, at pp. 123-126; U.S. v. Wilson, at pp. 1180-1182.)
In this case, one of the things the prosecution could have done to protect Roldan’s right of confrontation was to videotape Barrera’s preliminary *981hearing testimony. (See §§ 1335-1345 [procedures for allowing the videotaped examination of a witness who is expected to be absent at the time of trial]; People v. Ware (1978) 78 Cal.App.3d 822, 828 [144 Cal.Rptr. 354] [procedures apply in the context of a preliminary hearing].) Since the prosecution knew the federal government intended to deport Barrera following the preliminary hearing, videotaping his testimony would have allowed the jury to “ ‘ “look at him, and judge by his demeanor upon the stand and the manner in which he [gave] his testimony whether he [was] worthy of belief.” ’ [Citations.]” (People v. Ware, supra, 78 Cal.App.3d at pp. 831-832 [fact that victim’s preliminary hearing testimony was videotaped and played to the jury was a key component of the court’s holding that the victim’s absence from the trial did not violate the defendant’s confrontation rights].) This would have facilitated a chief objective of the confrontation clause, which is to allow the jury an opportunity to observe the witnesses’ demeanor while testifying under oath. (See generally U.S. v. Yida (9th Cir. 2007) 498 F.3d 945, 950-951 [extolling virtues of live testimony over documentary evidence].)
We agree with the Attorney General that the videotaping of Barrera’s preliminary hearing testimony “was not a necessary condition to a finding of unavailability.” But the fact the prosecution failed to secure Barrera’s preliminary hearing testimony on videotape, and also failed to notify the defense of Barrera’s pending deportation, so that they might endeavor to do so, is a relevant and significant consideration in the due diligence analysis.
Another factor is the prosecution’s failure to pursue any judicial remedies in attempting to secure Barrera’s presence at trial. Our Supreme Court has recognized that when an important witness is at risk of becoming unavailable prior to trial, the prosecution’s failure to seek his detention as a material witness under section 1332 is germane to the question of whether it exercised due diligence in attempting to secure the witness’s attendance at trial. (People v. Louis, supra, 42 Cal.3d at p. 993; People v. Hovey (1988) 44 Cal.3d 543, 564 [244 Cal.Rptr. 121, 749 P.2d 776].) It is no doubt true that due process considerations prevent the years-long detention of a witness' whose testimony is relatively unimportant to the prosecution’s case. (See, e.g., People v. Hovey, supra, 44 Cal.3d at p. 564 [prosecution’s failure to invoke material witness provisions did not demonstrate lack of due diligence where the witness would had to have been detained over two years from the time of the preliminary hearing until trial and his testimony was largely cumulative of another witness’s].) But courts have sanctioned the months-long detention of material witnesses when they possess vital information about the alleged offenses. (In re Francisco M. (2001) 86 Cal.App.4th 1061 [103 Cal.Rptr.2d 794] [rejecting claim that the eight- and 10-week detention of material witnesses in murder case was violative of the state or federal Const.]; U.S. v. Mercedes (D.P.R. 2001) 164 F.Supp.2d 248.)
*982The Attorney General questions whether a state court has the power to order the detention of an illegal alien who is facing deportation by the federal government. However, by its terms, section 1332 authorizes the court to detain “any” person who is a material witness in the case. (§ 1332, subd. (a).) And since Barrera was in custody of local authorities when he appeared at the preliminary hearing, we see no reason why the court could not have ordered his detention at that time. (See, e.g., State v. Larraco (2004) 32 Kan.App.2d 996 [93 P.3d 725] [state court ordered the detention of a material witness who was facing deportation].) Nor are we able to understand why the prosecution would not have sought such an order; its position would certainly be stronger today if it had tried and been refused.
We recognize Barrera had already been in custody for several months by the time the preliminary hearing was held. However, given his importance to the case, ordering his detention as a material witness for a few more months until the time of trial would not have been an unreasonable exercise of judicial authority. Moreover, as Roldan points out, it is possible that trial on the counts pertaining solely to Barrera could have been expedited in order to reduce the length of his detention.
The Attorney General rightly notes that, even had the trial court ordered Barrera detained as a material witness, the federal government would not have been required to defer Barrera’s deportation on that basis. (See generally People v. Jacinto (2010) 49 Cal.4th 263, 272 [109 Cal.Rptr.3d 610, 231 P.3d 341] [“The federal government’s power over immigration issues is supreme.”].) But we will never know what the outcome would have been because the prosecution made no effort. As the case of People v. Sandoval (2001) 87 Cal.App.4th 1425 [105 Cal.Rptr.2d 504] (Sandoval) illustrates, the prosecution’s failure to seek such an order is germane to the issue of due diligence.
Sandoval involved a witness who voluntarily returned to his home in Mexico after testifying at the defendant’s preliminary hearing. In finding the prosecution had failed to make a reasonable, good faith effort to secure the witness’s attendance for trial, the Sandoval court noted the United States and Mexico have a treaty that provides for mutual assistance in obtaining witnesses for trial. (Sandoval, supra, 87 Cal.App.4th at pp. 1438-1443.) Although the witness’s presence could not have been compelled under the treaty, the court found it significant that the prosecution had not even tried to invoke the treaty in that case. Pointing to the United States Supreme Court’s decision in Barber v. Page (1968) 390 U.S. 719 [20 L.Ed.2d 255, 88 S.Ct. 1318], the court observed:
*983“Barber held that a good faith effort must be undertaken even though the court itself does not have the power to compel the attendance of the witness. There, ... the witness whose testimony was sought in a state trial court was incarcerated in a federal prison in a different state. In holding that the prosecution was required to make a good faith effort to obtain the attendance of the witness, the court noted that the ability to obtain such attendance depended on the discretionary cooperation of federal authorities. It concluded, however, that ‘ “the possibility of a refusal is not the equivalent of asking and receiving a rebuff.” ’ [Citation.]” {Sandoval, supra, 87 Cal.App.4th at p. 1441.)
In other words, the law does not make “the court’s power to compel attendance the sine qua non of the requirement to make a good faith effort to obtain the attendance of a witness. Instead, power to compel is merely one factor to consider in determining whether such effort would be futile and therefore need not be undertaken.” {Sandoval, supra, 87 Cal.App.4th at pp. 1440-1441; accord, People v. Herrera, supra, 49 Cal.4th at p. 628 [“unavailability in the constitutional sense does not invariably turn on the inability of the state court to compel the out-of-state witness’s attendance through its own process, but also takes into consideration the existence of agreements or established procedures for securing a witness’s presence that depend on the voluntary assistance of another government”]; People v. Louis, supra, 42 Cal.3d at p. 992 [while acknowledging that certain untried means would have been unlikely to secure a particular prosecution witness’s attendance at trial, the court observed the state’s failure to pursue those means plainly conflicted with its claim of due diligence].)
In addition to trying to have Barrera detained as a material witness, the prosecution could have sought to delay his deportation under federal regulations, which recognize it is generally in the best interests of the federal government to temporarily delay the departure of an illegal alien who is needed as a witness in a pending criminal case. (8 C.F.R. §§ 215.2, 215.3 (2012).) These “regulations mandate that no alien material witness shall depart, or attempt to depart, from the United States unless the prosecuting authority consents to his departure.” (U.S. v. Guadian-Salazar (5th Cir. 1987) 824 F.2d 344, 348; see also People v. Jacinto, supra, 49 Cal.4th at p. 274 [referring to these regulations as “legal tools” which could have been used to facilitate the attendance of a witness who was deported to Mexico before the defendant’s trial began].)
When a witness to a state crime is in federal custody, federal courts also have the power to “issue writs of habeas corpus ad testificandum at the request of state prosecutorial authorities. [Citations.]” {Barber v. Page, supra, 390 U.S. at p. 724, italics added & omitted.) The law contemplates the use of *984this remedy when, as here, it is necessary to bring a witness into court for purposes of giving testimony at a criminal trial. (See, e.g., People v. Grice (N.Y.App.Div. 2011) 84 A.D.3d 1419 [921 N.Y.S.2d 727, 729-730] [even though federal authorities had indicated they were unwilling to delay the deportation of a material witness until after the defendant’s trial, the prosecution applied for a writ of habeas corpus ad testificandum to compel the witness’s attendance at trial, which supported a finding of due diligence].)
The Attorney General argues that by informally contacting ICE officials and asking them to delay Barrera’s deportation, the prosecution did all it could as far as these remedies are concerned. But the record does not disclose whether any of these remedies even came up as part of the discussion to secure Barrera’s presence at trial. Investigator Ruiz testified he contacted one ICE official about Barrera’s situation, and the prosecutor said she “wrote emails, letters, et cetera,” to convince the federal government to keep Barrera here, but none of these were introduced. We do not know the grounds upon which they sought Barrera’s continued detention or the arguments they made. Had the prosecution formally invoked the above mentioned remedies, it is quite possible the federal government would have looked upon the prosecution’s request more carefully. At least there would be a record documenting precisely which efforts the prosecution undertook to secure Barrera’s attendance at trial.
As it stands, there is no such record. The prosecution is essentially asking us to find it did all it could do to secure Barrera’s attendance at trial, simply because it says it did, and despite its failure to resort to measures discussed in reported cases. We believe the Sixth Amendment demands a more particularized showing of due diligence than that. After all, as we have noted, the prosecution has the burden of proof when it comes to establishing the unavailability of its witnesses.
Short of invoking the aforementioned legal remedies, the prosecution could have utilized other methods in attempting to secure Barrera’s attendance at trial. These include; (1) Subpoenaing Barrera or giving him other written notice regarding the trial prior to his deportation; (2) impressing upon him he was a material witness and obtaining his assurance he would return; (3) giving him contact information so he could stay in touch with authorities here; and (4) providing him with information and resources to facilitate his reentry to the United States to testify at trial. (U.S. v. Tirado-Tirado, supra, 563 F.3d at pp. 123-125; U.S. v. Wilson, supra, 36 F.Supp.2d at pp. 1181-1182; State v. Larraco, supra, 93 P.3d at pp. 732-734.) They could have obtained—or made a record of exhaustive attempts to obtain—better contact information than the “generic” information they had about family in the United States and Mexico. While the prosecution may not have been able *985to forestall Barrera’s deportation prior to trial, these measures could have been utilized to increase the chances of his returning for trial.
At an absolute minimum, the prosecution should have at least notified defense counsel of Barrera’s impending deportation so he “could take such action as [he] deemed necessary to make [Barrera] available at trial.” {People v. Mejia (1976) 57 Cal.App.3d 574, 582 [129 Cal.Rptr. 192].) However, the record shows the prosecution never mentioned to defense counsel the possibility—or later the fact—of Barrera’s deportation until the first day of trial, months after he was deported. This deprived the defense of any meaningful opportunity to secure Barrera’s appearance for trial, cross-examine him differently at the preliminary hearing, or memorialize his testimony on videotape. {Ibid.)
All things considered, we cannot say the prosecution did enough to secure Barrera’s attendance at trial. While we discern no evidence of bad faith on the part of the prosecution, its efforts to make Barrera available for trial do not constitute due diligence under the law. Roldan’s convictions arising from the Barrera shooting must be reversed.4
II
Roldan also contends the trial court erred in allowing Detective McLeod to testify about certain aspects of his investigation. Roldan argues McLeod’s testimony encompassed irrelevant hearsay and invited improper speculation by the jury. We do not see it that way.
Detective McLeod was not only the prosecution’s gang expert, he was also the lead investigator on the case. Over defense objection, he testified that during his investigation into the Lopers shooting, he learned the shooters arrived at the scene in a black Chrysler. He further testified the car was registered to the father of Marco Perez, who was one of the six people arrested in connection with the shooting.
Roldan argues that, taken together, this testimony left “the impression that the arrestees who were not on trial with [him] and Ayala had ‘talked,’ giving information about the identity of the car ... . Jurors could reasonably infer that when the arrestees gave their statements, they implicated not only the culprit who provided the car but also Roldan. In effect, the jury was given to *986understand that the police had arrested the right people and knew from the interrogations exactly who was involved and in what role.” Given all the evidence in the case, we see no reason for the jury to interpret McLeod’s testimony in this fashion.
For starters, McLeod did not identify the arrestees as the source of the information about the car. And in fact, as respondent points out, other witnesses had firsthand knowledge about the car. For example, victim Garcia and witnesses Vanessa Diaz and Isaiah Salas all said the assailants’ car was black, and Garcia and Salas actually identified a photograph of the car. They also told the police they saw five or six people in the car, so the fact six people were arrested in the case would not have come as a great surprise to the jury. After all, it is quite clear from the evidence that the occupants of the car were heavily armed and bent on asserting dominance over a rival gang.
Roldan argues that since only he and Ayala were on trial in this case, the jury would infer the other arrestees had already been convicted and assume he was guilty by virtue of his association with them at the scene. However, the jurors were instructed there could be many reasons why other people who might have been involved in the charged offenses were not on trial. They were also told not to speculate as to whether such persons had been or would be prosecuted. (CALJIC No. 2.11.5.) We do not think the jury would have been inclined to jump to the conclusions Roldan fears they did.
At the end of the day, we are confident it was not the description of the car or the fact multiple people were arrested in the case that led to Roldan being convicted. Rather, it was the overall strength of the prosecution’s case, including statements from victim Garcia that squarely implicated Roldan in the shooting. Any error that occurred by virtue of the challenged evidence being admitted was immaterial and does not compel reversal.
Ill
Roldan also contends the prosecutor committed misconduct in her closing argument. Again, we disagree.
In her closing remarks to the jury, the prosecutor argued that, with respect to the murder of Secundino and Perez, the evidence was susceptible of an interpretation supporting Roldan’s guilt as either a direct perpetrator or an aider and abettor. However, relying on Garcia’s statement at the scene of the shooting, the prosecutor put most of her stock in the former theory. She stated, “And remember . . . victim Garcia’s statement that Juan Roldan shot us. I’m going to get back to that, because I believe that Juan Roldan is the *987shooter. I believe that the testimony, I would submit to you the testimony of a person who thinks he’s dying on the ground when he says Juan Roldan shot us is very credible.”
Roldan maintains this amounted to improper vouching by the prosecutor, but his attorney did not object to the statements, only Ayala’s attorney did. And while Ayala’s counsel claimed the statements were “improper,” he did not specify the precise grounds for his objection. Therefore, the vouching issue has been waived. (People v. Wilson (2008) 44 Cal.4th 758, 793 [80 Cal.Rptr.3d 211, 187 P.3d 1041]; People v. Panah (2005) 35 Cal.4th 395, 462 [25 Cal.Rptr.3d 672, 107 P.3d 790].)
Even if it was not, it is clear the court properly overruled the objection because, although the prosecutor indicated she believed Roldan was the shooter, the context of her argument made it clear she was relying on the content and circumstances of Garcia’s statement to support that belief. “Prosecutorial assurances, based on the record, regarding the apparent honesty or reliability of prosecution witnesses, cannot be characterized as improper ‘vouching,’ which usually involves an attempt to bolster a witness by reference to facts outside the record.” (People v. Medina (1995) 11 Cal.4th 694, 757 [47 Cal.Rptr.2d 165, 906 P.2d 2].) Because the prosecutor did not imply she had knowledge of information unavailable to the jury, but instead grounded her argument in the facts of the case, she did not commit misconduct. (People v. Williams (1997) 16 Cal.4th 153, 257 [66 Cal.Rptr.2d 123, 940 P.2d 710].)
IV
Lastly, the parties agree Roldan is entitled to one additional day of presentence custody credit, and the abstract of judgment should be amended to reflect the fact the court stayed punishment on the section 186.22, subdivision (b)(5) gang enhancements attendant to the murder counts. We will modify the judgment accordingly.
DISPOSITION
Roldan’s convictions on counts 8 through 10 are reversed. In addition, the judgment is modified to award Roldan one additional day of presentence custody credit and to reflect the court’s sentencing decision to stay the section 186.22, subdivision (b)(5) gang enhancements on counts 1 and 2. The clerk *988of the trial court is directed to prepare an amended abstract of judgment reflecting these modifications and send a certified copy to the Department of Corrections and Rehabilitation. In all other respects, the judgment is affirmed.
Moore, J., and Ikola, J., concurred.
Appellant’s petition for review by the Supreme Court was denied August 8, 2012, S202923.
The jury acquitted Roldan and Ayala of other charges arising from a third shooting that is not at issue in this appeal.
Penal Code section 1332 empowers the court to have a material witness post security if there is good cause to believe he will not appear to testify. If the witness fails to do so, the court may order his detention subject to certain review procedures.
Unless noted otherwise, all further statutory references are to the Penal Code.
The only other evidence implicating Roldan was circumstantial and minimal: (1) The gang expert testified the shooting benefited Roldan’s gang by demonstrating how brutal it is and (2) the gun used in the shooting was found in the possession of Roldan’s fellow gang member Norberto Hernandez.
In light of this holding, we need not address Roldan’s alternative arguments that (1) he did not have an adequate opportunity to cross-examine Barrera at the preliminary hearing and (2) the court erred in allowing the prosecution to amend the information to add a premeditation allegation to the attempted murder charge. Given our decision to reverse the counts relating to the Barrera shooting, these arguments are moot.